Usage API, team wallets, and callbacks
The public Coda API now exposes remaining credits, post-hoc run cost, Enterprise team wallets, and an optional signed usage callback.
Usage
Authenticated with the same bearer token (mcp:read or agents:run). Not available on /mcp.
GET /usage/creditsreturns remaining free and paid credits.GET /usagereturns the remaining balance, token totals,daily[]buckets, ateams[]breakdown, and recent runs (since/until/limit).GET /usage/runs/{run_id}looks up settled cost forX-Run-Id/job_id.GET /usage/threads/{thread_id}looks up cost forX-Thread-Id.GET /usage/teams/{team_id}looks up cost billed to one team.
charged_credits is the 1:1 settled deduction. The public API does not expose the internal rate formula. thread_id attach is best-effort; a charge can settle with thread_id null.
Team wallets
- Optional
team_idonPOST /agentsandPOST /qpusbills a staff-loaded Enterprise team wallet (billed_team_id). - Personal tokens bill the personal wallet unless
team_idis set. Team service-account keys always bill their team. A mismatchedteam_idreturns400. There is no fallback to the personal wallet. GET /teams,GET /teams/{team_id}, andGET /teams/{team_id}/membersreturn the roster. Keys cannot be minted through the API.- There is no Coda project entity. Teams are the grouping axis.
Usage callbacks
Enterprise team owners can set an https:// callback under Settings → Teams → Keys → Usage callback. Coda POSTs usage.settled, usage.released, and usage.test events signed with X-Coda-Signature. The pull usage API remains the ledger.