Setting Up OpenRouter Cost Tracking
OpenRouter provides access to multiple AI models through a single API. Cost tracking shows usage across all models you access through OpenRouter.
How OpenRouter Differs
Unlike direct provider integrations:
- One API, many models - Access GPT-4, Claude, Llama, and more
- Per-key tracking - Each API key is treated as a "project"
- Unified billing - All costs go through OpenRouter
Step 1: Create an API Key
- Go to OpenRouter API Keys
- Click Create Key
- Enter a name (e.g., "Company A Production")
- Set a credit limit if desired
- Click Create
Tip: Create separate API keys for each company to track costs accurately.
Step 2: Connect in Administrate
In Administrate, go to LLM Providers > Add Provider and enter:
| Field | Value |
|---|---|
| Provider Type | OpenRouter |
| Name | Your preferred name |
| API Key | The key from Step 1 |
What Gets Synced
Once connected, we'll automatically sync:
- API Keys - Each key appears as a "project"
- Usage - Token usage by model per key
- Costs - Rolling daily/weekly/monthly costs per key
Data syncs every hour automatically.
Per-Key Cost Attribution
OpenRouter's unique model: each API key = one project.
This means you can:
- Create one API key per company
- Connect your OpenRouter account to Administrate
- Assign each "project" (key) to a company
- See per-company costs automatically
Understanding OpenRouter Costs
OpenRouter shows costs in rolling windows:
| Period | Description |
|---|---|
| Daily | Last 24 hours |
| Weekly | Last 7 days |
| Monthly | Last 30 days |
The period shown depends on your selected date range in Administrate.
Troubleshooting
"Invalid API key" error - Verify the key is correct and hasn't been revoked - Check that you have credits on your OpenRouter account
Keys not appearing as projects - New keys may take a few minutes to appear - Click "Sync Now" to force an update
Costs showing as $0 - OpenRouter reports costs for actual usage only - New keys with no usage will show $0
Security Best Practices
- Create separate API keys for each company or use case
- Set credit limits on keys to prevent runaway costs
- Rotate keys periodically
- Revoke unused keys promptly
Next Steps
- Tracking OpenRouter Costs by Company - Set up per-company cost attribution