POST /v1/images/generations

Image generation endpoint.

Inference APIs

Generate images through the gateway with upstream model selection, billing headers, and response passthrough.

POST/v1/images/generations

Request

  • Auth: tenant auth when enabled; otherwise dev mode is open
  • Content-Type: application/json
  • Max body size: 1 MiB

Request fields

FieldTypeRequiredNotes
promptstringyesRequired
modelstringnoDefaults to openai/dall-e-3 when omitted
nintegernoNumber of images
sizestringnoPassed upstream when present
qualitystringnohd is recognized for DALL-E 3 cost calculation
stylestringnoPassed upstream when present
response_formatstringnourl or b64_json depending on upstream support
userstringnoPassed upstream when present
metadata or arammobjectnoAttribution fields stripped before upstream dispatch

Response schema

FieldTypeRequiredNotes
createdint64yesUnix timestamp
dataarrayyesGenerated image results
data[].urlstringnoPresent when the provider returns URLs
data[].b64_jsonstringnoPresent when the provider returns base64 payloads
data[].revised_promptstringnoPrompt rewrite returned by some providers

Errors

HTTPCodeWhen
400invalid_request_errorMalformed JSON, missing prompt, unknown model, or unsupported provider
400provider_not_configuredProvider missing from config or unavailable
502provider-specificUpstream provider error normalized to the gateway envelope

Notes

  • The response body is passed through from the upstream provider.
  • Gateway billing headers are added when available.
  • model defaults to DALL-E 3 when omitted.