Get API key →

Connect AgentBill to your AI tools

One URL. Your assistant reads what each job used and what it cost at list price, asks a job's ceiling before a call, and records what a call used. Pick where you work. OpenClaw has a plugin of its own instead.

Claude

Claude.ai and Claude Desktop, with a custom connector. You sign in to AgentBill and approve it, no key to paste.

  1. In Claude, open Customize, then Connectors. Press +, then Add custom connector.
  2. Paste the server URL and press Add.
  3. Connect it, sign in to AgentBill in the window that opens, and press Allow.
Server URL
https://agentbill.dev/mcp
How to connect?

Custom connectors are on the Free, Pro, Max, Team and Enterprise plans; Free has one custom connector. Claude reaches AgentBill from Anthropic's cloud, not from your computer.

Team and Enterprise: an Owner adds it once under Organization settings, Connectors: Add, Custom, Web, then the server URL. Each member then finds it under Customize, Connectors and presses Connect.

In a chat: press +, then Connectors, and turn AgentBill on.

Claude has no link that adds a connector for you, so this button opens the page where you add it.

ChatGPT

ChatGPT on the web, as an app. It needs developer mode, on Pro, Plus, Business, Enterprise and Education accounts. ChatGPT connects with a sign-in only; it cannot send an API key.

  1. Turn on developer mode: Settings, Security and login, Developer mode.
  2. Open ChatGPT apps, press +, and give it a name (AgentBill) and a description.
  3. Under Connection, paste the server URL with its /mcp path, choose OAuth, sign in to AgentBill and press Allow.
Server URL
https://agentbill.dev/mcp
How to connect?

A new app shows under Drafts.

ChatGPT has no link that adds an app for you, so this button opens the page where you add it.

Claude Code

One command in your terminal, then a sign-in inside Claude Code.

claude mcp add --transport http agentbill https://agentbill.dev/mcp
  1. Run the command.
  2. In Claude Code, run /mcp, choose agentbill and sign in to AgentBill in the browser.
  3. Press Allow.
Server URL
https://agentbill.dev/mcp
How to connect?

With an API key instead of a sign-in. Put your key in AGENTBILL_API_KEY. Your shell fills it in when the command runs, and Claude Code keeps it in its own config:

Terminal
claude mcp add --transport http agentbill https://agentbill.dev/mcp --header "Authorization: Bearer $AGENTBILL_API_KEY"

Or in a project's .mcp.json, where Claude Code reads the variable each time it starts:

.mcp.json
{
  "mcpServers": {
    "agentbill": {
      "type": "http",
      "url": "https://agentbill.dev/mcp",
      "headers": {
        "Authorization": "Bearer ${AGENTBILL_API_KEY}"
      }
    }
  }
}

Codex

OpenAI Codex, the CLI and the IDE extension. Add the server, then sign in.

codex mcp add agentbill --url https://agentbill.dev/mcp
  1. Run the command.
  2. Run codex mcp login agentbill and sign in to AgentBill in the browser.
  3. Press Allow.
Server URL
https://agentbill.dev/mcp
How to connect?

With an API key instead of a sign-in. In ~/.codex/config.toml, name the variable that holds your key, and set AGENTBILL_API_KEY where Codex runs:

config.toml
[mcp_servers.agentbill]
url = "https://agentbill.dev/mcp"
bearer_token_env_var = "AGENTBILL_API_KEY"

In the IDE extension: the gear menu, MCP servers, Add server, then Streamable HTTP and the server URL.

Cursor

One click opens Cursor with AgentBill ready to add. Cursor then signs you in to AgentBill.

Add to Cursor
  1. Press Add to Cursor and confirm the install in Cursor.
  2. Sign in to AgentBill when Cursor asks, and press Allow.
Server URL
https://agentbill.dev/mcp
How to connect?

With an API key instead of a sign-in. In .cursor/mcp.json for one project, or ~/.cursor/mcp.json for all of them. Cursor reads AGENTBILL_API_KEY from your environment:

mcp.json
{
  "mcpServers": {
    "agentbill": {
      "url": "https://agentbill.dev/mcp",
      "headers": {
        "Authorization": "Bearer ${env:AGENTBILL_API_KEY}"
      }
    }
  }
}

Antigravity

Google Antigravity, through its MCP config file. Antigravity signs you in to AgentBill when it connects.

mcp_config.json
{
  "mcpServers": {
    "agentbill": {
      "serverUrl": "https://agentbill.dev/mcp"
    }
  }
}
  1. In the agent panel, open the … menu, then MCP Servers, Manage MCP Servers, View raw config.
  2. Add the agentbill entry above and save.
  3. Sign in to AgentBill when Antigravity asks, and press Allow.
Server URL
https://agentbill.dev/mcp
How to connect?

The file is ~/.gemini/config/mcp_config.json, or .agents/mcp_config.json in a workspace. The field is serverUrl; Antigravity does not read url here.

