diegosouzapw/OmniRoute · error

Cursor access token is required for AvailableModels

Error message

Cursor access token is required for AvailableModels

What it means

Error "Cursor access token is required for AvailableModels" thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/lib/providerModels/cursorAvailableModels.ts:148

  for (const id of CURSOR_AUTO_ROUTER_VARIANT_IDS) {
    if (byId.has(id)) continue;
    const entry: CursorAgentModelEntry = {
      id,
      name: CURSOR_AUTO_ROUTER_VARIANT_NAMES[id],
      owned_by: "cursor",
    };
    out.push(entry);
    byId.set(id, entry);
  }

  return out;
}

export async function fetchCursorAvailableModels(
  options: FetchCursorAvailableModelsOptions
): Promise<CursorAgentModelEntry[]> {
  const { accessToken, signal } = options;
  if (!accessToken) throw new Error("Cursor access token is required for AvailableModels");

  const machineId = options.machineId || (await getConsistentMachineId());
  const cursorService = new CursorService();
  const headers = {
    ...cursorService.buildHeaders(accessToken, machineId),
    // Prefer Connect JSON so we can parse without a protobuf schema
    "Content-Type": "application/json",
    Accept: "application/json",
  };

  const url = `${CURSOR_CONFIG.apiEndpoint}${CURSOR_CONFIG.modelsEndpoint}`;
  const fetchImpl = options.fetchImpl || fetch;
  const response = await fetchImpl(url, {
    method: "POST",
    headers,
    body: "{}",
    signal,
  });

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/lib/providerModels/cursorAvailableModels.ts:148 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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