Metadata-Version: 2.4
Name: xpenvo
Version: 0.1.1
Summary: Hard spending limits for AI agents: helpers for the Xpenvo Agents proxy (OpenAI, Anthropic, Gemini, Mistral, OpenRouter, Azure OpenAI, Amazon Bedrock).
Author-email: Xpenvo <agents@xpenvo.com>
License-Expression: MIT
Project-URL: Homepage, https://agents.xpenvo.com
Project-URL: Documentation, https://agents.xpenvo.com/docs
Project-URL: Security, https://agents.xpenvo.com/security
Project-URL: Source, https://github.com/Joel-hub-dotcom/xpenvo-agents-sdk/tree/main/python
Project-URL: Issues, https://github.com/Joel-hub-dotcom/xpenvo-agents-sdk/issues
Project-URL: Changelog, https://github.com/Joel-hub-dotcom/xpenvo-agents-sdk/releases
Keywords: ai,agents,llm,budget,spending limit,cost,openai,anthropic,gemini,guardrails
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# xpenvo

Hard spending limits for AI agents. This is the small helper library for
[Xpenvo Agents](https://agents.xpenvo.com): it points your existing provider SDK at Xpenvo, adds your
agent key, waits for approvals and tells you why a request was stopped.

You keep using your provider's own SDK (OpenAI, Anthropic, Gemini, Mistral, OpenRouter, Azure OpenAI,
Amazon Bedrock). One module, standard library only, Python 3.9+.

```sh
pip install xpenvo
```

```python
import os
from openai import OpenAI
from xpenvo import Xpenvo, new_run_id

x = Xpenvo(key=os.environ["XPENVO_KEY"], run=new_run_id(), customer="customer-42")
client = OpenAI(base_url=x.base_url("openai"), default_headers=x.headers())
reply = x.with_approval(lambda: client.chat.completions.create(model="gpt-5-mini", messages=[{"role": "user", "content": "Hi"}]))
```

What it does:

1. gives the Xpenvo address for each provider (`x.base_url("anthropic")`, `x.base_url("azure", "my-resource")` ...),
2. adds your agent key and the optional run, step and end-customer labels,
3. waits for a person to approve a big request, then runs it again (`with_approval`),
4. tells you, in plain words, why Xpenvo stopped a request (`reason(err)`, `REASONS`),
5. names cheaper fallback models and chooses fail-open or fail-closed,
6. checks and records spending that is not a model call, such as tools and search APIs (`x.spend`),
7. tells you how much the key can still spend (`x.status()`).

Your prompts and answers go only to Xpenvo and your provider, exactly as before. Never put an email
address or other personal data in run, step or customer labels; use your own ids.

Setup guide: https://agents.xpenvo.com/docs · Security: https://agents.xpenvo.com/security

Xpenvo Agents is in a free private beta: https://agents.xpenvo.com
