{"record":{"id":"92451aac74e370a0","repo":"BerriAI/litellm","slug":"reducto-upload-returned-200-without-a-file-id-go","errorCode":null,"errorMessage":"Reducto /upload returned 200 without a file_id; got payload={payload}","messagePattern":"Reducto /upload returned 200 without a file_id; got payload=(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/reducto/common.py","lineNumber":72,"sourceCode":"        _raise_bad_request(\"Reducto only supports base64-encoded data URIs.\", model=model)\n\n    mime: Final = header.removeprefix(\"data:\").split(\";\")[0] or \"application/octet-stream\"\n    try:\n        raw_bytes: Final = base64.b64decode(encoded, validate=True)\n    except (binascii.Error, ValueError):\n        _raise_bad_request(\"Invalid Reducto base64 payload provided.\", model=model)\n\n    return None, raw_bytes, mime\n\n\ndef _extract_file_id_from_upload_response(response: Any) -> str:\n    try:\n        payload: Final = response.json()\n    except ValueError as exc:\n        raise ValueError(f\"Reducto /upload returned a non-JSON 200 response: {response.text}\") from exc\n    file_id: Final = (payload or {}).get(\"file_id\") if isinstance(payload, dict) else None\n    if not isinstance(file_id, str) or not file_id:\n        raise ValueError(f\"Reducto /upload returned 200 without a file_id; got payload={payload}\")\n    return file_id\n\n\ndef upload_bytes_sync(\n    raw_bytes: bytes,\n    mime: str | None,\n    api_key: str,\n    api_base: str | None,\n) -> str:\n    import litellm\n\n    response: Final = litellm.module_level_client.post(\n        url=\"{}{}\".format(_normalize_api_base(api_base), \"/upload\"),\n        headers={\"Authorization\": f\"Bearer {api_key}\"},\n        files={\"file\": (\"document\", raw_bytes, mime or \"application/octet-stream\")},\n        timeout=request_timeout,\n    )\n    response.raise_for_status()","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/reducto/common.py#L54-L90","documentation":"Response-shape guard after a Reducto /upload call: the JSON parsed successfully but contains no file_id, so the subsequent /parse request cannot reference the uploaded document; the payload is echoed to show what came back.","triggerScenarios":"Triggered when the Reducto /upload endpoint returns HTTP 200 but the JSON payload has no file_id.","commonSituations":"See trigger scenarios.","solutions":["The upload succeeded but returned no file_id; verify the payload schema against the Reducto API docs.","Check for a Reducto server/API version mismatch."],"exampleFix":"# inspect the payload printed in the error and confirm it contains a file_id field.","handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}