AgentLedger

io.github.entradox/agent-ledger · v0.4.7 · agents-and-memory

AgentLedger is healthy: it completed an MCP handshake in 760 ms and exposes 18 tools.

Meter, cap, and block AI agent spend before the provider is charged.

Endpoint: https://aiagentscity.com/mcp/ (streamable-http)

Repository · Website · JSON · Add to my inventory

Facts

Users (last 30 days)0
HandshakeHealthy
Auth neededNone
Tool count18
Latency760 ms
Last checked (UTC)2026-12-01T00:55:17.268Z

Health history

Checked (UTC)StatusLatencyError
2026-12-01T00:55:17.268ZHealthy760
2026-11-28T15:05:11.793ZHealthy598
2026-11-26T07:05:24.658ZHealthy1025
2026-11-24T00:50:53.982ZHealthy2241
2026-11-21T20:35:27.033ZHealthy264
2026-11-19T17:45:13.209ZHealthy1416
2026-11-17T16:05:29.896ZHealthy843
2026-11-15T15:50:47.018ZHealthy1142
2026-11-13T17:00:55.820ZHealthy1411
2026-11-11T19:05:31.078ZHealthy1382
2026-11-09T22:15:30.187ZHealthy1482
2026-11-08T02:45:25.089ZHealthy702
2026-11-06T08:30:44.572ZHealthy484
2026-11-04T14:50:28.175ZHealthy1836
2026-11-02T22:05:24.748ZHealthy1616
2026-11-01T06:30:25.556ZHealthy529
2026-10-30T16:00:25.817ZHealthy795
2026-10-29T02:05:14.135ZHealthy1001
2026-10-27T12:35:17.712ZHealthy2476
2026-10-26T00:25:15.095ZHealthy1801

Tools (18)

ledger_rotate_secretMint a NEW agent_secret for an agent_id your workspace already owns, invalidating the old one. Use this to RECOVER an agent whose secret was lost: the previous credential stops working immediately. Requires the workspace_key that owns agent_id — an agent's own agent_secret cannot rotate itself, bec
ledger_revoke_secretInvalidate an agent_id's agent_secret WITHOUT deleting its spend history. Use when a credential may have leaked, or to stop an agent writing. Subsequent writes to that agent fail with agent_secret_mismatch until you rotate a new secret in. The agent_id stays claimed, so no other workspace can claim
ledger_trackRecord a spend entry for an AI agent on any payment rail, with optional token counts. Claiming a brand-new agent_id requires your workspace_key (get one via x402 at POST /v1/billing/x402 — no human, no login — or at /start). That first call mints an agent_secret and returns it in the response — sav
ledger_set_budgetSet spending caps for an agent. Warns at 80%, blocks spend when exceeded — enforced: a ledger_track call that would cross the cap is rejected. Dollar caps (monthly_cents/daily_cents) and token caps (monthly_tokens/ daily_tokens) are independent dimensions: dollar caps only cover non-"tokens" rails,
ledger_reportSpend report for an agent over a rolling window. Returns total spend, breakdown by rail and by service, budget status (ok/warning/exceeded), detected anomalies, and entry count. Requires a credential: either the agent's own agent_secret or its workspace's workspace_key (same rule as GET /v1/report
ledger_proxy_attachPoint your provider traffic at the proxy so budget caps are enforced BEFORE the provider is contacted, instead of being reported afterwards. This closes the gap where the brake was unreachable from MCP: an agent connected over MCP could record spend (ledger_track) but nothing could refuse a call. W
ledger_alertsAlert history for an agent: budget warnings (80% threshold) and spending spikes. Requires a credential: either the agent's own agent_secret or its workspace's workspace_key (same rule as GET /v1/alerts).
ledger_wait_eventsLong-poll an agent's event feed — how an agent with no public URL receives alerts. Webhooks (POST /v1/webhooks) push events to a URL you own; an agent on stdio MCP cannot host one, so it waits here instead. Call this in a loop: the call holds open up to `timeout` seconds (max 30) and returns when e
ledger_check_spendAsk BEFORE you spend: may this agent spend this much right now? Returns allowed (true/false), a stable reason code (within_budget, over_monthly_cap, over_daily_cap, over_monthly_token_cap, over_daily_token_cap, no_budget_set, unpriced_model), a one-line message, the cost estimate, the price used (w
ledger_request_approvalAsk your workspace owner for a one-shot spend exception before a ledger_track that the cap would refuse. Creates a pending permit for exactly amount_cents on the given service. The owner (a human, or a supervisor agent holding the workspace_key) approves or denies it with ledger_approval_decide. An
ledger_approvalsList spend-approval permits — yours, or your whole workspace's.
ledger_approval_decideApprove or deny a pending spend permit — workspace owner only. The agent's own agent_secret can REQUEST an approval but can never decide one: a credential that can approve its own requests is not a control. decision must be 'approve' or 'deny'; only pending permits can be decided. An approved permi
ledger_priceWhat will this call cost? Priced from the same table the caps use. Exists because ledger_track requires the CALLER to supply amount_cents, so an agent whose spend is capped could under-report its own cost and stay under the cap. This returns the number the enforcement path would use, so an agent ca
ledger_startGet a FREE AgentLedger workspace with no credential and no arguments — the MCP equivalent of opening POST /start in a browser. Call this FIRST if you have no credentials yet. Every other tool here (ledger_track, ledger_set_budget, ledger_report, ledger_alerts) needs a workspace_key or an agent_secr
ledger_api_docsSelf-serve documentation for AgentLedger — quickstart, MCP tools, REST endpoints, budget caps, error codes, and idempotency usage, as markdown.
ledger_examplesComplete, runnable Python recipe for a common AgentLedger integration pattern.
skills_list_toolList this product's skills. Each entry carries the SKILL.md URI, its name and description, verbatim frontmatter, and a per-file sha256 manifest. Read a body with `read_skill`.
read_skillRead a product skill file by its skill:// URI.