---
title: "Generate Images"
method: POST
path: "/v1/images/generations"
tags: ["v1 images"]
---

# Generate Images

`POST /v1/images/generations`

Dedicated image generation endpoint using the Universal Schema with flat parameters.
    
    **Universal Base Schema:**
    - user_id (str, required): The end-user ID
    - project_id (str, required): The project ID
    - persona_id (str, optional): The specific system persona/voice to use
    - disabled_learning (bool, optional): If true, request is ignored by long-term memory
    - use_reasoning (bool, optional): Enable reasoning loop for constraint-satisfying generation
    
    **Input:**
    - text_input (str, optional): The prompt/description for image generation
    - session_id (str, optional): Session ID for conversation context

    **Reference inputs:**
    - image_base64 (str, optional): Base64 encoded reference image for context
    - video_base64 (str, optional): Base64 encoded reference video for context
    - audio_base64 (str, optional): Base64 encoded reference audio for context
    
    **Image Params (Flat):**
    - model (str, optional): Model ID (default: gemini-3.1-flash). Available image models: gemini-3.1-flash, gemini-3-flash, gemini-3.1-pro
    - aspect_ratio (str, optional): Aspect ratio, e.g. "1:1", "16:9", "9:16" (default: 1:1).
    - resolution (str, optional): Resolution tier: "1K", "2K", or "4K" (default: 4K).
    - seed (int, optional): Random seed for reproducibility
    
    **Authentication**: Requires valid API key or JWT token

## Request body

- ImageGenerationRequest — Request model for image generation with Universal Schema + flat params
  - `user_id` string, required — The end-user ID
  - `project_id` string, nullable — The project ID
  - `persona_id` string, nullable — The specific system persona/voice to use
  - `disabled_learning` boolean — If true, this request is ignored by long-term memory
  - `use_reasoning` boolean — Enable Chain-of-Thought/Reasoning steps before generation
  - `max_reasoning_iterations` integer — Max reasoning steps if reasoning is enabled
  - `text_input` string, required — The prompt/description for image generation
  - `session_id` string, nullable — Session ID for conversation context
  - `image_base64` string, nullable — Base64 encoded reference image for context
  - `video_base64` string, nullable — Base64 encoded reference video for context
  - `audio_base64` string, nullable — Base64 encoded reference audio for context
  - `model` string — Image generation model ID
  - `aspect_ratio` string — Aspect ratio for the generated image, e.g. '1:1', '16:9', '9:16', '4:3', '3:4'.
  - `resolution` '1K' | '2K' | '4K' — Resolution tier for the generated image: '1K', '2K', or '4K'.
  - `seed` integer, nullable — Random seed for reproducibility
  - `temperature` number, nullable — Temperature for retrieval LLM calls (0.0-2.0). Lower = more deterministic.

## Response `200`

Successful Response

- ImageGenerationResponse — Response model for image generation
  - `image_base64` string, nullable — Base64 encoded image. Present when the payload is under ~30 MB. May be absent for very large outputs.
  - `image_url` string, nullable — Signed GCS URL to download the image (expires after 24 h). Always present when the upload succeeds.
  - `output_type` string — Delivery method: 'both' (base64 + url), 'url' (url only, base64 omitted due to size), or 'base64' (GCS upload failed).
  - `image_format` string — Image format, e.g. png, jpeg, webp
  - `success` boolean — Whether the request succeeded

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — User/Persona/Project Not Found
- `422` — Validation Error
- `500` — Internal Server Error

---

[API](https://skmtc.net/elicitlabs/apis/elicit-labs-api.md) · [All operations](https://skmtc.net/elicitlabs/apis/elicit-labs-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elicitlabs/elicit-labs-api/revisions/27701839a070/schema)
