Skip to main content

HyperRouter AI SDK — OpenAI-compatible client for 300+ AI models

Project description

hyperrouter

Python SDK for HyperRouter — access 300+ AI models from 50+ providers with a single API key.

Install

pip install hyperrouter-ai

Usage

from hyperrouter import HyperRouter

client = HyperRouter(api_key="mr-your-key-here")
# Or set HYPERROUTER_API_KEY env var and call HyperRouter()

response = client.chat.completions.create(
    model="anthropic/claude-sonnet-4",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)

Async

from hyperrouter import AsyncHyperRouter
import asyncio

client = AsyncHyperRouter()

async def main():
    response = await client.chat.completions.create(
        model="openai/gpt-4o",
        messages=[{"role": "user", "content": "Hello!"}],
    )
    print(response.choices[0].message.content)

asyncio.run(main())

OpenAI Compatible

HyperRouter is fully compatible with the OpenAI SDK. You can also use it directly:

from openai import OpenAI

client = OpenAI(
    api_key="mr-your-key-here",
    base_url="https://api.hyperrouter.ai/v1",
)

Links

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

hyperrouter_ai-0.1.0.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

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

hyperrouter_ai-0.1.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file hyperrouter_ai-0.1.0.tar.gz.

File metadata

  • Download URL: hyperrouter_ai-0.1.0.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for hyperrouter_ai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 24693dd7e5fea632315138a6b09b9742ceb80c9ead2742efe3a93199eca1fe04
MD5 c412976526eb79ae28215566e4d2cc9b
BLAKE2b-256 1686e0b7e95f12da78dd7521cff22a86aeb9fa9612e9dfa6c1c91e7e299d54de

See more details on using hashes here.

File details

Details for the file hyperrouter_ai-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for hyperrouter_ai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d0817dee0865c03196d502ecba6d05809746500a332dd0c108dc7df9401feb4
MD5 7d63e9bc2e8c80da388f84bf460f1e31
BLAKE2b-256 fb11f7d961e3909c76b36e51cf877587db901311f7c0db44524a53bac27952c0

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