{"record":{"id":"86c4628e38057d51","repo":"can1357/oh-my-pi","slug":"parallel-credentials-not-found-set-parallel-api-k-86c462","errorCode":null,"errorMessage":"Parallel credentials not found. Set PARALLEL_API_KEY or login with 'omp /login parallel'.","messagePattern":"Parallel credentials not found\\. Set PARALLEL_API_KEY or login with 'omp /login parallel'\\.","errorType":"exception","errorClass":"ParallelApiError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/web/search/providers/parallel.ts","lineNumber":83,"sourceCode":"\t}\n\treturn policy.include_domains || policy.exclude_domains || policy.after_date ? policy : undefined;\n}\n\nasync function searchWithAuthStorage(\n\tobjective: string,\n\tqueries: string[],\n\tparams: {\n\t\tsignal?: AbortSignal;\n\t\ttimeoutMs?: number;\n\t\tfetch?: FetchImpl;\n\t},\n\tauthStorage: AuthStorage,\n\tsessionId?: string,\n\tsourcePolicy?: ParallelSourcePolicy,\n): Promise<ParallelSearchResult> {\n\tconst apiKey = await authStorage.getApiKey(\"parallel\", sessionId, { signal: params.signal });\n\tif (!apiKey) {\n\t\tthrow new ParallelApiError(\n\t\t\t\"Parallel credentials not found. Set PARALLEL_API_KEY or login with 'omp /login parallel'.\",\n\t\t);\n\t}\n\n\t// Drive the (already-present) credential through the central force-refresh /\n\t// sibling-rotate retry policy. The `ParallelApiError` thrown below carries a\n\t// `statusCode`, which `withAuth`'s default classifier reads to detect a\n\t// retryable 401 / usage-limit.\n\tconst keyOrResolver: ApiKey = authStorage.resolver(\"parallel\", { sessionId });\n\treturn withAuth(\n\t\tkeyOrResolver,\n\t\tasync key => {\n\t\t\tconst response = await (params.fetch ?? fetch)(PARALLEL_SEARCH_URL, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: {\n\t\t\t\t\tAccept: \"application/json\",\n\t\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\t\t\"x-api-key\": key,","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/web/search/providers/parallel.ts#L65-L101","documentation":"Thrown by searchWithAuthStorage in the Parallel provider when authStorage.getApiKey returns no credential for 'parallel'. Parallel search requires either the PARALLEL_API_KEY environment variable or an interactive login via 'omp /login parallel'.","triggerScenarios":"Any Parallel web search where no PARALLEL_API_KEY is set in the environment and no stored credential exists for the given sessionId (including force-refresh finding nothing to refresh).","commonSituations":"Fresh install without login; CI/containers without the env var exported; key stored under a different session; PARALLEL_API_KEY set in one shell but not the process running omp.","solutions":["Set PARALLEL_API_KEY in the environment before running the search","Run 'omp /login parallel' to store credentials interactively","Verify the env var is visible to the omp process (export it in the same shell/profile)","Check the auth storage for a stale/expired entry and re-login"],"exampleFix":"// before\nconst results = await searchParallel({ query }); // no credential\n// after\n// shell:\nexport PARALLEL_API_KEY=...  // or: omp /login parallel\nconst results = await searchParallel({ query });","handlingStrategy":"validation","validationCode":"// ensure credential before calling\nif (!process.env.PARALLEL_API_KEY && !isLoggedIn('parallel')) {\n  throw new Error('Set PARALLEL_API_KEY or run: omp /login parallel');\n}","typeGuard":null,"tryCatchPattern":"try {\n  const res = await searchParallel({ query, authStorage });\n} catch (err) {\n  if (err instanceof ParallelApiError && err.message.includes('credentials not found')) {\n    // guide user to 'omp /login parallel' or export PARALLEL_API_KEY\n  } else throw err;\n}","preventionTips":["Export PARALLEL_API_KEY in shell profiles and CI secrets","Run 'omp /login parallel' on new machines","Confirm the env var is present in the actual process environment, not just the parent shell","Check auth storage entries when switching sessions or profiles"],"tags":["authentication","credentials","env-var","parallel"],"backgroundTag":"missing-api-key","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}