Responses

Access multiple AI models through a unified, stateless API.

OpenRouter's Responses API (Beta) provides an OpenAI-compatible interface for accessing multiple AI models through a unified, stateless API. It is designed as a drop-in replacement for OpenAI's Responses API with enhanced capabilities including reasoning, tool calling, and web search integration.

For details, see examples in cookbook/90_models/openrouter/responses.

ExampleDescription
BasicRun openai/gpt-oss-20b through OpenRouterResponses with reasoning enabled in sync and async modes.
FallbackConfigure ordered OpenRouter fallback models for unavailable primary routes.
StreamingStream an OpenRouter Responses agent's output with print_response(stream=True).
Structured OutputUse of Pydantic models for structured output with OpenRouter's Responses API.
Tool UseCall DuckDuckGoTools from an OpenRouter Responses agent and stream the answer.