NuevoCarril Eco ya en 91 modelos: el mismo modelo a menor precio

Moneda

Siempre recargas en euros. Las demás monedas se muestran al tipo de cambio de hoy del BCE. Tipos de cambio de referencia del BCE

Iniciar sesiónEmpezar

Documentaciónv1

Menú de la documentaciónResponses

POST/v1/responses

Responses

POST /v1/responses: create a model response in the OpenAI Responses format, for the models that support it.

La documentación está en inglés.

Creates a model response in the OpenAI Responses format. Works with the models that list /v1/responses in their endpoints. Some of them are only available here.

Base URL: https://api.nexrouting.com/v1 (also https://nexrouting.com/api/v1).

Headers

Authorizationstringrequired
Authorization: Bearer <key> (or x-api-key: <key>).
Content-Typestring
application/json. The body is read as JSON either way.

Body

modelstringrequired
Model ID, such as openai/gpt-6-astra.
inputstring | arrayrequired
The prompt: a string, or a list of input items.
instructionsstring
System instructions.
streamboolean
true to receive server-sent events. See Streaming.
max_output_tokens, reasoning, tools, …
Passed on as they are, as in the OpenAI API.

The gateway checks model and stream. Everything else in the body goes to the model provider unchanged, in the OpenAI Responses format, so which other parameters work depends on the model. When the provider rejects a parameter, you get 400 invalid_request with its reason.

Example request

curl https://api.nexrouting.com/v1/responses \  -H "Authorization: Bearer $NEXROUTING_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "model": "openai/gpt-6-astra",    "input": "Explain routing in one sentence."  }'

Example response

200 OK
{  "id": "resp_68a1c0",  "object": "response",  "created_at": 1795075200,  "status": "completed",  "model": "openai/gpt-6-astra",  "output": [    {      "type": "message",      "id": "msg_68a1c1",      "status": "completed",      "role": "assistant",      "content": [        { "type": "output_text", "text": "Routing sends each request to the model that should answer it.", "annotations": [] }      ]    }  ],  "usage": {    "input_tokens": 12,    "input_tokens_details": { "cached_tokens": 0 },    "output_tokens": 14,    "output_tokens_details": { "reasoning_tokens": 0 },    "total_tokens": 26  }}

Errors

OpenAI error shape. All codes are in Errors.

Not available

Retrieving, cancelling or deleting a stored response (/v1/responses/{id} and its sub-paths) returns 404 not_found. A follow-up request with previous_response_id can be served by another route that doesn't know the earlier response, so send the conversation in input instead.