How Direct to Provider works
Data flow
- 1Developer runs code or an agent with a vendor SDK on a laptop, a local or cloud VM, or a dev container.
- 2A static API key is read from a .env file, a shell variable or a Codespaces secret. EDR on the machine is the main defense against infostealers that harvest these files.
- 3Prompts, code and context go straight to each provider over the public internet.
- 4Only per-vendor usage and billing is visible. There is no central prompt log, and per-user attribution needs per-user keys.
Build or buy
Mostly buyWhat you can buy for each box in the diagram, the open source option, and the part you still build yourself.
| Component | Buy | Open source | You build | Maturity |
|---|---|---|---|---|
| Developer (IDE, CLI, scripts) | Claude Code with a Claude Team or Enterprise seat; Codex with a ChatGPT Business or Enterprise seat, signed in through SSO | · | · | GA |
| Dev machine | Your existing laptops, VMs or dev containers, with EDR such as CrowdStrike or SentinelOne | · | EDR alerts on access to .env files and credential stores, routed to your MDR | GA |
| Secrets (.env / env vars) | 1Password Business (op run); cloud secrets managers; GitHub Secret Protection push protection | gitleaks, trufflehog | Key inventory and expiry report built on both Admin APIs | GA |
| OpenAI API | Projects, project keys with expiry, service accounts, workload identity federation, org and project hard spend limits | · | Rotation script; new keys come only from creating service accounts | GA |
| Anthropic API | Console workspaces with spend and rate limits, key expiry, personal and service-account keys, workload identity federation | · | Manual rotation runbook; the Admin API can't create keys | GA |
| Vendor consoles (usage) | OpenAI Usage and Costs API; Anthropic Usage and Cost API; Anthropic Compliance Activity Feed for admin events | · | Optional monthly cost-by-key export for chargeback | GA |
Rollout steps
| # | Step | Who | Effort |
|---|---|---|---|
| 1 | Inventory every existing key in both consoles and review GitHub secret scanning alerts | Platform engineer | 0.5 day to 2 weeks |
| 2 | Create one OpenAI project or Anthropic workspace per app and environment | Platform engineer | 0.5 to 5 days |
| 3 | Set a hard monthly spend limit and an alert at 50 to 80 percent on each project and workspace | Platform engineer | 0.5 to 2 days |
| 4 | Reissue keys with an expiry date: personal keys for people, service-account keys for apps, then revoke the old keys | Platform engineer | 1 day to 2 weeks |
| 5 | Move remaining keys into a password manager or secrets manager and turn on push protection | Platform engineer | 1 to 5 days |
| 6 | Switch CI and cloud workloads to workload identity federation so they hold no static key | Platform engineer | 3 to 10 days |
| 7 | Have developers sign in to Claude Code or Codex with their SSO seat instead of a personal API key | Platform engineer | 1 to 3 days |
What you still build
- A key inventory and expiry report built on the OpenAI and Anthropic Admin APIs
- A rotation runbook: Anthropic keys are created by hand in the Console, and OpenAI keys come from service accounts
- Optional chargeback export from the Usage and Cost APIs into a sheet or BI tool
Gotchas
- Neither vendor lets you cap spend per key. Caps apply per OpenAI project or Anthropic workspace, plus at org level.
- Hard limits don't apply instantly, so recorded spend can run slightly past the cap.
- Neither vendor rotates keys for you. Set expiry dates and use federation instead.
- Anthropic's Admin API can read, rename and disable keys but can't create them.
- Per-user cost attribution only works with per-user keys. A shared project key hides who spent what.
- Neither vendor keeps a central log of prompt content. The consoles show usage and cost only.
- A password manager CLI keeps the key off disk, but the key itself stays long-lived until it expires.
Common use cases
- Prototypes and spikes
- Individual dev productivity
- Hackathons and demos
Key risks
- Keys copied across projects and laptops
- No inspection of what data leaves
- Shared keys hide who spent what
- Spend caps only per project or workspace, not per key
Fast path
- KEEPSpend cap on every project or workspace
- SIMPLIFYKeys that expire, one project per app
- SIMPLIFYDevelopers sign in to Claude Code or Codex with their SSO seat, no key
- SIMPLIFYKeys in a password manager CLI such as 1Password, not .env files
- DEFEREverything else. This is already the fast path.