- Create an API key01
API_KEYCreate a key in the console and keep it on your server.
- Choose a model02
Model ID + protocolCheck the model and input requirements in the live catalog.
- Make your first call03
Request → responseUse the model’s request example and read the result.
1. Create a key
Section titled “1. Create a key”Sign in to the API key dashboard, create a key, and configure its model access. Keep the key on your server; do not expose it in browser code or commit it to Git.
The examples already contain the platform API origin. Set API_KEY to your key in your shell environment; it is an environment variable, not a model ID.
2. Pick a model
Section titled “2. Pick a model”curl "https://newrouters.com/v1/models" -H "Authorization: Bearer $API_KEY"curl "https://newrouters.com/v1/media-models"Use the exact ID and protocol from the live catalog. If your intended model is absent, stop and check access or availability rather than substituting another model.
3. Follow its guide
Section titled “3. Follow its guide”- GPT Image 2: create and poll an image task.
- GPT-5.5: send an OpenAI chat request.
- Complete API reference: all supported protocols and shared endpoints.
Submit an image task
Section titled “Submit an image task”This request uses the platform model + input envelope. Running it creates a generation task and incurs usage; check your account pricing first.
curl "https://newrouters.com/v1/tasks" \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ --data '{ "model": "gpt-image-2", "input": { "prompt": "A small red house in a quiet garden", "quality": "medium", "resolution": "1k", "output_format": "jpeg" }}'HTTP 202 means the task was accepted. Selected response fields, with illustrative values:
{ "id": "TASK_ID", "status": "pending", "result": null, "error": null}- Common API: discover models, check account points and retrieve tasks.
4. Review the result and usage
Section titled “4. Review the result and usage”curl "https://newrouters.com/v1/tasks/TASK_ID" \ -H "Authorization: Bearer $API_KEY"Replace TASK_ID with the response id. Read result.assets[] on succeeded, or error on failed; poll the same task while pending or processing.
For media, the creation response is not the final generated result. Poll the returned task ID until success or failure. For LLMs, retain the request ID and usage information; review billing in the dashboard.