{"record":{"id":"06425f293f323095","repo":"deepseek-ai/deepseek-harness","slug":"invalid-credential-06425f","errorCode":"INVALID_CREDENTIAL","errorMessage":"${pkg}: the API key resolved from ${ref} is blank; set ${ref} to the raw key (the web Models page writes it) or export it in the launching environment","messagePattern":"(.+?): the API key resolved from (.+?) is blank; set (.+?) to the raw key \\(the web Models page writes it\\) or export it in the launching environment","errorType":"exception","errorClass":"LlmError","httpStatus":null,"severity":"error","filePath":"packages/llm/llm/src/index.ts","lineNumber":145,"sourceCode":" * never enters the message: `ref` names where to fix it, and echoing any part\n * of a secret into a log or a UI is the failure this diagnosis avoids.\n *\n * Lives beside {@link LlmError} rather than in `./api-key.ts` so the predicate\n * module stays dependency-free; both adapters share this one diagnosis instead\n * of keeping near-identical local copies.\n * @param raw - the credential exactly as supplied.\n * @param pkg - the refusing package name, prefixed to the diagnostic.\n * @param ref - the credential reference the value resolved through.\n * @returns the trimmed, usable key.\n */\nexport function assertUsableApiKey(raw: string, pkg: string, ref: string): string {\n  const checked = normalizeApiKey(raw)\n  if (checked.ok) return checked.value\n  // The Models page is named as the writer it usually is, not as the only one:\n  // the same value can arrive from a hand-edited .env or a shell export in a\n  // composition that mounts no credentials seam at all, where directing the\n  // user to a page that deployment does not serve would be a dead end.\n  throw new LlmError(\n    checked.reason === 'empty'\n      ? `${pkg}: the API key resolved from ${ref} is blank; set ${ref} to the raw key`\n        + ' (the web Models page writes it) or export it in the launching environment'\n      : `${pkg}: the API key resolved from ${ref} contains characters no HTTP header can carry;`\n        + ` set ${ref} to the raw key alone (the web Models page writes it)`,\n    INVALID_CREDENTIAL_CODE,\n  )\n}\n\n/** One model call whose config and adapter registration were resolved together. */\nexport interface PreparedLlmCall {\n  /** Detached, deep-frozen config with any adapter-owned default materialized. */\n  readonly config: LlmCallConfig\n  /** Immutable retry policy captured with the adapter registration. */\n  readonly retryPolicy: ResolvedRetryPolicy\n  /** Detached context metadata resolved with the registration-bound call. */\n  readonly context?: LlmModelContext\n  /** Exact model modalities captured with the adapter dispatch generation. */","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/llm/llm/src/index.ts#L127-L163","documentation":"Error \"${pkg}: the API key resolved from ${ref} is blank; set ${ref} to the raw key (the web Models page writes it) or export it in the launching environment\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/llm/llm/src/index.ts:145 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the referenced variable to the raw API key (the web Models page writes it) or export it in the launching environment."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}