Skip to main content
POST
/
images
/
generations
Create image
curl --request POST \
  --url https://api.llmrouter.app/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "<string>",
  "model": "<string>",
  "n": 1,
  "size": "1024x1024"
}
'
{
  "created": 1774975805,
  "id": "gen_11b25653-e44e-49ea-80ea-32fe8c5fb246",
  "model": "openai/gpt-5-image",
  "usage": {
    "input_tokens": 123,
    "total_tokens": 123,
    "output_tokens": 123,
    "cost": "<unknown>"
  },
  "data": [
    {
      "b64_json": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...",
      "url": "<string>",
      "revised_prompt": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

LLM Router API Key (e.g., sk-router-...)

Body

application/json

Accepts any additional properties supported by the upstream image model (e.g., quality, style).

prompt
string
required
model
string
required
n
integer
default:1
size
string
default:1024x1024

Response

200 - application/json

Successful image generation response

created
integer
required

Unix timestamp when the image was created

Example:

1774975805

id
string
required

Unique identifier for the generated image

Example:

"gen_11b25653-e44e-49ea-80ea-32fe8c5fb246"

model
string
required

The model used to generate the image

Example:

"openai/gpt-5-image"

usage
object
required
data
object[]
required