Python SDK
Official OpenRouter Python SDK documentation
The OpenRouter Python SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.
The SDK provides three core benefits:
Actionable error messages:
Type-safe streaming:
Async support:
Requirements: Python 3.9 or higher
Get your API key from openrouter.ai/settings/keys.