Documentation
Everything you need to integrate KeyPass into your app.
Quick start
Get up and running in 5 minutes. KeyPass lets your users bring their own AI keys to your app, with zero-knowledge encryption and per-app budget controls.
- Create an account at keypass.dev and register your app to get a
client_idandclient_secret. - Install the SDKs:
Terminal
npm install @keypass/node-sdk @keypass/link-sdk- Create a Link session from your server, then open KeyPass Link in the browser.
- Exchange the public token for an access token, then make AI calls through the proxy.
Link SDK (Browser)
The Link SDK opens a modal where your users authorize your app to use their AI keys. It handles authentication, provider selection, and budget approval.
JavaScript (Browser)
import { KeyPass } from '@keypass/link-sdk';
const handler = KeyPass.create({
token: linkToken, // from your server
apiBaseUrl: 'https://keypass-api.omerbese.workers.dev',
onSuccess: ({ publicToken }) => {
// Send publicToken to your server to exchange
fetch('/api/keypass/exchange', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ publicToken }),
});
},
onExit: (error) => {
if (error) console.error('KeyPass Link error:', error);
},
});
handler.open();Node SDK (Server)
The Node SDK handles session creation, token exchange, and proxied AI calls from your server.
TypeScript (Server)
import { KeyPassClient } from '@keypass/node-sdk';
const kp = new KeyPassClient({
clientId: 'kp_cid_...',
clientSecret: 'kp_cs_...',
baseUrl: 'https://keypass-api.omerbese.workers.dev',
});
// 1. Create a link session
const session = await kp.createLinkSession({
requestedProviders: ['openai', 'anthropic'],
budgetSuggestionCents: 1000, // $10/month suggestion
});
// Return session.linkToken to your frontend
// 2. Exchange public token for access token
const { accessToken } = await kp.exchangePublicToken(publicToken);
// 3. Make AI calls through KeyPass
const response = await kp.chatCompletion({
accessToken,
provider: 'openai',
model: 'gpt-4o',
messages: [{ role: 'user', content: 'Hello!' }],
});Chrome extension
The KeyPass Chrome extension provides a key vault popup, auto-detects API keys on provider pages, and can proxy AI requests transparently.
Features
- ✓Key vault popup — Log in, view, add, and delete API keys from any tab.
- ✓Auto-detect — Detects API keys on OpenAI, Anthropic, Google, and Groq key pages. One-click save.
- ✓Proxy intercept — Transparently routes AI API calls through KeyPass so your keys never touch the page.
API reference
The KeyPass API is hosted at https://keypass-api.omerbese.workers.dev. All endpoints return JSON with the shape { success, data?, error? }.
POST
/v1/auth/registerPOST
/v1/auth/loginGET
/v1/keysPOST
/v1/keysDELETE
/v1/keys/:providerPOST
/v1/appsGET
/v1/appsPOST
/v1/link/sessionsPOST
/v1/link/authorizePOST
/v1/link/exchangePOST
/v1/proxy/chat/completionsPOST
/v1/proxy/passthrough/:provider/*GET
/v1/connectionsDELETE
/v1/connections/:idGET
/v1/usage