Tracking OpenRouter Costs by Company
OpenRouter's API key model is ideal for per-company cost tracking. Each API key is tracked separately, making it easy to attribute costs.
How It Works
OpenRouter treats each API key as a project. When you create multiple keys:
- Each key has its own usage tracking
- Costs are reported per key
- You can set credit limits per key
Administrate.dev shows each key as a "project" that you can assign to a company.
Best Practice: One Key Per Company
For accurate cost tracking:
- Create an API key in OpenRouter for each company
- Name the key after the company (e.g., "acme-production")
- Connect OpenRouter to Administrate.dev (see Setting Up OpenRouter)
- Assign each key to the corresponding company
Setting Up Company Tracking
Step 1: Create API Keys in OpenRouter
- Go to OpenRouter API Keys
- Click Create Key
- Name it after the company (e.g., "acme-corp-production")
- Set a credit limit if desired (optional but recommended)
- Click Create
- Repeat for each company
Tip: Set credit limits to prevent runaway costs. You can always increase them later.
Step 2: Connect to Administrate.dev
- Go to LLM Providers
- Click Add Provider
- Select OpenRouter
- Enter any of your OpenRouter keys (it will discover all keys)
- Click Connect Provider
Step 3: Assign Keys to Companies
- Click your OpenRouter provider
- In the Projects section, you'll see all your API keys
- Click the company dropdown for each key
- Select the appropriate company
Understanding OpenRouter Costs
OpenRouter reports costs in rolling windows:
| Date Range Selected | Cost Shown |
|---|---|
| 1 day | Daily rolling (last 24h) |
| 2-7 days | Weekly rolling (last 7 days) |
| 8+ days | Monthly rolling (last 30 days) |
Lifetime costs show all-time spending per key.
Setting Credit Limits
Protect against unexpected costs:
- In OpenRouter, edit each API key
- Set a Credit Limit (e.g., $100/month)
- Keys stop working when the limit is reached
This acts as a safeguard even before Administrate.dev budget alerts trigger.