v53

latestOpenAPI 3.1.0Apache-2.0raw.githubusercontent.com2026-08-021596144.5 KB
Images

Create an image

Creates an image given a prompt using the OpenAI-compatible Images API. The request returns one or more generated images as URLs or base64-encoded JSON data.

Not every provider implements the Images API. Requests routed to a provider that does not support it return 400 Bad Request with an explanatory error message; use /chat/completions for those providers.

post/images/generations

Query parameters

provider'ollama' | 'ollama_cloud' | 'groq' | 'llamacpp' | 'openai' | 'cloudflare' | 'cohere' | 'anthropic' | 'deepseek' | 'google' | 'mistral' | 'minimax' | 'moonshot' | 'nvidia' | 'zai'

Specific provider to use (default determined by model)

Request body

promptstring required

A text description of the desired image.

modelstring

Model ID to use for image generation.

ninteger

Number of images to generate.

size'auto' | '256x256' | '512x512' | '1024x1024' | '1536x1024' | '1024x1536' | '1792x1024' | '1024x1792'

The size of the generated images. The GPT image models support 1024x1024, 1536x1024, 1024x1536, and auto; gpt-image-2 also accepts arbitrary WIDTHxHEIGHT values such as 1536x864. dall-e-2 supports 256x256, 512x512, and 1024x1024; dall-e-3 supports 1024x1024, 1792x1024, and 1024x1792.

quality'auto' | 'standard' | 'hd' | 'low' | 'medium' | 'high'

The quality of the image. auto selects the best quality for the model. The GPT image models support low, medium, and high; dall-e-3 supports standard and hd; dall-e-2 supports only standard.

response_format'url' | 'b64_json'

The format in which the generated images are returned. Must be one of url or b64_json.

Response

Successful response

createdinteger required

The Unix timestamp (in seconds) of when the image was created.