import requests
url = "https://my.orq.ai/v2/router/images/variations"
files = { "image": ("example-file", open("example-file", "rb")) }
payload = {
"model": "<string>",
"n": "1",
"response_format": "url",
"size": "1024x1024",
"user": "<string>",
"name": "<string>",
"fallbacks": "{
\"model\": \"<string>\"
}",
"retry": "{
\"count\": 3,
\"on_codes\": [
429,
500,
502,
503,
504
]
}",
"orq": "{
\"name\": \"<string>\",
\"retry\": {
\"count\": 3,
\"on_codes\": [
429,
500,
502,
503,
504
]
},
\"fallbacks\": [
{
\"model\": \"openai/gpt-5.4-mini\"
}
],
\"load_balancer\": {
\"type\": \"weight_based\",
\"models\": [
{
\"model\": \"openai/gpt-4o\",
\"weight\": 0.7
},
{
\"model\": \"anthropic/claude-3-5-sonnet\",
\"weight\": 0.3
}
]
},
\"fallback_on_codes\": [
499
]
}",
"fallback_on_codes": "499"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)