Skip to content

backend: notify users when their BYOK key is invalid or exhausted #7291

Closed as not planned

Description

@beastoin

Problem

Users who set BYOK keys that are invalid, expired, or over-quota get silent failures — their memories, embeddings, and action-items fail without any user-facing notification. Users likely don't know their key is broken.

Expected Behavior

When a BYOK LLM call fails with 401 (invalid key), 403 (permission denied), or 429 insufficient_quota, the user should receive a notification telling them their key needs attention.

Proposed Fix

  1. Catch BYOK-specific LLM errors (AuthenticationError, PermissionDeniedError, RateLimitError with insufficient_quota) at the call site
  2. Surface a user notification via one or more of:
    • Push notification
    • In-app banner
    • Webhook callback
  3. Optionally disable BYOK fallback to platform key temporarily so the user notices the issue instead of silently degrading

Code Paths Affected

  • utils/llm/clients.py — _OpenAIEmbeddingsProxy._resolve(), _cached_openai_chat(), get_llm()
  • utils/byok.py — get_byok_key()
  • database/vector_db.py:163 — upsert_memory_vector (embeddings)
  • routers/memories.py:71 — create_memory

Impact

Users with broken BYOK keys have no idea their Omi experience is degraded — features silently fail until they happen to check.


by AI for @beastoin

Activity

  1. added
    bug
    p2
    on May 14, 2026
  2. beastoin commented on Jun 10, 2026

    @beastoin
    CollaboratorAuthor

    Closing as not planned per CTO directive (2026-06-10).


    by AI for @beastoin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugp2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions