The official Python client for OKRouter API
Project description
OKRouter Python Client
The official Python client for OKRouter.
OKRouter allows you to integrate OpenAI (GPT-5), Anthropic (Claude 4-5), XAI (Grok 4),and Google (Gemini-3-pro) APIs using a single standardized interface.
🚀 Why use OKRouter?
- Unified API: Switch between models without changing code.
- Cost Saving: Automatic routing to the most cost-effective provider.
- High Availability: Smart fallback to prevent downtime.
- 👉 Get your API Key here: https://okrouter.com
📦 Installation
pip install okrouter
💡 Usage
Python
import okrouter
# Initialize the client with your API Key
client = okrouter.Client(api_key="YOUR_OKROUTER_KEY")
# Create a chat completion
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
🔗 Resources
Official Website
API Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
okrouter-0.1.0.tar.gz
(3.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file okrouter-0.1.0.tar.gz.
File metadata
- Download URL: okrouter-0.1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9d968ecd1555cd65264b18d1b5c13d7dbe252c46ce741a5f1a6e7b0c88e3f1b
|
|
| MD5 |
77c8134fb4c08b90a4b13aa1de1ff535
|
|
| BLAKE2b-256 |
ae68ad49784e1d8c20667c6c35648dd530942bacb4cd41e03692b4e14b2c67b0
|
File details
Details for the file okrouter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: okrouter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54640d5c186a10231a73121b22d11991a4c169d6e3109dd15e8ec413b6fcbb4d
|
|
| MD5 |
b913a2b2d2a00482daf43e20d599137e
|
|
| BLAKE2b-256 |
29af9a65af82b3136c4bcd6e7fc9f40a2f06661bc84303bd3c64921800093ca6
|