API Reference
Quickstart
Submit your first image task and retrieve its result.
Create an API key
Sign in and create a key in API keys. Save it when it is first shown. Add credits in Billing.
Set SEEDROUTER_API_KEY in your server environment. Python examples require the requests package.
Submit a task
curl https://api.seedrouter.ai/v1/images/generations \
-H "Authorization: Bearer $SEEDROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "An amber glass bottle on a cream background, studio lighting",
"size": "1024x1024",
"quality": "low"
}'Read the result
Store the returned id, then query it with the same account's API key:
curl https://api.seedrouter.ai/v1/tasks/YOUR_TASK_ID \
-H "Authorization: Bearer $SEEDROUTER_API_KEY"Repeat every three seconds while the status is processing. When it is completed, read output.data[].url. If it is failed, inspect error.
A polling timeout does not cancel generation. Save the task ID and resume querying it instead of submitting another generation request.
See Tasks for a complete polling example and GPT Image 2 for editing, quality, and size options.
