Skip to content
Rapid Router
← API reference

Responses API

Part of the Rapid Router API reference. One OpenAI-compatible endpoint, https://rapidrouter.ai/api/v1, in front of every model in the catalog.

20Responses API

POST /responses speaks the OpenAI Responses API shape: input as a string or an array of items, instructions, flat function tools, and typed output items (message, function_call, reasoning), with an output_text convenience field. It runs through the same routing, failover and billing as chat completions, on every model in the catalog.

It is stateless. Responses are never stored, so store: true and previous_response_id are rejected with 400, and GET /responses/:id is always 404. To continue a conversation, resend the previous output items in input, the way the multi-turn example below feeds a function_call_output back. Echo tool-call items exactly as they arrived: some models attach fields (Gemini 3's extra_content.google.thought_signature) that must survive the round trip.

curl https://rapidrouter.ai/api/v1/responses \
  -H "Authorization: Bearer $RAPIDROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-5",
    "instructions": "Answer briefly.",
    "input": "What is the capital of France?",
    "max_output_tokens": 100
  }'

# -> { "id": "resp_...", "object": "response", "status": "completed",
#      "output": [ { "type": "message", "content": [ { "type": "output_text", "text": "Paris." } ] } ],
#      "output_text": "Paris.",
#      "usage": { "input_tokens": 14, "output_tokens": 3, "cost": 0.000058 } }

stream: true emits Responses-API events: response.created, response.output_item.added, an response.output_text.delta per text delta, then response.output_text.done and a final response.completed carrying the full response with usage and cost. Function calls arrive as complete items before response.completed.