Documentation Index
Fetch the complete documentation index at: https://docs.routing.run/llms.txt
Use this file to discover all available pages before exploring further.
Generate images from text prompts using the POST /v1/images/generations endpoint.
Request
curl -sS -X POST "https://api.routing.run/v1/images/generations" \
-H "Authorization: Bearer ${ROUTING_RUN_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"model": "route/qwen-image-2512",
"prompt": "a red fox in snow, cinematic lighting, detailed fur, pine forest background",
"response_format": "base64",
"width": 1024,
"height": 1024
}' \
-o response.json && \
jq -r '.data[0].b64_json' response.json | base64 --decode > qwen-image.png
Models
| Model |
|---|
route/hunyuan-image-3 |
route/flux-1-schnell |
route/qwen-image-2512 |
route/stable-diffusion-xl-base-1.0 |
Request body
Response
{
"created": 1704067200,
"data": [
{
"url": null,
"b64_json": "base64_encoded_image_data"
}
],
"provider": "chutes_image",
"model": "route/flux-1-schnell"
}
Image models are available on Premium, Max, and Ultra plans. Each image generation request consumes 5 requests from your daily quota.
Using with OpenAI SDK
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["ROUTING_RUN_API_KEY"],
base_url="https://api.routing.run/v1",
)
response = client.images.generate(
model="route/flux-1-schnell",
prompt="Isometric illustration of a small API gateway routing traffic",
size="1024x1024",
)
first = response.data[0]
print(first.url or (first.b64_json[:40] + "..."))