Skip to main content

The official Python client for OKRouter API

Project description

OKRouter Python Client

PyPI version License: MIT

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

okrouter-0.1.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

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

Hashes for okrouter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b9d968ecd1555cd65264b18d1b5c13d7dbe252c46ce741a5f1a6e7b0c88e3f1b
MD5 77c8134fb4c08b90a4b13aa1de1ff535
BLAKE2b-256 ae68ad49784e1d8c20667c6c35648dd530942bacb4cd41e03692b4e14b2c67b0

See more details on using hashes here.

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

Hashes for okrouter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 54640d5c186a10231a73121b22d11991a4c169d6e3109dd15e8ec413b6fcbb4d
MD5 b913a2b2d2a00482daf43e20d599137e
BLAKE2b-256 29af9a65af82b3136c4bcd6e7fc9f40a2f06661bc84303bd3c64921800093ca6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page