# chox-sdk

Python SDK for [Chox](https://chox.ai) — AI governance proxy.

## Install

```bash
pip install chox-sdk
```

## Quickstart

```python
from chox import ChoxClient

chox = ChoxClient(base_url="https://chox.example.com", token="chox_token_...")

verdict = chox.evaluate(tool="stripe.create_charge", arguments={"amount": 5000})
if verdict.verdict == "allow":
    pass  # proceed
```

## Config

| Parameter | Type | Default | Description |
|---|---|---|---|
| `base_url` | `str` | required | Chox gateway base URL |
| `token` | `str` | required | Admin key (`chox_admin_...`) or caller token (`chox_token_...`) |
| `fail_open` | `bool` | `True` | Return allow verdict on network errors instead of raising |
| `timeout` | `float` | `5.0` | Request timeout in seconds |

## Resources

```python
# Evaluate a tool call
chox.evaluate(tool, arguments=None, caller_token=None, context=None)

# Projects
chox.projects.create(name=..., slug=...)
chox.projects.get()

# Callers (AI systems)
chox.callers.create(name=..., description=...)
chox.callers.list()
chox.callers.delete(id)

# Integrations
chox.integrations.create(name=..., integration_type=..., destination_url=...)
chox.integrations.list()
chox.integrations.delete(id)

# Logs
chox.logs.list(caller_id=None, integration=None, action_type=None, start=None, end=None, limit=None, offset=None)
chox.logs.get(id)

# Stats
chox.stats.actions(start=None, end=None)
chox.stats.hourly(start=None, end=None)
chox.stats.integrations(start=None, end=None)
chox.stats.total()
```

## License

MIT
