Prince Caleb.dev
Let’s Build
Custom solution/ 2026

Switchboard

Switchboard is a bring-your-own-key chat interface built with Next.js and Supabase to let users talk to OpenAI, Anthropic, Google, and OpenRouter from one thread, using their own API keys instead of a marked-up reseller relationship. The app streams completions across providers, lets users switch models mid-conversation, and encrypts stored keys end-to-end so they're never exposed to the client or logged.

Switchboard
//01Engineering record

Switchboard needed to solve a trust problem as much as a technical one: most multi-model chat products route requests through a reseller, adding markup and an extra party that sees your prompts. The goal was to build an interface where users bring their own provider keys and get a genuinely unified chat experience, with no markup and no shared credit pool sitting between them and OpenAI, Anthropic, Google, or OpenRouter.

I built the frontend with Next.js 16's App Router and Turbopack, splitting the app into marketing, auth, and authenticated route groups so the public site, sign-up flow, and chat dashboard stay cleanly separated. For the model layer, I used the Vercel AI SDK to abstract streaming completions across providers, routing OpenRouter through the same OpenAI-compatible adapter so adding a fourth provider meant a routing change rather than a new integration. Supabase handles auth and storage, with row-level security scoped to each user's ID so access control is enforced at the database layer, not just in application code.

The part I cared most about getting right was the key-handling story. API keys are encrypted with AES-256-GCM before they're stored, and only ever decrypted server-side for the instant a request goes out to a provider — never sent to the client, never logged. The admin view follows the same logic in reverse: it's gated behind a signed-in, allowlisted check before it ever constructs a service-role client, and even then it deliberately shows no conversation content or titles, so the app's privacy promise holds for every account, including admin ones.

Phase 1 was about proving the BYOK model end-to-end: real streaming chat, real encryption, real provider switching, no shortcuts on the security model. A managed-credits tier — where Switchboard itself holds a provider relationship, likely through OpenRouter — is scoped as a possible Phase 2, but Phase 1's no-markup promise stays intact until that's built and opted into deliberately.

Want something like this
built for you?