{"record":{"id":"6491e6c3276ebc53","repo":"deepseek-ai/deepseek-harness","slug":"deepseek-files-api-error-http-response-status","errorCode":null,"errorMessage":"DeepSeek Files API error (HTTP ${response.status})","messagePattern":"DeepSeek Files API error \\(HTTP (.+?)\\)","errorType":"http","errorClass":"DeepSeekFilesError","httpStatus":null,"severity":"error","filePath":"packages/llm/llm-deepseek/src/files-api.ts","lineNumber":164,"sourceCode":"      headers.set('authorization', `Bearer ${this.apiKey}`)\n      response = await this.fetchImpl(`${this.baseURL}${path}`, {\n        ...init,\n        headers,\n        ...signal === undefined ? {} : { signal },\n      })\n    } catch (error: unknown) {\n      if (signal?.aborted) throw error\n      throw new LlmError(`DeepSeek Files API request to ${this.baseURL} failed`, 'TRANSPORT', { cause: error })\n    }\n    if (response.ok) return response\n    let parsed: unknown\n    try {\n      parsed = await response.json()\n    } catch {\n      // A status remains sufficient to report the provider failure.\n    }\n    const { message, detail } = providerErrorDetail(parsed)\n    throw new DeepSeekFilesError(\n      message ?? `DeepSeek Files API error (HTTP ${response.status})`,\n      response.status,\n      detail,\n    )\n  }\n\n  /**\n   * Upload one image with an explicit expiry.\n   * @param input - deterministic request-version bytes, media type, filename, lifetime, and cancellation.\n   * @returns the validated provider file object, including `expires_at`.\n   */\n  async upload(input: {\n    data: Uint8Array\n    mediaType: ImageMediaType\n    filename: string\n    expiresAfterSeconds: number\n    signal?: AbortSignal\n  }): Promise<DeepSeekFileObject & { expiresAt: number }> {","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/llm/llm-deepseek/src/files-api.ts#L146-L182","documentation":"Error \"DeepSeek Files API error (HTTP ${response.status})\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/llm/llm-deepseek/src/files-api.ts:164 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Act on the HTTP status: fix credentials for 401, back off for 429, and inspect the response body otherwise."],"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"}