ACPpotamia
Advanced guide

Everything ACPpotamia does, explained.

How ACPpotamia works and how to use each part of it, with diagrams, worked examples and code you can paste. The chapters build on each other, but each one stands alone, so skip to whatever you need. Keep the API reference open in another tab for exact endpoints and headers.

The life of a call through ACPpotamiaYour agentOpenAI or AnthropicSDK, unchangedEdge checkACPpotamia keynearest CloudflareTeam control object1 Revoked key, suspended team2 Model policy3 Kill switch4 Rate limits: team, key, tenant, session5 Loop detection6 Budget hold: team, key, tenant, sessionAll decided in one atomic stepProviderOpenAI, Anthropicor your own serverSettlereal cost replaces the holdAudit logD1 records,R2 daily archivecallallowedanswer streams back to your agent, tokens counted liveblocked: 401 · 402 · 403 · 429, never sent
The whole system on one page. Your agent's call is checked at the edge and by your team's control object, goes to the provider, and is settled and logged on the way back.

Who it is for

You areYour problemWhat ACPpotamia gives youStart with
Engineering teamA bug in an agent loop can run up a large bill on a shared API keyPer-key budgets, per-session rate limits, loop stop, test keysChapter 2, 6
SaaS or agent platformOne customer or a malicious prompt can use up resources shared by all customersPer-customer (tenant) budgets and rate limits, set from your codeChapter 4
Security and FinOpsNo central view, policy or evidence across departments running agentsOrganizations, model policies, audit export, a global kill switchChapter 5

Chapters

Words used in this guide

TermMeaning
OrganizationSeveral teams (departments) with shared policy, kill switch and export.
TeamYour workspace: its own keys, limits, billing and control object.
API keyacp_ for real calls, acp_test_ for mock calls. Each can have its own limits.
AgentA name you give each agent (X-ControlPlane-Agent-Id), for activity and spend.
SessionOne task (X-ControlPlane-Session-Id): the unit for loop detection and stopping.
TenantOne of your own customers (X-ControlPlane-Tenant-Id), with their own budget.
Control objectThe one server that holds your team's limits and decides each call in a single step.
ReservationMoney held for a call in progress, replaced by the real cost when it ends.