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 Variation
curl --request POST \
--url https://api.orq.ai/v2/router/images/variations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'model=<string>' \
--form 'image=<unknown>' \
--form n=1 \
--form response_format=url \
--form size=1024x1024 \
--form 'user=<string>' \
--form 'name=<string>' \
--form 'fallbacks={
"model": "<string>"
}' \
--form 'retry={
"count": 3,
"on_codes": [
429,
500,
502,
503,
504
]
}' \
--form 'orq={
"name": "<string>",
"retry": {
"count": 3,
"on_codes": [
429,
500,
502,
503,
504
]
},
"fallbacks": [
{
"model": "openai/gpt-4o-mini"
}
],
"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": [
{
"b64_json": "<string>",
"url": "<string>"
}
],
"output_format": "<string>",
"size": "<string>",
"quality": "<string>",
"usage": {
"total_tokens": 123,
"input_tokens": 123,
"output_tokens": 123,
"input_tokens_details": {
"text_tokens": 123,
"image_tokens": 123
}
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
input
The model to use for image generation.
The image to edit. Must be a supported image file. It should be a png, webp, or jpg file less than 50MB.
The number of images to generate. Must be between 1 and 10.
1 <= x <= 10The format in which the generated images are returned. Must be one of url or b64_json. URLs are only valid for 60 minutes after the image has been generated.
url, b64_json The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.
256x256, 512x512, 1024x1024 A unique identifier representing your end-user, which can help to monitor and detect abuse.
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
Represents an image variation response from the API.
The Unix timestamp (in seconds) of when the image was created.
The list of generated images.
Show child attributes
The output format of the image generation
The size of the image generated
The quality of the image generated
The token usage information for the image generation.
Show child attributes
Was this page helpful?
curl --request POST \
--url https://api.orq.ai/v2/router/images/variations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'model=<string>' \
--form 'image=<unknown>' \
--form n=1 \
--form response_format=url \
--form size=1024x1024 \
--form 'user=<string>' \
--form 'name=<string>' \
--form 'fallbacks={
"model": "<string>"
}' \
--form 'retry={
"count": 3,
"on_codes": [
429,
500,
502,
503,
504
]
}' \
--form 'orq={
"name": "<string>",
"retry": {
"count": 3,
"on_codes": [
429,
500,
502,
503,
504
]
},
"fallbacks": [
{
"model": "openai/gpt-4o-mini"
}
],
"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": [
{
"b64_json": "<string>",
"url": "<string>"
}
],
"output_format": "<string>",
"size": "<string>",
"quality": "<string>",
"usage": {
"total_tokens": 123,
"input_tokens": 123,
"output_tokens": 123,
"input_tokens_details": {
"text_tokens": 123,
"image_tokens": 123
}
}
}