veyra-python
The official Veyra Python SDK: sync + async clients, typed models, streaming, pagination, retries, and rich API exceptions.
Installation
pip install veyra
Quickstart (Sync)
import veyra
client = veyra.Veyra()
completion = client.chat.completions.create(
model="gpt-5.4-mini",
messages=[{"role": "user", "content": "Hello!"}],
reasoning={"effort": "low"},
)
print(completion.choices[0].message.content)
Quickstart (Async)
import asyncio
import veyra
async def main() -> None:
async with veyra.AsyncVeyra() as client:
completion = await client.chat.completions.create(
model="gpt-5.4-mini",
messages=[{"role": "user", "content": "Hello from async"}],
)
print(completion.choices[0].message.content)
asyncio.run(main())
Authentication
Set environment variable:
export VEYRA_API_KEY="veyra_sk_..."
Or pass explicitly:
client = veyra.Veyra(api_key="veyra_sk_...")
Resources at a glance
| Namespace | Method |
|---|---|
client.chat.completions |
create(...) |
client.completions |
create(...) |
client.responses |
create(...) |
client.embeddings |
create(...) |
client.images.generations |
create(...) |
client.audio.transcriptions |
create(...) |
client.models |
list(), retrieve(id) |
client.quota |
status(), list_plans(), list_public_plans() |
client.billing.usage |
list(), daily_summary(), monthly_summary(), conversation_summary(id) |
client.billing.profile |
retrieve(), upsert(...), access() |
client.api_keys |
create(...), list(), update(...), revoke(...) |
client.assistant |
chat(...) |
client.health |
check(), ready() |
Streaming
import veyra
client = veyra.Veyra()
with client.chat.completions.create(
model="gpt-5.4-mini",
messages=[{"role": "user", "content": "Count to 3"}],
stream=True,
) as stream:
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")
Responses reasoning
response = client.responses.create(
model="gpt-5.4-mini",
input="Summarize the tradeoff in one sentence.",
reasoning={"effort": "medium", "summary": "auto"},
max_output_tokens=128,
)
print(response.output[0].content[0].text)
Error handling
import veyra
client = veyra.Veyra()
try:
client.chat.completions.create(
model="gpt-5.4-mini",
messages=[{"role": "user", "content": "Hello"}],
)
except veyra.RateLimitError as exc:
print("Retry after:", exc.retry_after)
except veyra.APIError as exc:
print(exc.status_code, exc.code, exc)
Pagination
for record in client.billing.usage.list(limit=100):
print(record.model, record.total_tokens)
Retries and timeouts
client = veyra.Veyra(max_retries=4, timeout=30)
client.chat.completions.create(
model="gpt-5.4-mini",
messages=[{"role": "user", "content": "Hello"}],
timeout=10,
)
Raw responses
raw = client.with_raw_response.chat.completions.create(
model="gpt-5.4-mini",
messages=[{"role": "user", "content": "Hi"}],
)
print(raw.request_id)
print(raw.http_status)
Async streaming
import asyncio
import veyra
async def main() -> None:
async with veyra.AsyncVeyra() as client:
stream = await client.chat.completions.create(
model="gpt-5.4-mini",
messages=[{"role": "user", "content": "Count to 3"}],
stream=True,
)
async with stream:
async for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")
asyncio.run(main())
Full docs: docs/
Metadata
Release files for tubox-veyra 1.0.1
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 |
|---|---|---|---|---|
| tubox_veyra-1.0.1.tar.gz | 74.7 kB | With provenance | Details for tubox_veyra-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tubox_veyra-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for tubox_veyra-1.0.1-py3-none-any.whl |
Total release size: 114.9 kB
Release files / tubox_veyra-1.0.1.tar.gz
| Download URL | tubox_veyra-1.0.1.tar.gz |
|---|---|
| Size | 74.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b33dd65ce71052ecaadc7798c9185ed0ed42fb1aecd8f1e5e10adf99323d4731
|
|
BLAKE2b-256 checksum How to use checksums |
97e75f66a91d6b43aeaf03bd219845c5f3f9145bc6ab646f5d9f0f94e2227b0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 17, 2026.
Transparency logRelease files / tubox_veyra-1.0.1-py3-none-any.whl
| Download URL | tubox_veyra-1.0.1-py3-none-any.whl |
|---|---|
| Size | 40.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5d349c5416c9c400e42c01e7e71a109e4ad5b55b7738e4d020fa937d151e5b30
|
|
BLAKE2b-256 checksum How to use checksums |
83b0a2ff7818c1b605f7bec149ee63aed57052ac7b98757c0a981d9af3166f63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 17, 2026.
Transparency logSecurity for tubox-veyra 1.0.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.
Attestation for tubox_veyra-1.0.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 May 17, 2026.
Transparency logA 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.