Skip to main content
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
BasicUse OpenRouter’s Responses API (beta) with OpenAI-compatible requests across multiple models.
FallbackRoute requests with fallback models using OpenRouter’s dynamic model routing.
StreamingStream OpenRouter’s Responses API output. Requires OPENROUTER_API_KEY.
Structured OutputReturn Pydantic-validated structured output with OpenRouter’s Responses API.
Tool UseCall tools through OpenRouter’s Responses API endpoint.