POST
https://your-instance.com/v1/images/generationsSynchronous image generation in the OpenAI format. The response carries either a URL or base64 bytes depending on response_format.
Request body
modelstringrequiredImage model to use, e.g. gpt-image-2.
promptstringrequiredDescription of the image you want.
nintegerdefault: 1How many images to generate.
sizestringdefault: "1024x1024"Output dimensions. Supported sizes vary by model.
qualitystringdefault: "standard"Rendering quality. Higher quality costs more.
response_formatstringdefault: "url"Either "url" or "b64_json".
Example
curl https://your-instance.com/v1/images/generations \
-H "Authorization: Bearer $CLAWROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "A lighthouse in a storm, oil painting",
"size": "1024x1024"
}'