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.
| Example | Description |
|---|---|
| Basic | Run openai/gpt-oss-20b through OpenRouterResponses with reasoning enabled in sync and async modes. |
| Fallback | Configure ordered OpenRouter fallback models for unavailable primary routes. |
| Streaming | Stream an OpenRouter Responses agent's output with print_response(stream=True). |
| Structured Output | Use of Pydantic models for structured output with OpenRouter's Responses API. |
| Tool Use | Call DuckDuckGoTools from an OpenRouter Responses agent and stream the answer. |