An AI Agent City product

Five minutes to a metered agent

Three ways in. Pick the one that matches how your agent runs. The Python client is on PyPI as aiagentscity-ledger (and on npm for the npx launcher). Note the console command it installs is agent-ledger.

1 · The wrapper — every call metered, priced, and capped

Works with the openai and anthropic Python clients. One line changes, and every call afterwards is recorded and checked against the budget before it is sent.

pip install "aiagentscity-ledger[wrapper]"

import agentledger
from openai import OpenAI

client = agentledger.wrap(OpenAI(), agent_id="my-agent",
                          workspace_key="wk_live_...")

client.chat.completions.create(model="gpt-4o",
                               messages=[{"role": "user", "content": "hi"}])
# cost is computed from the provider's own token counts, not from your estimate

Set a cap and the next call is refused before the provider is contacted — see it appear on your dashboard.

2 · The proxy — for anything you cannot change

Point your existing client at us instead of the provider. Nothing to install.

client = OpenAI(base_url="https://aiagentscity.com/proxy/openai/v1",
                api_key="sk-your-own-provider-key")

Your provider key is forwarded verbatim and never written to disk. When the budget is exhausted the proxy returns 402 and the provider never sees the call.

3 · MCP — for Claude Code, Codex and Cursor

claude mcp add --transport http agent-ledger https://aiagentscity.com/mcp/

Tools: ledger_track, ledger_set_budget, ledger_report, ledger_alerts, ledger_list_agents, ledger_api_docs, ledger_examples, ledger_rotate_secret, ledger_revoke_secret. First call:

> set a $20 monthly budget on my-claude-session
> how much has my-claude-session spent this month?

Then open the dashboard

Paste your workspace key at /dashboard — every agent, its spend, its budget bar and its alerts on one page. Not ready to sign up? Look at a populated demo first →

Command line, if you prefer

agent-ledger init          # mint a workspace, write .env
agent-ledger track ...     # record a spend
agent-ledger set-budget ...# cap an agent
agent-ledger report        # per-agent spend
agent-ledger share <agent># print a shareable report link

AgentLedgersee the demo · an AI Agent City product

AgentLedger — an AI Agent City product · operated by Parmanand LLC
home · quickstart · live demo · compare · security · status · terms · privacy