Search across all documentation pages
10 pages in this section.
Learn how OpenRouter processes API requests, selects models and providers, and returns responses. Understand key concepts like model slugs and fallbacks.
Generate an OpenRouter API key, configure an OpenAI-compatible client, send chat completions, swap model slugs, and stream responses.
Configure OpenAI-compatible SDKs for OpenRouter using base URL, API key, and model slug. Learn to set up authentication and client factories.
Call hundreds of models using the official OpenAI Python and TypeScript SDKs. Learn to configure base URLs, API keys, and model slugs.
Understand OpenRouter's model slug naming conventions. Learn to decode provider, model name, and variant suffixes to prevent API errors.
Externalize model choice into configuration to swap models without code changes or redeployment. Learn to route logical policies to OpenRouter slugs.
Learn to stream responses through OpenRouter for fast chat UIs and agent progress. Consume SSE stream chunks and handle errors for uniform streaming.
Learn ten best practices for OpenRouter setup, including client and secrets management, model identity, and routing resilience for clean integration.