Router.Images.Variations
Create a Variation
Create an Image Variationfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.router.images.variations.create(model="Altima", n=1, response_format="url", size="1024x1024", retry={
"on_codes": [
429,
500,
502,
503,
504,
],
}, cache={
"ttl": 3600,
"type": "exact_match",
}, load_balancer={
"type": "weight_based",
"models": [],
}, timeout={
"call_timeout": 30000,
}, orq={
"retry": {
"on_codes": [
429,
500,
502,
503,
504,
],
},
"fallbacks": [
{
"model": "openai/gpt-4o-mini",
},
],
"prompt": {
"id": "prompt_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"version": "latest",
},
"identity": {
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "jane.doe@example.com",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer",
},
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering",
],
},
"cache": {
"ttl": 3600,
"type": "exact_match",
},
"load_balancer": {
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7,
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3,
},
],
},
"timeout": {
"call_timeout": 30000,
},
})
# Handle response
print(res)
Show Parameters
Show Parameters
The image to edit. Must be a supported image file. It should be a png, webp, or jpg file less than 50MB.
The model to use for image generation.
The number of images to generate. Must be between 1 and 10.
The 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.The size of the generated images. Must be one of
256x256, 512x512, or 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
Retry configuration for the request
Show Properties of retry
Show Properties of retry
Number of retry attempts (1-5)
Cache configuration for the request.
Show Properties of cache
Show Properties of cache
Time to live for cached responses in seconds. Maximum 259200 seconds (3 days).
Load balancer configuration for the request.
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 Response
Show Response
The Unix timestamp (in seconds) of when the image was created.
The output format of the image generation
The size of the image generated
The quality of the image generated