{"record":{"id":"b37fdd4aeafbd8cb","repo":"musistudio/claude-code-router","slug":"gateway-exa-web-search-api-key-is-not-configured","errorCode":null,"errorMessage":"[gateway] Exa web search API key is not configured.","messagePattern":"\\[gateway\\] Exa web search API key is not configured\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/core/src/gateway/features/hosted-web-search/discovery.ts","lineNumber":649,"sourceCode":"  const raw = await fetchJson(searchEnv(input, \"TAVILY_SEARCH_ENDPOINT\") || \"https://api.tavily.com/search\", {\n    body: JSON.stringify({\n      api_key: apiKey,\n      max_results: input.count,\n      query: input.query,\n      search_depth: \"basic\"\n    }),\n    headers: { \"content-type\": \"application/json\" },\n    method: \"POST\",\n    signal: AbortSignal.timeout(input.timeoutMs)\n  });\n  const items = isRecord(raw) && Array.isArray(raw.results) ? raw.results : [];\n  return items.map((item) => webSearchResult(item, \"title\", \"url\", \"content\")).filter(isWebSearchProviderResult);\n}\n\nasync function searchExa(input: WebSearchProviderInput): Promise<WebSearchProviderResult[]> {\n  const apiKey = searchEnv(input, \"EXA_API_KEY\");\n  if (!apiKey) {\n    console.warn(\"[gateway] Exa web search API key is not configured.\");\n    return [];\n  }\n  const raw = await fetchJson(searchEnv(input, \"EXA_SEARCH_ENDPOINT\") || \"https://api.exa.ai/search\", {\n    body: JSON.stringify({\n      numResults: input.count,\n      query: input.query\n    }),\n    headers: {\n      authorization: `Bearer ${apiKey}`,\n      \"content-type\": \"application/json\"\n    },\n    method: \"POST\",\n    signal: AbortSignal.timeout(input.timeoutMs)\n  });\n  const items = isRecord(raw) && Array.isArray(raw.results) ? raw.results : [];\n  return items.map((item) => webSearchResult(item, \"title\", \"url\", \"text\")).filter(isWebSearchProviderResult);\n}\n","sourceCodeStart":631,"sourceCodeEnd":667,"githubUrl":"https://github.com/musistudio/claude-code-router/blob/99f24806c6a2c660b16e53e95211c517448a6c90/packages/core/src/gateway/features/hosted-web-search/discovery.ts#L631-L667","documentation":"The Exa.ai web search provider was selected, but EXA_API_KEY is not configured in the resolved environment. The provider returns empty results, so search-backed features degrade to no results without failing.","triggerScenarios":"Configuring web search provider to \"exa\" without EXA_API_KEY; key set in CI secrets but not in the runtime deployment.","commonSituations":"Key from exa.ai dashboard never exported; container missing env; gateway service restarted without the secret.","solutions":["Set EXA_API_KEY in the gateway's environment","Verify the key with a direct curl to https://api.exa.ai/search","Restart the gateway"],"exampleFix":"# before\nWEB_SEARCH_PROVIDER=exa\n\n# after\nEXA_API_KEY=<exa-key>\nWEB_SEARCH_PROVIDER=exa","handlingStrategy":"validation","validationCode":"if (!process.env.EXA_API_KEY) throw new Error(\"EXA_API_KEY required for exa provider\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate keys at startup","Keep provider key config in one audited place","Dry-run the provider with a one-off query after setup"],"tags":["web-search","exa","env-var","api-key"],"backgroundTag":"missing-env-var","analyzedSha":"99f24806c6a2c660b16e53e95211c517448a6c90","analyzedAt":"2026-08-27T04:11:01.184Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}