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.
Project description
silvanexum
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
Install
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
| Resource | What it does |
|---|---|
sx.spending |
Cost attribution — summary / trends / mesh_trace (by agent, project, model, provider) |
sx.budgets |
Spend caps with off / alert / block enforcement + live status |
sx.fleet |
Cost, latency, drift, and alert observability |
sx.runs · sx.agents |
Run agents; read signed, replayable traces |
sx.security |
Hash-chained audit log + compliance export |
…plus marketplace, wallet, routing, connectors, team, and more. Full
reference: https://docs.silvanexum.com/docs/sdk-reference/python.
Zero-code OpenAI capture via the gateway is currently in the TypeScript SDK (
@silvanexum/sdk); Python callers can point an OpenAI client athttps://api.silvanexum.com/gateway/openai/v1directly with a Silvanexum key.
Errors
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file silvanexum-0.1.1.tar.gz.
File metadata
- Download URL: silvanexum-0.1.1.tar.gz
- Upload date:
- Size: 24.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
651eec0ed8cffb1fd7bece06f6cfd0168606fba6c74f2d230635d7b1a5784b37
|
|
| MD5 |
63643babbea56eb88ba07033b0d0335a
|
|
| BLAKE2b-256 |
5a2f6a6f6eb65ade28907b2140bba18b9e1438e1b35178cd28e03f35f2175762
|
Provenance
The following attestation bundles were made for silvanexum-0.1.1.tar.gz:
Publisher:
release.yml on silvanexum/Silvanexum-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
silvanexum-0.1.1.tar.gz -
Subject digest:
651eec0ed8cffb1fd7bece06f6cfd0168606fba6c74f2d230635d7b1a5784b37 - Sigstore transparency entry: 2041411034
- Sigstore integration time:
-
Permalink:
silvanexum/Silvanexum-sdk@f016eb240b6c572301b3ec7da8ea4aa753c57cc8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/silvanexum
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f016eb240b6c572301b3ec7da8ea4aa753c57cc8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file silvanexum-0.1.1-py3-none-any.whl.
File metadata
- Download URL: silvanexum-0.1.1-py3-none-any.whl
- Upload date:
- Size: 26.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
427f84fa1998a97281d6630ba25e6069fc39eb44ec7de861481880468dc0c627
|
|
| MD5 |
6945303b97c88dd528625a9502d96e6d
|
|
| BLAKE2b-256 |
a8a0cc14b76452bbbd59be0422631e6adafd962a79316c13a07d7490ab3ed979
|
Provenance
The following attestation bundles were made for silvanexum-0.1.1-py3-none-any.whl:
Publisher:
release.yml on silvanexum/Silvanexum-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
silvanexum-0.1.1-py3-none-any.whl -
Subject digest:
427f84fa1998a97281d6630ba25e6069fc39eb44ec7de861481880468dc0c627 - Sigstore transparency entry: 2041411122
- Sigstore integration time:
-
Permalink:
silvanexum/Silvanexum-sdk@f016eb240b6c572301b3ec7da8ea4aa753c57cc8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/silvanexum
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f016eb240b6c572301b3ec7da8ea4aa753c57cc8 -
Trigger Event:
push
-
Statement type: