wiv-air
The Python SDK for Wiv Air agents. It does two things:
- Traces. Sends your agent's OpenTelemetry GenAI traces to Air, which shows each run, step and tool call with its estimated cost and alerts you when an agent loops or overspends.
- Wallet. Asks the agent's Air wallet before an expensive step. Air answers allow, deny, or ask a person.
It has no dependencies and uses only the standard library. Air never sits in front of your model calls.
Install
pip install wiv-air
# with OpenTelemetry, so configure_tracing() also installs a tracer provider:
pip install "wiv-air[otel]"
Configure
Register the agent in Air (Agents → Add agent), create a key, and set it:
export AIR_AGENT_KEY="airak1...."
# optional: defaults to https://agents-air.wiv.ai
export AIR_AGENT_ENDPOINT="https://agents-air.wiv.ai"
Send traces
from wiv_air import Air
air = Air()
air.configure_tracing(service_name="support-triage")
air.ping() # one test span: the agent's setup page in Air turns green
Call configure_tracing() once, before your instrumentors. It adapts to the
process, and the mode it returns says what it did:
| Your process | What it does | mode |
|---|---|---|
| Already uses the OpenTelemetry SDK (Logfire, Langfuse, your own collector) | Adds Air as one more exporter on your provider. Your exporters and OTEL_* settings are untouched |
attached |
No tracer provider yet, wiv-air[otel] installed |
Installs a provider that sends to Air | installed |
| No OpenTelemetry SDK | Sets the standard OTEL_EXPORTER_OTLP_TRACES_* variables for an exporter you create later |
environment |
| A non-OpenTelemetry provider | Changes nothing and warns. Add an OTLP exporter for Air().otlp_config() yourself |
unsupported |
Calling it more than once is safe: Air's exporter is added to a provider only once.
Air reads OpenTelemetry GenAI spans (gen_ai.*), so instrument your model
client too. One example is opentelemetry-instrumentation-openai-v2.
Ask the wallet before spending
from wiv_air import Air, ApprovalPending, WalletDenied
air = Air()
try:
with air.spend(40, run_id=conversation_id, reason="draft reply") as step:
result = call_the_model()
step.actual_cents = cost_of(result) # optional
except WalletDenied as denied:
stop(denied.authorization.reason)
except ApprovalPending:
retry_later()
- Allow: the block runs. Air reserves the estimate and releases it when the block ends.
- Deny:
WalletDeniedis raised before the block runs. - Ask: a request opens in Air's Approval Center. Pass
ask_timeout=120to wait for the answer. OtherwiseApprovalPendingis raised.
New wallets start in observe mode. Air always allows, and counts what it would have denied, until an admin switches the wallet to enforce.
To call the wallet directly, use air.wallet.authorize(...),
air.wallet.report(...) and air.wallet.status().
License
Apache-2.0
Metadata
Release files for wiv-air 0.1.2
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 |
|---|---|---|---|---|
| wiv_air-0.1.2.tar.gz | 15.0 kB | With provenance | Details for wiv_air-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wiv_air-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for wiv_air-0.1.2-py3-none-any.whl |
Total release size: 27.1 kB
Release files / wiv_air-0.1.2.tar.gz
| Download URL | wiv_air-0.1.2.tar.gz |
|---|---|
| Size | 15.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6fba67e4905d97bbe0113aa3e48611a7891e64ccc8c923d301bed2360979e147
|
|
BLAKE2b-256 checksum How to use checksums |
fe5de2b39225d9832c7b7d27febf822ce0695218856a800cc7d785b98684b546
|
| 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 Nov 28, 2026.
Transparency logRelease files / wiv_air-0.1.2-py3-none-any.whl
| Download URL | wiv_air-0.1.2-py3-none-any.whl |
|---|---|
| Size | 12.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5bd77e10bd8508aba7a42f09f91e700ffed6749f63449c80073b104f84fe4c7d
|
|
BLAKE2b-256 checksum How to use checksums |
c0cc0a9c305d7da7d311097e2a8a1370baacea214a38728567a8722ffb5a5dc7
|
| 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 Nov 28, 2026.
Transparency logSecurity for wiv-air 0.1.2
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 wiv_air-0.1.2.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 Nov 28, 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.