AgentLedger
Quản lý chi tiêu theo từng agent — theo dõi chi tiêu x402/MPP/API-key, đặt giới hạn ngân sách, phát hiện bất thường, nhật ký kiểm toán đầy đủ. Giống như Datadog cho chi tiêu của agent.
Tài liệu
Your agents spend money. See every dollar, and cap it.
A per-agent spend ledger for autonomous agents. Each agent reports its own spend and token burn; you get a live P&L per agent, budget caps that block the write when crossed, spending-spike alerts, and 30-day reports — over MCP, REST and a CLI. An agent with a wallet can mint its own workspace in one call. No signup, no human.
Free
$0
- Up to 3 agents per workspace
- All rails: x402, MPP, api_key, manual
- Budget caps with real enforcement
- Token burn per agent & per model
- Alerts, 30-day reports, MCP + REST + CLI Get a workspace →
Pro
$19/mo
- Unlimited tracked agents
- Everything in Free
- Same workspace, same key, no migration
- Cancel any time
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.
What it does
- Per-agent dollar spend —
POST /v1/trackrecords spend peragent_id. The ledger is keyed by agent, not by request trace. - Four rails in one ledger — x402, MPP, API keys, manual entries. Mix them; the P&L stays whole.
- Token burn per agent and per model — pass
tokens_in/tokens_out/model;GET /v1/tokens/{agent_id}returns in/out totals and a by-model breakdown. - Caps that actually block — monthly and daily dollar caps, plus independent token caps. A
track()that would cross one is rejected with402 budget_exceededbefore it is recorded. Warnings fire at 80%. - Spending-spike alerts — anomalies are computed into every report and surfaced per agent in the alerts feed.
- Reports — 30-day totals by rail and service, plus a human-readable page per agent at
/v1/report/{agent_id}/html. - Credential-gated reads — reports, tokens and alerts require the agent's
agent_secretor the workspace'sworkspace_key. No unauthenticated read path, on REST or MCP. - MCP + REST + CLI parity — the same ledger and the same credential rules on all three surfaces, with idempotent writes and one typed error envelope.
Connect
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".
Live sample (this instance)
Tracked agents—
Live counters /stats
Getting started
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.
Why this instead of a trace viewer
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?
AgentLedger · operated as an independent software service · registry: io.github.entradox/agent-ledger
Agent-readable: /llms.txt · /server.json · /.well-known/agent.json · /openapi.json · /health
Contact: entradox@icloud.com