Skip to main content Switch to mobile version silvanexum 0.4.0 Official Python SDK for Silvanexum — the spend-control plane for AI agents. Meter, attribute, cap, and audit agent spend across a multi-agent mesh, on any model or rail. Typed pydantic models generated from the API's Zod contracts.
pip install silvanexum==0.4.0 Copy PIP instructions
Official Python SDK for Silvanexum — the spend-control plane for AI agents. Meter, attribute, cap, and audit what every agent spends across your whole agent-to-agent mesh, on any model or rail. Models are generated from the API's Zod contracts (pydantic v2), so they never drift from the live API.
📚 Full docs: https://docs.silvanexum.com
pip install silvanexum # uv add silvanexum · poetry add silvanexum Requires Python ≥ 3.9.
Quickstart — cap spend, then see who spent it
import os from silvanexum import Silvanexum sx = Silvanexum(api_key=os.environ["SILVANEXUM_API_KEY"]) # Cap runaway spend — a run or mesh hop that would breach the budget is # rejected server-side (HTTP 402). "Spent" is computed from real run telemetry. sx.budgets.create( name="support-team", scope_type="agent", scope_id="agt_123", period_type="monthly", limit_credits=50_000, enforcement="block", ) # Attribute cost across the mesh — which agent / project / model actually spent. for row in sx.spending.summary(group_by="agent"): print(row.label, row.costCredits) The client is a context manager, so connections are cleaned up for you:
with Silvanexum() as sx: # reads SILVANEXUM_API_KEY from the env trend = sx.spending.trends(bucket="1d") # daily spend, last 30 days What's in the SDK
…plus marketplace, wallet, routing, connectors, team, and more. Full reference: https://docs.silvanexum.com/docs/sdk-reference/python.
Zero-code capture (gateway)
Point your OpenAI client's base_url at the gateway and use your Silvanexum key. Every call is metered on your own provider key and counts toward budgets:
from openai import OpenAI openai = OpenAI( base_url=sx.gateway.openai_base_url(), api_key=os.environ["SILVANEXUM_API_KEY"], default_headers={"x-silvanexum-trace": trace_id}, # optional mesh stitching ) Hard caps with parallel agents
Hold a call's worst case before it runs, so many agents at once can't all pass the same budget check. The reported usage settles the hold; a hold that never gets usage is charged in full when it expires:
with sx.meter.track("openai", "gpt-4o", customer="acme", reserve={"input_tokens": 2000, "max_output_tokens": 1024}) as t: resp = openai.chat.completions.create(model="gpt-4o", max_tokens=1024, messages=messages) t.response(resp) Or do it by hand: sx.meter.reserve(...), then sx.meter.record(..., reservation_id=...), or sx.meter.release(reservation_id) if the call never ran. Gateway calls under a block budget are held automatically.
Your own model prices
Self-hosted and edge models cost what your hardware costs. Price them per token, per GPU hour, or both:
sx.gateway.set_price("llama-3.1-*", provider="other", gpu_hour_usd=1.2) NVIDIA NeMo Relay
Running agents through NVIDIA's NeMo Relay? The companion silvanexum-relay package is a Relay worker plugin that meters every LLM call to Silvanexum (priced server-side, Nemotron/NIM included) and can reject a call before it runs when a budget is exhausted. Relay wraps LangChain, LangGraph, Claude Code and more, so one plugin covers all of them.
pip install silvanexum-relay python -m silvanexum_relay init ./silvanexum-relay-plugin nemo-relay plugins add ./silvanexum-relay-plugin/relay-plugin.toml nemo-relay plugins enable silvanexum Then set enforce_budget = true under that plugin's [plugins.dynamic.config] in Relay's plugins.toml.
It also ships a Relay pricing catalog (Nemotron and NIM included) for Relay's built-in pricing component. See relay-plugin-py.
The earlier silvanexum-nat plugin targets NeMo Agent Toolkit, which NVIDIA deprecated (EOL end of 2026). Use silvanexum-relay.
from silvanexum import InsufficientCreditsError, RateLimitError try: sx.runs.create(agent_id="agt_123", prompt="…") except InsufficientCreditsError: ... # budget/credits exhausted (HTTP 402) — top up or raise the cap except RateLimitError: ... # client already retried with backoff Licensed Apache-2.0.
Released: Nov 30, 2026
Both files in this release have provenance metadata.
View provenance details
Apache-2.0 View SPDX License List
agents ai budget cost finops llm observability sdk silvanexum spend
Intended Audience Developers
License OSI Approved :: Apache Software License
Programming Language Python :: 3
Release files for silvanexum 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 67.8 kB
Release files / silvanexum-0.4.0.tar.gz
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 30, 2026.
Release files / silvanexum-0.4.0-py3-none-any.whl
Security for silvanexum 0.4.0
Both files in this release have been uploaded with provenance metadata.
With provenance silvanexum-0.4.0.tar.gz Nov 30, 2026
With provenance silvanexum-0.4.0-py3-none-any.whl Nov 30, 2026
Attestation for silvanexum-0.4.0.tar.gz
Attestation for silvanexum-0.4.0-py3-none-any.whl
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
Nov 30, 2026 2 release files Full provenance
Oct 29, 2026 2 release files Full provenance
Oct 20, 2026 2 release files Full provenance
Jul 1, 2026 2 release files Full provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation
Deployed from a8e35ed











