{"id":"io.github.entradox/agent-ledger","slug":"io-github-entradox-agent-ledger","title":"AgentLedger","description":"Meter, cap, and block AI agent spend before the provider is charged.","version":"0.4.7","publisher":{"kind":"github","id":"entradox","label":"@entradox on GitHub","url":"https://github.com/entradox"},"website":"https://aiagentscity.com","repository":"https://github.com/entradox/agent-ledger","remotes":[{"type":"streamable-http","url":"https://aiagentscity.com/mcp/"}],"packages":[],"published":"2026-10-16","updated":"2026-10-16","status":"online","auth":"","latency_ms":1122,"checked":"2026-11-19","uptime":100,"checks":3,"tools":[{"name":"ledger_rotate_secret","title":"Rotate Agent Secret","description":"Mint a NEW agent_secret for an agent_id your workspace already owns, invalidating the old one.\n\nUse this to RECOVER an agent whose secret was lost: the previous credential\nstops working immediately. Requires the workspace_key that owns agent_id —\nan agent's own agent_secret cannot rotate itself, because a leaked agent\ncredential must not be able to lock its real owner out. Unlike ledger_track\nthis","read_only":false},{"name":"ledger_revoke_secret","title":"Revoke Agent Secret","description":"Invalidate an agent_id's agent_secret WITHOUT deleting its spend history.\n\nUse when a credential may have leaked, or to stop an agent writing.\nSubsequent writes to that agent fail with agent_secret_mismatch until you\nrotate a new secret in. The agent_id stays claimed, so no other workspace\ncan claim it and inherit the ledger. Requires the workspace_key that owns\nagent_id.\n\nReturns {\"agent_id\", \"re","read_only":false},{"name":"ledger_track","title":"Track Agent Spend","description":"Record a spend entry for an AI agent on any payment rail, with optional token counts.\n\nClaiming a brand-new agent_id requires your workspace_key (get one via\nx402 at POST /v1/billing/x402 — no human, no login — or at /start).\nThat first call mints an\nagent_secret and returns it in the response — save it, every later call\nfor that same agent_id must pass it back (no workspace_key needed again)\nor t","read_only":false},{"name":"ledger_set_budget","title":"Set Agent Budget","description":"Set spending caps for an agent. Warns at 80%, blocks spend when exceeded\n— enforced: a ledger_track call that would cross the cap is rejected.\n\nDollar caps (monthly_cents/daily_cents) and token caps (monthly_tokens/\ndaily_tokens) are independent dimensions: dollar caps only cover\nnon-\"tokens\" rails, token caps only cover rail=\"tokens\" bookkeeping rows\n(tokens_in/tokens_out). Set both if the agent ","read_only":false},{"name":"ledger_report","title":"Agent Spend Report","description":"Spend report for an agent over a rolling window.\n\nReturns total spend, breakdown by rail and by service, budget status\n(ok/warning/exceeded), detected anomalies, and entry count.\n\nRequires a credential: either the agent's own agent_secret or its\nworkspace's workspace_key (same rule as GET /v1/report).","read_only":true},{"name":"ledger_proxy_attach","title":"Attach the Budget-Enforcing Proxy","description":"Point your provider traffic at the proxy so budget caps are enforced\nBEFORE the provider is contacted, instead of being reported afterwards.\n\nThis closes the gap where the brake was unreachable from MCP: an agent\nconnected over MCP could record spend (ledger_track) but nothing could\nrefuse a call. With this, the cap is enforced on every LLM call.\n\nReturns the base_url to use, the two headers to se","read_only":true},{"name":"ledger_alerts","title":"Agent Budget Alerts","description":"Alert history for an agent: budget warnings (80% threshold) and spending spikes.\n\nRequires a credential: either the agent's own agent_secret or its\nworkspace's workspace_key (same rule as GET /v1/alerts).","read_only":true},{"name":"ledger_wait_events","title":"Wait for Agent Events","description":"Long-poll an agent's event feed — how an agent with no public URL receives alerts.\n\nWebhooks (POST /v1/webhooks) push events to a URL you own; an agent on\nstdio MCP cannot host one, so it waits here instead. Call this in a loop:\nthe call holds open up to `timeout` seconds (max 30) and returns when\nevents arrive or the wait lapses.\n\n`consumer_id` names this consumer durably — pick a stable one\n(e.g","read_only":true},{"name":"ledger_check_spend","title":"Check Before Spending","description":"Ask BEFORE you spend: may this agent spend this much right now?\n\nReturns allowed (true/false), a stable reason code (within_budget,\nover_monthly_cap, over_daily_cap, over_monthly_token_cap,\nover_daily_token_cap, no_budget_set, unpriced_model), a one-line message,\nthe cost estimate, the price used (with its source and as_of date) and\nevery budget window with cap, spent and remaining.\n\nSame decision","read_only":true},{"name":"ledger_request_approval","title":"Request Spend Approval","description":"Ask your workspace owner for a one-shot spend exception before a\nledger_track that the cap would refuse.\n\nCreates a pending permit for exactly amount_cents on the given service.\nThe owner (a human, or a supervisor agent holding the workspace_key)\napproves or denies it with ledger_approval_decide. An APPROVED permit is\nconsumed by the next ledger_track for this agent whose amount fits inside\nit — t","read_only":false},{"name":"ledger_approvals","title":"List Spend Approvals","description":"List spend-approval permits — yours, or your whole workspace's.","read_only":true},{"name":"ledger_approval_decide","title":"Approve or Deny a Spend Request","description":"Approve or deny a pending spend permit — workspace owner only.\n\nThe agent's own agent_secret can REQUEST an approval but can never decide\none: a credential that can approve its own requests is not a control.\ndecision must be 'approve' or 'deny'; only pending permits can be decided.\nAn approved permit is consumed by the agent's next ledger_track within\nits amount — it is a one-shot exception, not a","read_only":false},{"name":"ledger_price","title":"Price a Call Before You Make It","description":"What will this call cost? Priced from the same table the caps use.\n\nExists because ledger_track requires the CALLER to supply amount_cents, so an\nagent whose spend is capped could under-report its own cost and stay under\nthe cap. This returns the number the enforcement path would use, so an agent\ncan report honestly (and plan before it spends).\n\nCost = (tokens_in * in_rate + tokens_out * out_rate)","read_only":true},{"name":"ledger_start","title":"Start a Workspace","description":"Get a FREE AgentLedger workspace with no credential and no arguments —\nthe MCP equivalent of opening POST /start in a browser.\n\nCall this FIRST if you have no credentials yet. Every other tool here\n(ledger_track, ledger_set_budget, ledger_report, ledger_alerts) needs a\nworkspace_key or an agent_secret, so a caller arriving with neither must\nstart here or it has nowhere to go.\n\nTakes NO arguments o","read_only":false},{"name":"ledger_api_docs","title":"AgentLedger API Docs","description":"Self-serve documentation for AgentLedger — quickstart, MCP tools, REST\nendpoints, budget caps, error codes, and idempotency usage, as markdown.","read_only":true},{"name":"ledger_examples","title":"AgentLedger Recipes","description":"Complete, runnable Python recipe for a common AgentLedger integration\npattern.","read_only":true},{"name":"skills_list_tool","title":"Skills List Tool","description":"List this product's skills. Each entry carries the SKILL.md URI,\nits name and description, verbatim frontmatter, and a per-file\nsha256 manifest. Read a body with `read_skill`.","read_only":false},{"name":"read_skill","title":"Read Skill","description":"Read a product skill file by its skill:// URI.","read_only":false}],"server_info":{"name":"agent-ledger","version":"0.4.7"},"category":"finance","tags":["agents","analytics","developer"],"kind":"remote","source":"registry","submitted":{},"first_party":false,"domain_rank":null,"score":100,"indexable":true,"first_seen":"2026-09-07","stars":0,"badges":[],"sponsor":null,"page":"https://agentsindex.org/agents/io-github-entradox-agent-ledger/"}