diegosouzapw/OmniRoute · error

AUTH_002

AUTH_002

Error message

Invalid API key

What it means

ERROR_CODES catalog entry AUTH_002: credentials were presented but the API key is not recognized (unknown, revoked, or mistyped), mapped to HTTP 401. It is the canonical definition consumed by auth helpers when key lookup fails — a sentinel definition, not a runtime throw site.

Solutions

  1. Verify the API key matches one listed in the dashboard
  2. Recreate the key if it was revoked or rotated
  3. Check for whitespace/truncation when copying the key into the client
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/shared/constants/errorCodes.ts:35 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/a2551d14c7d94336. Report an issue: GitHub.

Appendix: source

Thrown at src/shared/constants/errorCodes.ts:35

  httpStatus: number;
  category: string;
}

interface ErrorDetails {
  detail?: string;
  requestId?: string;
  retryAfter?: number;
}

export const ERROR_CODES: Record<string, ErrorCodeDef> = {
  // ── Auth ──
  AUTH_001: {
    code: "AUTH_001",
    message: "Authentication required",
    httpStatus: 401,
    category: "AUTH",
  },
  AUTH_002: { code: "AUTH_002", message: "Invalid API key", httpStatus: 401, category: "AUTH" },
  AUTH_003: { code: "AUTH_003", message: "API key expired", httpStatus: 401, category: "AUTH" },
  AUTH_004: {
    code: "AUTH_004",
    message: "Insufficient permissions",
    httpStatus: 403,
    category: "AUTH",
  },
  AUTH_005: { code: "AUTH_005", message: "Account locked", httpStatus: 423, category: "AUTH" },
  AUTH_006: {
    code: "AUTH_006",
    message: "No credentials for provider",
    httpStatus: 400,
    category: "AUTH",
  },
  AUTH_007: {
    code: "AUTH_007",
    message: "Session expired (re-login required)",
    httpStatus: 401,

View on GitHub (pinned to a179ffed5b)