Skip to main content
ExampleDescription
BasicOpenRouter’s Responses API (beta) provides OpenAI-compatible access to multiple.
FallbackThis demonstrates using fallback models with OpenRouter’s dynamic model routing.
StreamRequirements: - Set OPENROUTER_API_KEY environment variable.
Structured OutputThis demonstrates using Pydantic models for structured output with OpenRouter’s.
Tool UseThis demonstrates using tools with OpenRouter’s Responses API endpoint.