# Anthropic Billing — how to use (mcp.ai)

Anthropic organization usage and cost reporting through an admin API key connected by the user.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_anthropic_billing?ms=1788959160000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `anthropic_billing_cost`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/anthropic_billing`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/anthropic_billing/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/anthropic_billing/cost` — Get normalized Anthropic cost report for a date range. Returns compact totals and daily costs.
  - body: { days_back?: integer, start_date?: string, end_date?: string, group_by?: string, bucket_width?: string, account?: string }
- `POST https://api.mcp.ai/api/anthropic_billing/list/accounts` — List Anthropic Billing admin API connections linked to this install.
  - body: { account?: string }
- `POST https://api.mcp.ai/api/anthropic_billing/usage` — Get normalized Anthropic Messages API usage for a date range. The adapter drains report pagination internally.
  - body: { days_back?: integer, start_date?: string, end_date?: string, group_by?: string, bucket_width?: string, account?: string }

## Example prompts
- "Show Anthropic usage for the last 30 days"
- "What did Anthropic cost this month?"
- "Break down Anthropic message tokens by day"

## More
- Page: https://mcp.ai/anthropic_billing
- Agent spec (llms.txt): https://mcp.ai/anthropic_billing/llms.txt
- Postman collection: https://mcp.ai/anthropic_billing/postman.json
