Setting Up OpenAI Cost Tracking
OpenAI cost tracking requires an Admin API key with read-only permissions for usage and cost data.
Important: Admin Keys vs Project Keys
OpenAI has two types of API keys:
| Key Type | Prefix | Can Track Costs? |
|---|---|---|
| Project API Key | sk-proj-... |
No |
| Admin API Key | sk-admin-... |
Yes |
Project keys are scoped to a single project and cannot access organization-wide usage data. You need an Admin API key for cost tracking.
Step 1: Open Admin API Keys
- Go to OpenAI Admin API Keys
- Sign in with an account that has admin access to your organization
Step 2: Create an Admin API Key
- Click Create new admin key
- Enter a name (e.g., "Administrate Cost Tracking")
- Select permissions - for cost tracking, you need:
- Organization: Read - View organization info
- Usage: Read - View usage data
- Costs: Read - View cost data
- Projects: Read - List projects
- Click Create key
Important: Copy the key immediately - it won't be shown again.
Step 3: Find Your Organization ID (Optional)
If you have multiple organizations:
- Go to Organization Settings
- Copy the Organization ID (starts with
org-)
Step 4: Connect in Administrate
In Administrate, go to LLM Providers > Add Provider and enter:
| Field | Value |
|---|---|
| Provider Type | OpenAI |
| Name | Your preferred name |
| Admin API Key | The key from Step 2 |
| Organization ID | (Optional) From Step 3 |
What Gets Synced
Once connected, we'll automatically sync:
- Projects - All projects in your organization
- Usage - Daily token usage by model
- Costs - Daily costs by model and project
Data syncs every hour automatically.
Troubleshooting
"Project API keys cannot access organization data"
- You're using a Project key (starts with sk-proj-). Create an Admin key instead.
"API key lacks organization access" - The Admin key doesn't have the required permissions. Create a new key with Usage and Costs read access.
No cost data appearing - Cost data may take 24-48 hours to appear after API usage - Ensure your organization has actual API usage
Security Best Practices
- Create a dedicated Admin key just for cost tracking
- Only grant read permissions (never write)
- Rotate the key periodically
- Don't share the key or commit it to version control
Next Steps
- Tracking OpenAI Costs by Company - Set up per-company cost attribution