Byok Relay

Byok Relay is an open-source, self-hosted relay that lets frontend-only apps use the user's own OpenAI/Anthropic/Gemini keys without CORS issues.

Last verified:

Visit Byok Relay

What is Byok Relay?

Byok Relay is an open-source relay/gateway that enables developers to build AI applications where users can bring their own API keys from providers like OpenAI, Anthropic, and Gemini. It acts as a self-hosted proxy that allows frontend-only apps to communicate with LLM providers without hitting CORS issues, eliminating the need for a backend server to handle API keys.

Byok Relay solves the common problem of CORS restrictions when calling AI APIs directly from browsers. By relaying requests through a self-hosted instance, it allows users to plug in their own API keys while keeping them secure and never exposed to the application developer. This means developers don't have to pay for inference costs - users pay their own providers directly.

Key features include support for multiple AI providers (OpenAI, Anthropic, Gemini), no CORS issues, no exposed API keys, self-hosted deployment, and being completely open-source. Byok Relay serves as an open-source alternative to services like OpenRouter and LiteLLM but with the unique benefit of allowing end users to use their own keys.

Byok Relay is designed for indie developers, indie hackers, and teams building AI-powered applications who want to offer BYOK (Bring Your Own Key) functionality to their users. It's particularly useful for lightweight frontend-only apps that need to integrate LLM capabilities without maintaining backend infrastructure for API key management.

Byok Relay pricing

Pricing model: Freemium

Completely free and open-source. The tool itself has no pricing - it's self-hosted so you only pay for your own hosting infrastructure. Users pay their own API costs directly to OpenAI, Anthropic, or Gemini based on their usage. No free tier, paid plans, or subscription fees for the relay software itself.

Byok Relay pros

  • Open-source and free to self-host
  • Eliminates CORS issues for frontend AI apps
  • Users bring their own API keys - no inference bill for developers
  • No backend server required for API key management
  • Supports multiple providers: OpenAI, Anthropic, Gemini
  • API keys never exposed to application developer
  • Lightweight and easy to deploy
  • Perfect for indie hackers building AI apps
  • Users control their own AI spending
  • Privacy-friendly - keys stay with users
  • Alternative to paid services like OpenRouter and LiteLLM
  • Enables truly frontend-only AI applications
  • Simple setup process
  • Active development by ex-Microsoft engineer
  • 44 GitHub stars showing community interest

Byok Relay cons

  • Requires self-hosting infrastructure
  • Users must have their own API keys from providers
  • New project with limited documentation compared to established tools
  • Only 44 GitHub stars - smaller community
  • Limited to major providers (OpenAI, Anthropic, Gemini)
  • Users need to manage their own API spending
  • May have bugs as it's still early stage
  • No official hosted version available

Frequently asked questions about Byok Relay

What is byok-relay?

byok-relay is an open-source gateway/relay that lets developers build AI applications where users can bring their own API keys from providers like OpenAI, Anthropic, and Gemini. It acts as a self-hosted proxy that eliminates CORS issues when calling AI APIs from frontend applications.

How does byok-relay work?

It works as a self-hosted proxy that relays requests from your frontend app to AI providers. Users input their own API keys into your app, and byok-relay forwards their requests to the AI provider without exposing the keys to you as the developer. This bypasses CORS restrictions that normally prevent browser-based apps from calling AI APIs directly.

Which AI providers does byok-relay support?

byok-relay currently supports OpenAI, Anthropic, and Gemini API keys. Users can plug in their own keys from any of these three major AI providers.

Do I need a backend server to use byok-relay?

No, that's the whole point. byok-relay enables lightweight frontend-only apps to use LLMs. You still need to self-host the relay itself, but your main application can be purely frontend without backend infrastructure for API key management.

Who pays for the AI API calls?

Users pay for their own API calls directly to their chosen provider (OpenAI, Anthropic, or Gemini). As the developer, you don't pay any inference bill since users are using their own API keys.

Is byok-relay secure?

Yes, API keys are never exposed to you as the developer. Users enter their own keys into your application, and byok-relay relays requests without storing or exposing those keys. The keys remain under user control.

Does byok-relay have CORS issues?

No, byok-relay was specifically built to eliminate CORS issues. That's one of its main features - it allows frontend apps to call AI APIs without hitting CORS restrictions that normally block browser-based requests.

Is byok-relay free?

Yes, byok-relay is completely free and open-source. You only pay for your own self-hosting infrastructure. There are no subscription fees, paid plans, or usage charges for the relay software itself.

How is byok-relay different from OpenRouter or LiteLLM?

byok-relay is an open-source alternative to OpenRouter and LiteLLM, but with a key difference: it lets your end users bring their own API keys instead of you managing keys on their behalf. OpenRouter and LiteLLM typically require you to handle API billing, while byok-relay puts users in control of their own keys and spending.

Who should use byok-relay?

byok-relay is perfect for indie developers, indie hackers, and teams building AI-powered applications who want to offer BYOK functionality to users. It's ideal for those building frontend-only AI apps, those who don't want to pay inference costs, and those who prioritize user privacy and key control.

Categories

Use cases

Browse all AI tools on NeedAnAI