veqen
The cost ledger for AI inference. Usage-based cost for supported model calls (text, embeddings, images, video, speech and transcription, from about 2,000 models across labs, open-model hosts and clouds), attributed to the customer, feature, user or project that caused it, with budgets that check recorded spend before each wrapped request.
pip install veqen
Python 3.10+, no dependencies (LangChain support is the veqen[langchain] extra), works offline.
import veqen
from openai import OpenAI
client = veqen.wrap(OpenAI(), feature="support-bot")
with veqen.tags(customer="acme", user="u_42"):
client.responses.create(model="gpt-5-mini", input="Where is my order?")
Every call is priced from the usage the provider reports, with the rules providers bill by: cached input, 5-minute and 1-hour cache writes, batch, priority and flex tiers, long-context rates and data residency. Prompts and responses are never read.
- Wrap OpenAI (sync and async, streams, Responses, Chat Completions, embeddings, images and audio), Anthropic (messages and streams) and Google GenAI clients. An OpenAI client pointed at Together, Fireworks, Groq, Azure AI Foundry or another compatible host is priced as that host; name your own servers with
veqen.wrap(client, provider="self-hosted"). - Tag calls with
veqen.tags(customer=..., feature=..., user=..., project=...); tags followasynciocode. - Budget:
veqen.budget(5.00, customer="*")raisesveqen.BudgetExceededbefore subsequent wrapped calls once recorded spend reaches the limit. - Record anything else:
veqen.record("claude-sonnet-5-5", provider="anthropic", input_tokens=1200, output_tokens=300), or by unit for media models:veqen.record("veo-3.1-generate-001", provider="google", units=8, variant="1080p"). - Price without recording:
veqen.cost("gpt-4o", 1000, 500)returns0.0075. - Integrations:
veqen.integrations.langchain,veqen.integrations.litellm,veqen.integrations.openai_agents.
In serverless functions, call veqen.flush() before returning. Write a local ledger with veqen.init(ledger_file=".veqen/ledger.jsonl") and see cost per customer, feature and model with npx @veqen/sdk report. Set VEQEN_API_KEY to send calls to the Veqen dashboard for shared budgets, reconciliation with your provider bills, custom and self-hosted prices, margin per customer and month-end journal entries. Free for 60,000 tracked calls a month.
Docs: https://veqen-app.com/docs/python · Model prices: https://veqen-app.com/models · MIT licensed.
Budgets are not guaranteed spending caps. In-flight and concurrent calls can exceed the limit. Local counters are per process and reset on restart; dashboard budgets also depend on ingestion and polling delays.
Metadata
Release files for veqen 1.0.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 | |
|---|---|---|---|---|
| veqen-1.0.0.tar.gz | 56.5 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| veqen-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 109.1 kB
Release files / veqen-1.0.0.tar.gz
| Download URL | veqen-1.0.0.tar.gz |
|---|---|
| Size | 56.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b2880812afcaea240681cc4972a765d608e5287b2af039ebc6c34cc07aad2c6c
|
|
BLAKE2b-256 checksum How to use checksums |
26732a84c83f1497cdec597cc6ef2e96be5ca75142a20ba905a29d4c6856532b
|
| 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 Oct 23, 2026.
Transparency logRelease files / veqen-1.0.0-py3-none-any.whl
| Download URL | veqen-1.0.0-py3-none-any.whl |
|---|---|
| Size | 52.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
39ada389231ecf36b61cc7e1460bfb9a75e785cc7bebb709a625fca388cac2a3
|
|
BLAKE2b-256 checksum How to use checksums |
a458c3e5060da6a9d980916bd018407d3684158b667bdbb09c627314de27ab00
|
| 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 Oct 23, 2026.
Transparency logSecurity for veqen 1.0.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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for veqen-1.0.0.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 Oct 23, 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.