Metadata-Version: 2.4
Name: openai-agents-valta
Version: 0.1.0
Summary: OpenAI Agents SDK tool for hard spending limits on AI agents via Valta
Author-email: Valta <debo@valta.co>
License: MIT
Project-URL: Homepage, https://valta.co
Project-URL: Documentation, https://valta.co/docs
Project-URL: Repository, https://github.com/billionaire664/valta.co
Project-URL: Bug Tracker, https://github.com/billionaire664/valta.co/issues
Keywords: openai,openai-agents,ai,agents,spending,budget,cost-control,policy,guardrails
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: openai-agents>=0.0.1
Dynamic: license-file

# openai-agents-valta

Hard spending limits for OpenAI Agents SDK. Enforces budget policies before any paid operation fires.

## Install

```bash
pip install openai-agents-valta
```

## Quickstart

```python
from openai_agents_valta import make_valta_tool
from agents import Agent, Runner

guard = make_valta_tool(
    api_key="vk_live_...",   # from valta.co/dashboard/api-keys
    agent_id="research-agent",
)

agent = Agent(
    name="Research Agent",
    instructions=(
        "Before any paid operation, call check_spend with the estimated cost. "
        "Only proceed if the result is 'approved'."
    ),
    tools=[guard, ...your_other_tools],
)

result = await Runner.run(agent, "Research the latest AI news")
```

## How it works

The agent calls `check_spend` before any paid operation. Valta evaluates the request against the user's policy and returns `approved` or `denied: <reason>` before the charge fires.

| Response | Meaning |
|----------|---------|
| `approved` | Spend is within policy — proceed |
| `denied: daily_limit_exceeded` | Would exceed daily budget |
| `denied: insufficient_balance` | Wallet balance too low |
| `denied: requires human approval` | Above approval threshold — check dashboard |

## Policy management

Set limits at [valta.co/dashboard/policies](https://valta.co/dashboard/policies). Changes take effect immediately — no redeploy needed.

## Links

- [valta.co](https://valta.co)
- [Documentation](https://valta.co/docs)
- [Get an API key](https://valta.co/dashboard/api-keys)
