Already have a workspace_key? Post it to /v1/billing/checkout and the upgrade link is built for that workspace.
Start with no signup, no login and no card at /start. A workspace is free — 3 agents, every feature, no expiry. The workspace key is shown once, on the spot.
Past 3 agents it's $19/mo for unlimited tracked agents on the same workspace, same key, no migration. The upgrade link is built for your workspace, not a generic checkout.
POST /v1/track records spend per agent_id. The ledger is keyed by agent, not by request trace.tokens_in/tokens_out/model; GET /v1/tokens/{agent_id} returns in/out totals and a by-model breakdown.track() that would cross one is rejected with 402 budget_exceeded before it is recorded. Warnings fire at 80%./v1/report/{agent_id}/html.agent_secret or the workspace's workspace_key. No unauthenticated read path, on REST or MCP.Claude Code
claude mcp add --transport http agent-ledger https://agent-ledger-production-0ff8.up.railway.app/mcp/
Codex
codex mcp add agent-ledger --url https://agent-ledger-production-0ff8.up.railway.app/mcp/
Cursor / any MCP client — merge into mcp.json:
{
"mcpServers": {
"agent-ledger": {
"url": "https://agent-ledger-production-0ff8.up.railway.app/mcp/"
}
}
}
Tools: ledger_track, ledger_set_budget, ledger_report, ledger_alerts, ledger_list_agents, plus open docs tools ledger_api_docs and ledger_examples. Registered as io.github.entradox/agent-ledger.
Try it in your agent: "Track my Claude Code spend" · "Alert when any agent exceeds $50/day" · "Weekly P&L report".
1. Get a workspace_key — no signup, no login, no card: /start. Running as an agent with a wallet, with no human at all: POST /v1/billing/x402 — the paying wallet becomes the workspace identity.
2. Track a spend event — dollars and tokens
curl -sL --post301 -X POST https://agent-ledger-production-0ff8.up.railway.app/v1/track \
-H "Content-Type: application/json" \
-H "AL-API-Version: 2026-09-01" \
-d '{"agent_id":"my-agent","rail":"x402","amount_cents":100,"service":"search","tokens_in":4500,"tokens_out":1200,"model":"gpt-4o","workspace_key":"YOUR_WORKSPACE_KEY"}'
A key claims, a secret writes: the first call for a new agent_id must carry "workspace_key":"wk_live_..." in the body — that claims it into your workspace — and returns that agent's agent_secret. Save the secret: every later write to the same agent_id sends "agent_secret":"..." instead and needs no workspace_key. Reads (report/tokens/alerts) require an X-Agent-Secret or X-Workspace-Key header — over REST and MCP alike.
3. Set a monthly cap — enforced, not just logged:
curl -X POST https://agent-ledger-production-0ff8.up.railway.app/v1/budget \
-H "Content-Type: application/json" \
-H "AL-API-Version: 2026-09-01" \
-d '{"agent_id":"my-agent","monthly_cents":5000,"agent_secret":"YOUR_SAVED_SECRET"}'
4. Pull the P&L — totals, by rail, by service, budget status and anomalies:
curl "https://agent-ledger-production-0ff8.up.railway.app/v1/report/my-agent?days=30" \ -H "X-Agent-Secret: YOUR_SAVED_SECRET"
Token burn: /v1/tokens/my-agent. Browser view: /v1/report/my-agent/html.
The per-request trace tools run $39–$249/mo — LangSmith $39/seat, W&B $60, Helicone $79, Galileo $100, Datadog LLM $240, Braintrust $249 — they bill per seat or per trace, and none of them enforce a budget cap.
AgentLedger is $19, bills per workspace, and is built per-agent with caps that block. The unit of accounting is the agent, not the request — which is the question you actually ask when you run twenty named agents: which one is burning money, and how do I stop it?