Metadata-Version: 2.4
Name: zambo-ai
Version: 1.0.14
Summary: Official Python SDK for Zambo (zambo.dev), the verifiable work layer for AI: tools behind one MCP endpoint (https://zambo.dev/mcp) over plain JSON-RPC, a verifiable receipt for every job. Includes SpendGuard: a hard per-call and per-day spend cap in front of your agent's wallet, with every refusal recorded. No account, no API key. Free: 20 calls + 1 wrap-up free every day; picking up in another AI is always free.
Author-email: Zambo <brennanzambo@zambo.dev>
License: MIT
Project-URL: AER-1 standard, https://zambo.dev/aer1/
Project-URL: Add Zambo to your AI, https://zambo.dev/add/
Project-URL: Homepage, https://zambo.dev
Project-URL: Documentation, https://zambo.dev
Project-URL: Source, https://gitlab.com/rambozambodotdev/zambo
Keywords: mcp,ai-tools,zambo,agents,crypto,seo-audit,spend-limit,agent-wallet,x402,spend-guard
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# zambo-ai

**AER-1, the agent execution receipt standard: [zambo.dev/aer-1](https://zambo.dev/aer-1/) | Add Zambo to your AI: [zambo.dev/add/](https://zambo.dev/add/)**

Zambo is the verifiable work layer for AI. This is its official Python SDK: tools behind one MCP endpoint over plain JSON-RPC, a verifiable receipt for every job.

Receipt format: AER-1, IETF Internet-Draft [draft-zambo-aer1-26](https://datatracker.ietf.org/doc/draft-zambo-aer1/26/).

Official Python SDK for [Zambo](https://zambo.dev), MCP tools for AI agents and apps over plain JSON-RPC 2.0. **No account, no API key.** Free: 20 calls + 1 wrap-up free every day; picking up in another AI is always free.

Every call returns a **verifiable receipt** (UUID + timestamp + SHA-256). Check any receipt at `https://zambo.dev/run/<id>`.

## Install

```bash
pip install zambo-ai
```

Zero dependencies, stdlib only. Python 3.8+.

## Quickstart

```python
from zambo_ai import Zambo

z = Zambo()

# Live crypto price
btc = z.price("BTC")
print(btc.text)
# BTC · $75,704.00 USD ...   (live value at publish time)

# Describe any job in plain language: Zambo chains the right tools
job = z.universal("audit https://example.com for AI discoverability", session="my-session-1")
print(job.text)
print("receipt:", job.receipt_id)  # verify at https://zambo.dev/run/<id>

# Call any tool directly
r = z.call("live_price", {"coin": "ETH"})

# Search the tool catalog
found = z.search("generate QR code")

# List exposed tools
tools = z.list_tools()
```

## API

| Method | Description |
|---|---|
| `z.price(coin)` | Live crypto price (`"BTC"`, `"ETH"`, …) |
| `z.universal(goal, session=None)` | Plain-language job → Zambo routes and executes tools. Pass a stable `session` id to continue a trail across models. |
| `z.call(tool, args)` | Direct tool call, e.g. `z.call("live_price", {"coin": "ETH"})` |
| `z.search(query)` | Search the full tool catalog |
| `z.list_tools()` | List exposed tools with descriptions |

Every result: `text`, `receipt`, `receipt_id`, `audit_url`, `raw`. JSON-RPC failures raise `zambo_ai.ZamboError`.

## Spend Guard: stop your agent from spending your money

Your agent has a wallet, a task, and no brakes. One stuck loop can burn the whole balance before you wake up: agents have drained wallets retrying a failing payment hundreds of times, and a cap that lives in a prompt is not a cap at all. Spend Guard is a hard cap that sits in front of the payment call itself, in code, where a loop cannot talk its way past it.

It ships inside this SDK (`zambo_ai.spendguard`, stdlib only) and adds a `spendguard` command line tool.

Two lines in front of any payment callable:

```python
from zambo_ai import SpendGuard

guard = SpendGuard(per_call_cap_usd=10, daily_cap_usd=25)

@guard.protect(amount_of=lambda amount, payee=None: amount)
def pay(amount, payee=None):
    ...  # your wallet or x402 payment call: it runs only when the guard allows the spend
```

Or guard a block:

```python
with guard.spend(4.99, payee="api.example.com"):
    pay(4.99, payee="api.example.com")  # a refusal raises SpendRefused before this runs
```

What it enforces:

- **Per-call cap and per-day cap** (USD, UTC days). A spend inside the caps is recorded and allowed. A spend over a cap never fires.
- **Optional payee allowlist.** A payee that is not on the list is refused like any other cap breach.
- **Refusals are records, not silence.** Every refusal is appended to `refusals.jsonl` in the state directory with the timestamp, the amount, the payee, and which cap it hit. When you ask "did my agent try to spend $900 at 3am?", the log answers with a fact you can audit, and the state file proves the day's total never went past the cap.
- **State survives restarts.** Caps and totals live in `~/.spendguard` (or `$SPENDGUARD_HOME`), so a fresh process keeps enforcing the same numbers.

From the shell:

```bash
spendguard init --per-call 10 --daily 25
spendguard check 4.99 --payee api.example.com   # exit 0: allowed and recorded
spendguard check 40                             # exit 3: refused and recorded
spendguard status                               # today's spend vs the caps, refusal count
spendguard refusals                             # the audit log
```

**Server-side cap too.** If the machine can reach the Zambo endpoint, `spendguard sync --session <your-job-id>` also sets the same daily cap on the Zambo work connection itself through the `spend_limit_set` tool (free, no quota), so the server enforces the cap even across session restarts. If the network is down, sync says so and the local guard keeps enforcing on its own. It never blocks a local verdict.

The local guard is free forever. The portable version, caps set on the Zambo connection so they follow the work instead of one machine, runs on the same pricing as everything else here: the Day Pass is $0.99 for the days your agent works, the Zambo Pass is $29 for 30 days ($19 for $ZAMBO holders), and Lifetime is $250, one payment.

## Pricing

- **Free:** 20 calls + 1 wrap-up free every day; picking up in another AI is always free, no account
- **Day pass:** $0.99 / 24 hours (USDC on Base)
- **Monthly:** $29
- **Lifetime:** $250, one payment
- **$ZAMBO holder:** $19/month

(From [zambo.dev/pricing](https://zambo.dev/pricing).)

## Links

- Zambo: https://zambo.dev
- Full tool catalog: https://zambo.dev/mcp?full=true
- MCP endpoint: `https://zambo.dev/mcp`

## License

MIT

## Where these receipts run live: Zambo

zambo-ai is the official Python SDK for Zambo, every call returning a verifiable AER-1 receipt, and it has been downloaded 3,972 times on PyPI. The live home of those receipts is Zambo, the verifiable work layer for AI. Connect any AI to the live endpoint at https://zambo.dev/mcp or add Zambo to your AI in one step at https://zambo.dev/add/

Free tier: 20 calls + 1 wrap-up free every day; picking up in another AI is always free. The Day Pass is $0.99 for 24 hours, unlimited.

Install:

    pip install zambo-ai
