NieuwEco-lane nu bij 91 modellen: hetzelfde model voor een lagere prijs

Valuta

Je waardeert altijd op in euro. Andere valuta tonen we tegen de ECB-koers van vandaag. ECB-referentiekoersen

InloggenAan de slag

Docsv1

Docs-menuModels & lanes

Models & lanes

How model IDs work, what the Standard and Eco lanes are, how fallback between routes works, and how to list every model.

De documentatie is in het Engels.

Every model has an ID of the form provider/model, such as openai/gpt-6-astra or anthropic/claude-sonnet-5.5. Send it as model in the request body. IDs are not case-sensitive.

Standard and Eco lanes

Every model has a Standard lane. Some models also have an Eco lane: the same model at a lower price. Ask for it by adding :eco to the ID, for example openai/gpt-6-astra:eco. Each lane has its own price and its own entry in GET /v1/models.

Each lane has its own routes, and a request never moves from one lane to the other. If every Eco route is busy, you get a 429 or 503 instead of a quiet switch to the Standard price. Eco suits batch jobs and background work.

IDs without a provider

You can leave out the provider when the rest of the ID is unique: gpt-6-astra finds openai/gpt-6-astra. If the short name matches more than one model, the request fails with 404 model_not_found. The model field in the response always shows the full ID. Use full IDs in production code.

Routing and fallback

For each model and lane we keep one or more routes to the model provider. If a route fails before any data has reached you (a network error, a timeout, a 429 or a 5xx), the gateway sends the request to the next route of the same lane. You are charged once, for the answer you get.

When no route can answer, you get 503 model_unavailable, or 429 rate_limit_exceeded when every route was busy. Once a stream has started, there is no fallback: an error then arrives inside the stream. See Streaming.

List the models

GET /v1/models lists every lane you can use right now. It is public: no key needed. The list is cached for 60 seconds.

curl
curl https://api.nexrouting.com/v1/models
FieldMeaning
idThe ID to send as model. Eco lanes end in :eco.
nameDisplay name. Eco lanes end in “(Eco)”.
lanestandard or eco.
owned_byThe provider part of the ID, such as openai or anthropic.
context_lengthContext window in tokens, or null when we don't list it.
pricing.promptUS dollars per input token, as a decimal string.
pricing.completionUS dollars per output token, as a decimal string.
endpointsThe paths that accept this model, such as ["/v1/chat/completions", "/v1/messages"].
categoriesAny of text, code, reasoning, vision and embedding.
object, created"model", and the Unix time of the current catalog version.

The same models, with prices per million tokens, are on Models.

Pick the right endpoint

Most chat models work on /v1/chat/completions. Some also accept /v1/messages (Anthropic format) or /v1/responses, and a few work only on /v1/responses. Embedding models work only on /v1/embeddings. Calling an endpoint a model doesn't support returns 400 unsupported_endpoint, with the endpoints it does support in the message.

Python
import requests models = requests.get("https://api.nexrouting.com/v1/models").json()["data"]for m in models:    if "/v1/messages" in m["endpoints"]:        print(m["id"], m["pricing"]["prompt"], m["pricing"]["completion"])

When a model is unavailable

If a lane is switched off, it disappears from GET /v1/models and requests to it fail with 404 model_not_found. When the other lane of the same model is available, the message names it, for example “Model 'openai/gpt-6-astra:eco' is not available right now. Try 'openai/gpt-6-astra'.”