Skip to content
NewRouters/Documentation
GET STARTED

Make your first API request

Create an API key, choose an exact model ID from the live catalog, then send a native LLM request or create a media task.

Integration flowFrom setup to your first request
  1. Create an API key01
    API_KEY

    Create a key in the console and keep it on your server.

  2. Choose a model02
    Model ID + protocol

    Check the model and input requirements in the live catalog.

  3. Make your first call03
    Request → response

    Use the model’s request example and read the result.

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.

Terminal window
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.

This request uses the platform model + input envelope. Running it creates a generation task and incurs usage; check your account pricing first.

Terminal window
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.
Terminal window
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.