---
title: "Generate an image (async)"
method: POST
path: "/v1/images/generate"
tags: ["Images"]
---

# Generate an image (async)

`POST /v1/images/generate`

## Request

- Base URL: `https://contentmaschine.ai/api`
- URL: `https://contentmaschine.ai/api/v1/images/generate`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://contentmaschine.ai/api/oauth/authorize`, token URL `https://contentmaschine.ai/api/oauth/token`)

Queue a text-to-image generation job.
Returns immediately with a `job_id`.
Poll `GET /v1/jobs/{id}` until `status` is `completed`, then use `download_url`.

## Request body

- object
  - `prompt` string, required: Text description of the image to generate.
  - `model` 'standard' | 'lite' | 'pro' | 'flux' | 'seedream' | 'seedream5' | 'gpt-image-2.5-flare': Model to use for generation. Discover the full list with options via GET /v1/models.
  - `aspect_ratio` '1:1' | '16:9' | '9:16' | '4:3' | '3:4' | '3:2' | '2:3': Aspect ratio of the generated image.
  - `options` object: Model-specific options.
    - `seed` integer: Seed for reproducible results.
    - `temperature` number, float: Creativity (0.0–2.0). Lower = closer to prompt. Ignored by the Gemini models, which no longer accept it.
    - `resolution` '1024' | '2048' | '4096': Output resolution (pro model only).

## Response `202`

Job queued

- JobQueued
  - `success` boolean
  - `data` object
    - `job_id` integer
    - `generation_id` integer
    - `generation_uuid` string, uuid
    - `status` string
    - `estimated_credits` number, float
  - `timestamp` string, date-time

## Other responses

- `401`: Missing or invalid API key
- `402`: Insufficient credits
- `422`: Validation error
- `default`: Any other error. Every failure this API emits uses the same envelope; branch on `error.type`, never on `error.message`, and quote `error.correlation_id` to support.

---

[API](https://skmtc.dev/contentmaschine/apis/contentmaschine-ai-api.md) · [All operations](https://skmtc.dev/contentmaschine/apis/contentmaschine-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/contentmaschine/apis/contentmaschine-ai-api/revisions/28c74f46051c?raw)
