Orq MCP is live: Use natural language to interrogate traces, spot regressions, and experiment your way to optimal AI configurations. Available in Claude Desktop, Claude Code, Cursor, and more. Start now →
Create an Image
curl --request POST \
--url https://api.orq.ai/v2/router/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"model": "<string>",
"background": "transparent",
"moderation": "low",
"n": 1,
"output_compression": 50,
"output_format": "png",
"quality": "auto",
"response_format": "url",
"size": "<string>",
"style": "vivid",
"metadata": {},
"name": "<string>",
"fallbacks": [
{
"model": "<string>"
}
],
"retry": {
"count": 3,
"on_codes": [
429,
500,
502,
503,
504
]
},
"orq": {
"name": "<string>",
"fallbacks": [
{
"model": "openai/gpt-4o-mini"
}
],
"retry": {
"count": 3,
"on_codes": [
429,
500,
502,
503,
504
]
},
"load_balancer": {
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3
}
]
}
}
}
'{
"created": 123,
"data": [
{
"revised_prompt": "<string>",
"b64_json": "<string>",
"url": "<string>"
}
],
"usage": {
"input_tokens_details": {
"image_tokens": 123,
"text_tokens": 123
},
"input_tokens": 123,
"output_tokens": 123,
"total_tokens": 123
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
input
A text description of the desired image(s).
The model to use for image generation. One of openai/dall-e-2, openai/dall-e-3, or openai/gpt-image-1.
Allows to set transparency for the background of the generated image(s). This parameter is only supported for openai/gpt-image-1.
transparent, opaque, auto, null Control the content-moderation level for images generated by gpt-image-1. Must be either low or auto.
low, auto, null The number of images to generate. Must be between 1 and 10. For dall-e-3, only n=1 is supported.
1 <= x <= 10The compression level (0-100%) for the generated images. This parameter is only supported for gpt-image-1 with the webp or jpeg output formats.
0 <= x <= 100The format in which the generated images are returned. This parameter is only supported for openai/gpt-image-1.
png, jpeg, webp, null The quality of the image that will be generated. auto will automatically select the best quality for the given model.
auto, high, medium, low, hd, standard, null The format in which generated images are returned. Must be one of url or b64_json. This parameter isn't supported for gpt-image-1 which will always return base64-encoded images.
url, b64_json, null The size of the generated images. Must be one of the specified sizes for each model.
The style of the generated images. This parameter is only supported for openai/dall-e-3. Must be one of vivid or natural.
vivid, natural, null Optional metadata for the request. This metadata will be stored in the trace and can be used for filtering.
Show child attributes
The name to display on the trace. If not specified, the default system name will be used.
Array of fallback models to use if primary model fails
Show child attributes
Retry configuration for the request
Show child attributes
Cache configuration for the request.
Show child attributes
Load balancer configuration for the request.
Show child attributes
Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured.
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://api.orq.ai/v2/router/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"model": "<string>",
"background": "transparent",
"moderation": "low",
"n": 1,
"output_compression": 50,
"output_format": "png",
"quality": "auto",
"response_format": "url",
"size": "<string>",
"style": "vivid",
"metadata": {},
"name": "<string>",
"fallbacks": [
{
"model": "<string>"
}
],
"retry": {
"count": 3,
"on_codes": [
429,
500,
502,
503,
504
]
},
"orq": {
"name": "<string>",
"fallbacks": [
{
"model": "openai/gpt-4o-mini"
}
],
"retry": {
"count": 3,
"on_codes": [
429,
500,
502,
503,
504
]
},
"load_balancer": {
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3
}
]
}
}
}
'{
"created": 123,
"data": [
{
"revised_prompt": "<string>",
"b64_json": "<string>",
"url": "<string>"
}
],
"usage": {
"input_tokens_details": {
"image_tokens": 123,
"text_tokens": 123
},
"input_tokens": 123,
"output_tokens": 123,
"total_tokens": 123
}
}