Responses API Overview

Unified endpoint for text generation, reasoning traces, and tool-enabled responses.

POST/v1/responses

The Responses API is designed for multi-step interactions where model output may include text, tool calls, reasoning summaries, and structured metadata.

Core Fields

NameTypeRequiredDescription
model
stringRequiredTarget model ID
input
string | arrayRequiredInput text or structured message content
reasoning
objectReasoning controls and verbosity
tools
arrayDeclared tools that the model may call
response_format
objectSchema-guided response shape

Hello Response

cURL
curl https://api.therouter.ai/v1/responses \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4o-mini",
    "input": "Summarize TheRouter.ai in one sentence."
  }'
responses-overview.json
{
  "id": "resp_a1b2c3d4e5f67890abcdef1234567890",
  "object": "response",
  "model": "openai/gpt-4o-mini",
  "output": [
    {
      "type": "message",
      "role": "assistant",
      "content": [
        { "type": "output_text", "text": "TheRouter.ai is a unified OpenAI-compatible gateway for multi-provider LLM routing." }
      ]
    }
  ],
  "usage": {
    "input_tokens": 11,
    "output_tokens": 18,
    "total_tokens": 29
  }
}
When to Use Responses
Prefer Responses for agentic flows, tool orchestration, and structured outputs. Use Chat Completions for simpler prompt-response interactions.