> ## 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 OpenAI

> Track OpenAI API costs with token-level granularity

# Connect OpenAI

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

## Prerequisites

* An OpenAI account with API access
* An API key

## Setup

1. Go to **Settings > Connections > New Connection > OpenAI**
2. Paste your **OpenAI 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 (GPT-4o, GPT-4, GPT-3.5, etc.)
* Token counts (input and output) per model
* Cost-per-token trends over time

## Subscription plan (optional)

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

Available plans:

| Plan       | Monthly cost    | Seat-based |
| ---------- | --------------- | ---------- |
| Free       | \$0             | No         |
| Plus       | \$20/month      | No         |
| Pro        | \$200/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 OpenAI provider detail page.

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

## Tips

* **Separate API keys per project** to get per-project cost breakdown
* oncost shows cost-per-token trends in the AI Cost view under Spend
