Lightweight protocol for secure, user-controlled AI API key delegation
Every app asks you to paste your API key. Keys end up scattered across dozens of apps with no visibility or control.
Your keys stay in one vault. Apps request scoped tokens. Revoke any app instantly without rotating your key.
Structured authorization flow using RAR-inspired patterns
# App requests access from user's vault from okap import OkapClient client = OkapClient("https://vault.okap.dev") token = client.request_access(provider="openai", models=["gpt-4"]) # Use with OpenAI SDK - key never leaves the vault ai = OpenAI(api_key=token.key, base_url=token.base_url)
Uses typed JSON objects, not scope strings. Inspired by RFC 9396.
Vault proxies requests, injecting keys and enforcing limits.
Request access to multiple AI providers in single authorization.
Yes. Apps implement the OKAP client instead of asking for raw keys. The more apps adopt it, the more useful it becomes.
Not yet. Those apps would need to add OKAP support. We're building the protocol so they can adopt it.
OpenAI, Anthropic, and Google. The protocol is provider-agnostic, so adding more is straightforward.
Keys are stored in Cloudflare KV (encrypted at rest), accessed only via authenticated sessions. They're never logged or exposed in responses.
Your keys stay encrypted. Apps only receive scoped tokens-never your actual keys. You can set spend limits and revoke any app's access instantly.
No. Each user's requests use their own API key. Rate limits apply to your key, not OKAP.
The vault runs on Cloudflare's global edge network with automatic failover. Apps with valid tokens continue working. New token requests would fail until restored.
| OKAP | .env files | Secrets Managers | |
|---|---|---|---|
| Scoped access | ✓ | ✗ | ✗ |
| Per-app revocation | ✓ | ✗ | ✗ |
| Spend limits | ✓ | ✗ | ✗ |
| No infra needed | ✓ | ✓ | ✗ |
| AI-provider aware | ✓ | ✗ | ✗ |
OpenRouter is great! But it's a different model. With OpenRouter, you use their unified key-they manage provider access. With OKAP, you keep your own keys (for enterprise contracts, credits, or full control) and delegate scoped access to apps.
Yes, for teams/orgs who want their own infrastructure. Deploy the reference server or Cloudflare Worker to a public URL.