With an API key instead of a sign-in. Antigravity's documentation does not say it reads environment variables in this file, so the key goes in it: put yours where agb_your_key_here is, and keep the file out of version control.

mcp_config.json, with a key
{
  "mcpServers": {
    "agentbill": {
      "serverUrl": "https://agentbill.dev/mcp",
      "headers": {
        "Authorization": "Bearer agb_your_key_here"
      }
    }
  }
}

Antigravity has no install link, so this button copies the config.

OpenClaw

OpenClaw, with the AgentBill plugin from ClawHub, version 0.3.0. This one is not MCP: it is a native OpenClaw plugin that gives each session one ceiling and checks it before every model turn and every tool call. When the ceiling is spent, the call is refused and the session says so.

View on ClawHub
openclaw plugins install clawhub:@agentbill/openclaw
  1. Run the install command.
  2. Give it your key: apiKey in the plugin config below, or AGENTBILL_API_KEY in the Gateway environment. Keep hooks.allowConversationAccess on: without it OpenClaw does not gate model turns.
  3. Restart the Gateway. The log line [agentbill] ceiling 500000 tokens per session means it is on.
OpenClaw config
{
  "plugins": {
    "entries": {
      "agentbill": {
        "enabled": true,
        "hooks": { "allowConversationAccess": true },
        "config": {
          "apiKey": "agb_...",
          "ceilingUnits": 500000
        }
      }
    }
  }
}
How to connect?

The package is @agentbill/openclaw; its plugin id, the key under plugins.entries, is agentbill. The ceiling is per session, 500,000 tokens by default, and subagents spawned from a session draw on the same ceiling.

Every option, and what a refusal looks like, is on the OpenClaw guide.

Other

VS Code with Copilot in one click, and any other client that speaks Streamable HTTP.

Add to VS Code
  1. VS Code: press Add to VS Code, then start the server and sign in to AgentBill when it asks.
  2. Anything else: give it the server URL. It finds the sign-in on its own, or send your key as Authorization: Bearer.
Server URL
https://agentbill.dev/mcp
How to connect?

VS Code with an API key. In .vscode/mcp.json. VS Code asks for the key once and keeps it out of the file:

.vscode/mcp.json
{
  "inputs": [
    { "type": "promptString", "id": "agentbill-key", "description": "AgentBill API key", "password": true }
  ],
  "servers": {
    "agentbill": {
      "type": "http",
      "url": "https://agentbill.dev/mcp",
      "headers": {
        "Authorization": "Bearer ${input:agentbill-key}"
      }
    }
  }
}

Any client. The endpoint is Streamable HTTP. With no credentials it answers 401 with a WWW-Authenticate header that points at its OAuth metadata, which is how a client learns to sign you in. A client that takes a static header sends Authorization: Bearer and your key.

On your own machine, over stdio. The Python package runs locally with your key in its environment:

uvx agentbill-mcp
{
  "mcpServers": {
    "agentbill": {
      "command": "uvx",
      "args": ["agentbill-mcp"],
      "env": {
        "AGENTBILL_API_KEY": "agb_your_key_here"
      }
    }
  }
}

Put your key where agb_your_key_here is. Its record_event takes no task_ref, so a job's reservations are settled from code with the SDK or POST /events; the remote server's record_event takes task_ref and reservation_id and settles them itself.

What your agent can do

ToolWhat it doesScope
preflightAsks before a call whether the job and the customer have room left. approved: false comes back as the answer, with the reason and a sentence the model can act on. An approved call reserves its estimate against the job.meter
record_eventRecords what a call used. With the model and the token counts in its metadata, AgentBill prices it at list price. With the job's task_ref and the reservation_id preflight returned, it settles that reservation.meter
task_statusOne job: its ceiling, what it used and what is reserved, and its calls by model and by step.read
top_jobsYour jobs ranked by an estimate in dollars at public list price, or by what they used in their own unit.read
recent_refusalsThe calls refused on your account, the newest at the top, with the body each agent received.read

Dollar figures are estimates at public list price, labelled as estimates, for calls recorded with a model named. They are not your invoice. The assistant does not meter the tokens of your chat with it: a call is recorded only when a tool records it.

How it signs in

With a sign-in (OAuth). The app sends you to AgentBill, you sign in with Google, GitHub or an email link, and a page shows the app's name, where your browser goes next, and what it will be able to do. You press Allow or Deny. You can disconnect it any time in the console, under API keys. An account made with only an API key connects Google or GitHub there before it can approve an app.

With an API key. Clients that take a header send Authorization: Bearer and your key. The key's limits apply, and revoking the key disconnects the client.

No tool can create, show or revoke an API key, change your plan or billing, or change the ceiling of a job that exists.

The host decides

The model decides whether to call preflight and what to do with approved: false. The server never sees the host's own model requests, so it does not limit what the host itself spends. Tell the agent in its instructions to call preflight before expensive work, and what to do when the answer is no. When the calls are in code you own, the SDK puts preflight next to the model call instead.

Get API key →