> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oncost.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Anthropic

> Track Anthropic API costs with token-level granularity

# Connect Anthropic

oncost tracks your Anthropic API usage at the model and token level. Setup takes about 2 minutes.

## Prerequisites

* An Anthropic account with API access
* An API key with usage read permissions

## Setup

1. Go to **Settings > Connections > New Connection > Anthropic**
2. Paste your **Anthropic API key**
3. Click **Test Connection** to verify access
4. Click **Save**

oncost collects usage data within minutes.

## What oncost collects

* Daily cost by model (Claude Opus, Sonnet, Haiku, etc.)
* Token counts (input and output) per model
* Cost-per-token trends over time

## Subscription plan (optional)

After connecting, you can configure your Anthropic subscription plan so oncost tracks subscription costs alongside API usage. Go to **Settings > Connections**, click your Anthropic connection, and fill in the **Subscription Plan** section.

Available plans:

| Plan       | Monthly cost    | Seat-based |
| ---------- | --------------- | ---------- |
| Free       | \$0             | No         |
| Pro        | \$20/month      | No         |
| Team       | \$25/seat/month | Yes        |
| Enterprise | Custom          | Yes        |

For **Team** and **Enterprise** plans, enter the number of seats. For **Enterprise**, enter your custom monthly cost.

When configured, oncost generates a subscription cost row each month and shows the full picture -- subscription cost plus API usage -- on the Anthropic provider detail page.

This step is optional. If you skip it, oncost still tracks all API usage costs.

## Tips

* **Separate API keys per environment** (dev, staging, prod) to get per-environment cost breakdown
* **Separate keys per team** to enable tag-based cost attribution
* oncost shows cost-per-token trends in the AI Cost view under Spend
