RouterBase Python Client
RouterBase provides an OpenAI-compatible API for calling many AI models through https://routerbase.com/v1.
routerbase-client is a small dependency-free Python client for chat completions and model listing. It uses the Python standard library, so it is easy to test in server, CLI, and notebook environments.
Install
After publishing to PyPI:
python -m pip install routerbase-client
For local testing:
python -m pip install -e .
Usage
from routerbase import RouterBase
client = RouterBase()
response = client.chat_completion(
messages=[{"role": "user", "content": "Write a short RouterBase tagline."}]
)
print(response["choices"][0]["message"]["content"])
CLI
export ROUTERBASE_API_KEY="sk-rb-..."
routerbase-chat "Write a five-word launch tagline"
Print the full JSON response:
routerbase-chat --json "List three product positioning ideas"
Configuration
| Variable | Purpose |
|---|---|
ROUTERBASE_API_KEY |
RouterBase API key used for requests |
ROUTERBASE_BASE_URL |
Optional base URL override; defaults to https://routerbase.com/v1 |
Links
- RouterBase
- RouterBase docs: https://docs.routerbase.com/
- Chat completions docs: https://docs.routerbase.com/api-reference/chat-completions
- npm quickstart package: https://www.npmjs.com/package/routerbase-quickstart
License
MIT
Metadata
Release files for routerbase-client 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| routerbase_client-0.1.0.tar.gz | 4.1 kB | Without provenance | Details for routerbase_client-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| routerbase_client-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for routerbase_client-0.1.0-py3-none-any.whl |
Total release size: 8.9 kB
Release files / routerbase_client-0.1.0.tar.gz
| Download URL | routerbase_client-0.1.0.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
83b720ba4864b7aaa6cadd9de60a9a322c154ab98fdecb301ae92b0bc97f013e
|
|
BLAKE2b-256 checksum How to use checksums |
eeea61da14627e06ae95e1d62c9f8174d7b0410923d67e6e2fc11d981f39a468
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / routerbase_client-0.1.0-py3-none-any.whl
| Download URL | routerbase_client-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
595e5b93078669dcdc13c0afba4cb14117a8232b4be136ce0226f7c96fd2bb1a
|
|
BLAKE2b-256 checksum How to use checksums |
a9cc6f26f981e36d50b2934891651b3a04d775c6beb9eea20f9ba3cb45c32cd3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Security for routerbase-client 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.