Documentation
Image, video, and speech APIs in the NexoRouter documentation.
Image, video, and speech APIs
Status: Stable public endpoints for the media model IDs returned by GET /v1/models.
Media requests use the same NexoRouter API key, prepaid balance, usage logs, and request IDs as chat requests. The Models and Pricing pages show each model's required endpoint and billing unit.
Generate an image
curl https://api.nexorouter.com/v1/images/generations \
-H "Authorization: Bearer $NEXOROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "Qwen/Qwen-Image",
"prompt": "A clean studio product photo on a white background",
"n": 1,
"size": "1024x1024"
}'
Image-editing models also require image as a public URL or Base64 data URL. The initial public release requires n: 1 so the full request price is authorized before generation.
Generate a video
curl https://api.nexorouter.com/v1/videos \
-H "Authorization: Bearer $NEXOROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2",
"prompt": "A slow aerial shot of a coastal city at sunrise",
"seconds": "4",
"size": "1280x720"
}'
The response contains a public task ID. Poll it with the same API key:
curl https://api.nexorouter.com/v1/videos/TASK_ID \
-H "Authorization: Bearer $NEXOROUTER_API_KEY"
Task IDs are scoped to the user who created them. Download a completed result from GET /v1/videos/TASK_ID/content with the same API key.
The current public Sora model supports 4, 8, and 12 second text-to-video requests at 720x1280 or 1280x720. The Models page lists its per-second price.
Generate speech
curl https://api.nexorouter.com/v1/audio/speech \
-H "Authorization: Bearer $NEXOROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "IndexTeam/IndexTTS-2",
"input": "Your order is ready.",
"voice": "jack_cheng",
"response_format": "wav"
}' \
--output speech.wav
Speech synthesis is billed by Unicode input characters. Each request accepts up to 5,000 characters.
Limits and errors
- Media creation is limited to 5 requests per minute per API key, with a shared safety cap of 20 requests per minute per client IP. Invalid keys are rejected before the request body is uploaded to the model gateway.
- Request bodies are limited to 20 MB.
- Image and video prompts are limited to 10,000 Unicode characters.
- TTS currently returns a normal audio response.
stream_format: "sse"is rejected until character-based streaming settlement is supported. - A media model called through the wrong endpoint returns
model_endpoint_mismatch. - A known upstream model without confirmed public pricing returns
model_not_for_public_salebefore any upstream generation starts. - Failed upstream generations are normalized into the standard NexoRouter error shape and appear in Usage Logs.