Documentation

Everything you need to integrate 1Relay into your app.

Quick start

Get up and running in 5 minutes. 1Relay lets your users bring their own AI keys to your app, with zero-knowledge encryption and per-app budget controls.

  1. Create an account at 1relay.dev and register your app to get a client_id and client_secret.
  2. Install the SDKs:
Terminal
npm install @1relay/node-sdk @1relay/link-sdk
  1. Create a Link session from your server, then open 1Relay Link in the browser.
  2. Exchange the public token for an access token, then make AI calls through the proxy.

Node SDK (Server)

The Node SDK handles session creation, token exchange, and proxied AI calls from your server.

TypeScript (Server)
import { OneRelayClient } from '@1relay/node-sdk'; const client = new OneRelayClient({ clientId: '1r_cid_...', clientSecret: '1r_cs_...', baseUrl: 'https://1relay-api.omerbese.workers.dev', }); // 1. Create a link session const session = await client.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 client.exchangePublicToken(publicToken); // 3. Make AI calls through 1Relay const response = await client.chatCompletion({ accessToken, provider: 'openai', model: 'gpt-4o', messages: [{ role: 'user', content: 'Hello!' }], });

Chrome extension

The 1Relay Chrome extension provides a key vault popup, auto-detects API keys on provider pages, and can proxy AI requests transparently.

Features

  • check_circleKey vault popup — Log in, view, add, and delete API keys from any tab.
  • check_circleAuto-detect — Detects API keys on OpenAI, Anthropic, Google, and Groq key pages. One-click save.
  • check_circleProxy intercept — Transparently routes AI API calls through 1Relay so your keys never touch the page.

API reference

The 1Relay API is hosted at https://1relay-api.omerbese.workers.dev. All endpoints return JSON with the shape { success, data?, error? }.

POST/v1/auth/register
POST/v1/auth/login
GET/v1/keys
POST/v1/keys
DELETE/v1/keys/:provider
POST/v1/apps
GET/v1/apps
POST/v1/link/sessions
POST/v1/link/authorize
POST/v1/link/exchange
POST/v1/proxy/chat/completions
POST/v1/proxy/passthrough/:provider/*
GET/v1/connections
DELETE/v1/connections/:id
GET/v1/usage