Skip to content

Bring Your Own Key (BYOK)

Glassy's BYOK feature lets you connect your own AI provider API keys, so requests go to your provider account and you pay them directly.

How AI billing works in Glassy: On-device AI runs in your browser via WebGPU and is free forever on every plan — no key, no cost, nothing uploaded. Cloud AI has no included allowance on any plan: you either bring your own provider key (BYOK) or buy a pack of credits once. BYOK routes cloud requests through your provider account, so they bill you directly.

Supported providers

  • OpenAI: GPT-4o, GPT-4o mini
  • Anthropic: Claude 3.5 Sonnet, Claude 3 Haiku
  • Google: Gemini 2.0 Flash, Gemini 2.5 Pro

Setup

  1. Navigate to Settings → API Keys
  2. Select a provider and paste your API key
  3. Save the key to your Glassy instance, where it is encrypted at rest in the server database
  4. Select your preferred model from the dropdown — for Ollama, the list is fetched live from your instance (/api/tags, cached 30s), so it shows the models you actually have installed (beta.40+)

Security

  • API keys are encrypted at rest in the instance's database (user_providers) using the server-side API_KEY_ENCRYPTION_KEY; the saved credentials are not stored in browser local storage.
  • Validating a key shows the provider's error rather than an undefined-error toast (beta.40+).
  • The browser sends the key to your instance when you configure it. The instance decrypts it when authenticating requests to the selected provider; this is not a browser-to-provider-only connection.
  • On self-hosted installations, credential storage is on your own server. Provider requests still leave that server when you choose a remote provider. Keep the encryption key and database backups secure.

Feature flag

BYOK requires the ENABLE_BYOK feature flag to be enabled on your instance.

Learn more