Skip to main content

veqen

Veqen is cost monitoring and protection for AI. The SDK shows what your AI requests cost and who they were for: a customer, a feature or a project, and tells Veqen which key made each one, so spend nobody on your team made stands out. Start locally without an account, then connect the optional dashboard to see where spending goes and compare it with your provider bills.

pip install veqen

Python 3.10+, no dependencies in the base package, works offline. Optional integrations: veqen[langchain], veqen[litellm] veqen[llamaindex] and veqen[haystack] (Python 3.11+ for Haystack).

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=..., run=...); tags follow asyncio code.
  • Budget: veqen.budget(5.00, customer="*") raises veqen.BudgetExceeded before subsequent wrapped calls once recorded spend reaches the limit.
  • Agent spend (beta): before an agent pays for something, veqen.check_spend("procurement-bot", 120.00, payee="Acme Supplies", purpose="Laptop stand") answers allow, approval or deny from the agent's mandate (.allowed), and veqen.record_action(...) tells Veqen afterwards; each is matched to the card or account transaction. It needs VEQEN_API_KEY, and without it, or when Veqen can't be reached, the answer is deny unless you pass on_error="allow". Agent spend docs
  • 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) returns 0.0075.
  • Integrations: veqen.integrations.langchain, veqen.integrations.litellm, veqen.integrations.openai_agents, and the Haystack chat-cost component.

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 up to $1,000 of tracked AI spend a month.

Docs: https://veqen-app.com/docs/python · Model prices: https://veqen-app.com/models · MIT licensed.

LiteLLM

Install pip install 'veqen[litellm]>=1.1.0', then register the supported CustomLogger:

import litellm
import veqen
from veqen.integrations.litellm_logger import VeqenLogger

veqen.init()  # optional VEQEN_API_KEY for the hosted ledger
litellm.callbacks = [VeqenLogger()]

Pass attribution as metadata={"veqen": {"customer": "acme", "feature": "chat"}} on a LiteLLM call. The logger copies allowlisted cost metadata, not prompts or responses. It observes completed calls and does not enforce pre-call budgets. Register only one Veqen recording path per request. See the LiteLLM guide for proxy configuration and the hosted logging endpoint.

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.5.0

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

Source distribution (sdist)

Source distribution for veqen 1.5.0
File Size Uploaded Provenance Actions
veqen-1.5.0.tar.gz 68.8 kB With provenance Details for veqen-1.5.0.tar.gz

Built distribution (wheel)

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

Total release size: 130.5 kB

Release files / veqen-1.5.0.tar.gz

Download URL veqen-1.5.0.tar.gz
Size 68.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fc3c19a921788c9df89c7e5c75f238e9f87bba895a3fa4c15a45f050b7cfac2d
BLAKE2b-256 checksum
How to use checksums
d7e1e5024288947e904dbd6d6cfca9a141769667167df24c189e7dd1d418abd7
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 29, 2026.

Transparency log

Release files / veqen-1.5.0-py3-none-any.whl

Download URL veqen-1.5.0-py3-none-any.whl
Size 61.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f61458e4a9958c5252f6359e62d088299ce3e97619b746027f426f5e89c1b86c
BLAKE2b-256 checksum
How to use checksums
275966e65525ad51df255dd4ebfe0c9bbc6557d8129eb2ec57984d90537dc649
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 29, 2026.

Transparency log

Security for veqen 1.5.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

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

Select from 2 files

Attestation for veqen-1.5.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 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.

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