Agent Gateway 3 min read

Agent Credits

Credits are the billing unit for agent gateway tool calls. They are workspace-scoped — any API key in your workspace draws from the same balance.

The agent gateway (MCP + A2A at agent.abtestbot.com) is available on any plan. Buy a credit pack to get started. Enterprise plans include unlimited usage — no credits are deducted for Enterprise workspaces.


Enterprise plan — unlimited usage

Workspaces on the Enterprise plan bypass credit deduction entirely. Tool calls on agent.abtestbot.com are unmetered; purchase packs and balance are not shown in the UI. If you're on Enterprise and switch to a lower tier, you'll revert to pay-as-you-go (any unused credits in your balance remain available — they don't expire).


Credit Packs

Pack Credits Price Best for
Starter 100 $9 Evaluation, low-volume automations
Growth 500 $39 Regular agent workflows
Scale 2,000 $129 High-volume or team use

Credits never expire. Unused credits roll over indefinitely.

Purchase: Settings → Agent Credits → Buy Pack (redirects to Stripe Checkout)


Credit Costs Per Tool

Tool Credits
list_sites 1
list_ideas 1
list_experiments 1
get_site_intelligence 2
get_experiment 2
launch_experiment 2
pause_loop 2
resume_loop 2
get_loop_status 2
create_site 5
create_experiment 5
generate_ideas 10
generate_variant 10
create_loop 15

How Deduction Works

Credits are checked and deducted atomically before the tool executes. If your balance is insufficient:

  • MCP: Returns HTTP 200 with a tool result flagged isError: true whose text explains the shortfall and links to the billing page. (MCP clients surface result content to the agent, but collapse transport/protocol errors into a generic message — so the shortfall is returned as a result, not a JSON-RPC error.)
  • A2A: Returns HTTP 402 with an error message.

No credits are charged for failed tool calls. Credits are deducted before execution, but if the tool then fails (validation error, upstream error), the charge is automatically refunded — your balance is restored and the refund is logged in your transaction history. Enterprise workspaces are never charged in the first place, so nothing is deducted or refunded.


Checking Your Balance

Via the API:

curl -X POST https://[SUPABASE_URL]/functions/v1/manage-agent-credits \
  -H "Authorization: Bearer [USER_JWT]" \
  -H "Content-Type: application/json" \
  -d '{ "action": "balance", "workspace_id": "[WORKSPACE_ID]" }'

Response:

{
  "credits": 487,
  "updated_at": "2025-03-01T12:00:00Z",
  "transactions": [
    { "delta": -10, "tool_name": "generate_ideas", "created_at": "..." },
    { "delta": 500, "tool_name": null, "created_at": "..." }
  ]
}