Skip to main content

Official Python SDK for basedrouter (api.basedrouter.com) — one OpenAI-compatible endpoint across 45 models from 14 providers, with USDC payments and signed receipts.

Project description

basedrouter

Python SDK for the basedrouter API.

from basedrouter import BasedRouterClient

client = BasedRouterClient(api_key="basedrouter_live_...")
response = client.create_chat_completion(
    model="auto",
    messages=[{"role": "user", "content": "route this"}],
    stream=True,
)

for event in client.iter_sse(response.data):
    print(event.event, event.data)

The client defaults to https://api.basedrouter.com/v1 and sends basedrouter bearer API keys when api_key is provided. Accountless x402 challenge creation can be called without a key.

Operations helpers are included for accounts, API-key limits, usage, logs, receipts, provider health/configuration, monitoring summaries, and payment intent lifecycle calls.

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

basedrouter-0.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

basedrouter-0.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for basedrouter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2f0c6baf9180b4487420b2bc05dbace7a40d4d97c27f17852303ed5d67547056
MD5 da9d975637bcde8db7c8b55d319ecaa8
BLAKE2b-256 09af7a4546630e90263bba24f2fccc8a12aeaeb7762925ae89f70bd1c2b99d55

See more details on using hashes here.

File details

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

File metadata

  • Download URL: basedrouter-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for basedrouter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa96b4a4b645be42727804f5a345d7d190a27159a883ce091552918e8ba58aa7
MD5 2413ba9fb41ff12da9586961efe15e54
BLAKE2b-256 95c95406db2a96965a8daeac927ad60feb8772ceb9adbdff1fe0e2676d07b5bf

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