← All docs
Quickstart
npm install to a working connect box in five minutes. Your user brings the AI account; you never store a key.
Have a Vault invite? Paste this into your AI.
Your AI adds the Connect your AI button for you. Your invite brings the app id.
Add Outlet to this app so users can connect their own AI account. Read https://useoutlet.dev/llms-full.txt first. Install: npm install @useoutlet/sdk App id: <from your invite> Return address: <the https or private-scheme return address> Local testing: http://localhost/outlet/return, any port Flow: public client. Outlet.connectRedirect on the button, Outlet.handleRedirect on the return page. No app secret in the app. Provider: choose openai or anthropic. Send exactly one provider per connection request. Button: "Connect your AI", where a user would add an AI today. After connect: call the provider with its official SDK using session.keys.<provider>.
1
Install
Zero dependencies. TypeScript types included.
# free in direct mode, forever
npm install @useoutlet/sdk
2
Add a connect box
Your user pastes their own API key. The SDK validates it on their device: wrong-provider keys get a helpful hint, admin keys are refused. Nothing is sent to Outlet or anyone else.
import Outlet from "@useoutlet/sdk";
const session = await Outlet.direct({
keys: { openai: userPastedKey },
});
3
Call the provider like you already do
The session hands you the key back. Use the official SDK; Outlet is never in your data path.
npm install openai
import OpenAI from "openai"; const ai = new OpenAI({ apiKey: session.keys.openai, dangerouslyAllowBrowser: true, // their key, their device. Drop this line in Node. }); const reply = await ai.responses.create({ model: "gpt-5.5", input: "Say hello.", }); console.log(reply.output_text);
4
Keep the key on the device
Direct is free forever because it costs nothing: no server, no storage, no risk. Keep it that way. Hold the key in memory on the user's device, never in your database, never on your server.
In the Vault, by invite, the connect box becomes a
Connect your AI button and the same session shape carries a capped App key,
scoped to your app inside the user's own account, revocable any time.
Same session, both modes. The protocol is public.