Skip to main content

veylox

One key. Every model.

Paste in an API key from any major LLM provider. veylox works out which provider it belongs to and gives you a client for every model behind it, using the same simple methods no matter the provider.

import veylox

client = veylox.connect("sk-ant-...")   # any supported key
print(client.provider)                  # "anthropic"

reply = client.chat("Explain recursion in one sentence.", model="claude-sonnet-4-5")
print(reply)
  • No provider setup. The key decides the provider. No "openai/..." model prefixes, no per-provider SDKs.
  • Same methods everywhere. chat, stream, list_models, verify, with async versions of each.
  • Clear errors. Missing parameters are caught before any request is sent, and a mistyped model name comes back with "did you mean" suggestions.
  • Lightweight. One dependency (httpx). Fully typed.
  • Safe by default. Your full key never appears in printed objects, logs or error messages.

Install

pip install veylox

Python 3.10 or newer.

Supported providers

Provider Key looks like client.provider
OpenAI sk-..., sk-proj-... "openai"
Anthropic sk-ant-... "anthropic"
Google Gemini AIza... or AQ.... "gemini"
Groq gsk_... "groq"
Mistral 32 letters and digits "mistral"
OpenRouter sk-or-... "openrouter"

If your key has another format, tell veylox which provider it belongs to: veylox.connect(key, provider="gemini").

Usage

Which provider is my key for?

client = veylox.connect(key)
client.provider          # "groq"
client.provider_info     # ProviderInfo(id='groq', name='Groq', base_url='https://api.groq.com/openai/v1',
                         #              key_hint='gsk_...x9Q2', detected_by='prefix')

veylox.detect_provider("AIza...")   # "gemini", without making a client or a network call

Chat

reply = client.chat(
    [
        {"role": "system", "content": "You are a concise assistant."},
        {"role": "user", "content": "What is the capital of Japan?"},
    ],
    model="gpt-4o-mini",
    temperature=0.2,
    max_tokens=100,
)

reply.text            # "Tokyo."
reply.usage           # Usage(input_tokens=24, output_tokens=3, total_tokens=27)
reply.finish_reason   # "stop"
reply.raw             # the provider's full JSON response

messages can be a plain string (one user message) or a list of {"role", "content"} dicts. model is required. Everything else is optional:

Parameter Meaning
system Instructions for the model
max_tokens Maximum reply length (veylox sends 4096 to Anthropic if you leave it out, because Anthropic requires it)
temperature Randomness: 0 is focused, higher is more creative
top_p Nucleus sampling, 0 to 1
stop A string or list of strings that ends the reply
**extra Any provider-specific option, passed through unchanged

Stream

for chunk in client.stream("Write a short poem about the sea.", model="gemini-2.5-flash"):
    print(chunk, end="", flush=True)

List models

client.list_models()     # ['gpt-4o', 'gpt-4o-mini', ...]

Check a key works

client = veylox.connect(key, verify=True)   # raises AuthenticationError if the key is rejected
# or later:
client.verify()                             # True

Async

Every method has an _async version:

reply = await client.chat_async("Hi!", model="llama-3.3-70b-versatile")

async for chunk in client.stream_async("Hi!", model="llama-3.3-70b-versatile"):
    print(chunk, end="")

models = await client.list_models_async()

Errors

Everything veylox raises inherits from veylox.VeyloxError:

try:
    client.chat("Hi", model="gpt-4o-mnii")
except veylox.ModelNotFoundError as e:
    print(e.suggestions)        # ['gpt-4o-mini', ...]
except veylox.AuthenticationError:
    print("Bad or revoked key")
except veylox.PermissionDeniedError:
    print("Key is fine, but this model or region isn't allowed")
except veylox.RateLimitError:
    print("Slow down, or top up your quota")
except veylox.VeyloxError as e:
    print(e)
Error When
UnknownKeyError The key's provider can't be detected
InvalidRequestError A parameter is missing or invalid
AuthenticationError The provider rejected the key
PermissionDeniedError The key is valid but access was refused (model, plan or region)
ModelNotFoundError The model doesn't exist (.suggestions has close matches)
RateLimitError Too many requests, or out of quota
ProviderError The provider failed, timed out, couldn't be reached, or the URL was wrong (404)

Documentation

The guides live in the docs/ folder and read fine on GitHub:

Every public function and class also has a full docstring, so help(veylox.connect) or your editor's hover shows the details.

To browse the full docs site, including the generated API reference, on your own machine:

pip install -e ".[docs]"
mkdocs serve        # then open http://127.0.0.1:8000

License

MIT

Metadata

Release files for veylox 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for veylox 0.1.1
File Size Uploaded Provenance Actions
veylox-0.1.1.tar.gz 31.1 kB With provenance Details for veylox-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for veylox 0.1.1
File Interpreter ABI Platform Actions
veylox-0.1.1-py3-none-any.whl Python 3 none any Details for veylox-0.1.1-py3-none-any.whl

Total release size: 59.5 kB

Release files / veylox-0.1.1.tar.gz

Download URL veylox-0.1.1.tar.gz
Size 31.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e1c3bdff27059e995fe6246a2f1b267a0d8b1bb1abe1547863ec6d56aae34f12
BLAKE2b-256 checksum
How to use checksums
04c1f9537507fddeb41c7398125a8f7db76c2fb756884d3c7e583b5720eed1bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / veylox-0.1.1-py3-none-any.whl

Download URL veylox-0.1.1-py3-none-any.whl
Size 28.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c11bdd7f969c6cd8860035a9d2cae4d51ee3dd7810944a8c9915819568324c9
BLAKE2b-256 checksum
How to use checksums
126dd2db8972ebca398a68a4a40584d5122293662368c8d31c29aba1a574d0b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for veylox 0.1.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for veylox-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page