BerriAI/litellm · error · ValueError
Reducto /upload returned 200 without a file_id; got payload=
Error message
Reducto /upload returned 200 without a file_id; got payload={payload} What it means
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.
Source
Thrown at litellm/llms/reducto/common.py:72
_raise_bad_request("Reducto only supports base64-encoded data URIs.", model=model)
mime: Final = header.removeprefix("data:").split(";")[0] or "application/octet-stream"
try:
raw_bytes: Final = base64.b64decode(encoded, validate=True)
except (binascii.Error, ValueError):
_raise_bad_request("Invalid Reducto base64 payload provided.", model=model)
return None, raw_bytes, mime
def _extract_file_id_from_upload_response(response: Any) -> str:
try:
payload: Final = response.json()
except ValueError as exc:
raise ValueError(f"Reducto /upload returned a non-JSON 200 response: {response.text}") from exc
file_id: Final = (payload or {}).get("file_id") if isinstance(payload, dict) else None
if not isinstance(file_id, str) or not file_id:
raise ValueError(f"Reducto /upload returned 200 without a file_id; got payload={payload}")
return file_id
def upload_bytes_sync(
raw_bytes: bytes,
mime: str | None,
api_key: str,
api_base: str | None,
) -> str:
import litellm
response: Final = litellm.module_level_client.post(
url="{}{}".format(_normalize_api_base(api_base), "/upload"),
headers={"Authorization": f"Bearer {api_key}"},
files={"file": ("document", raw_bytes, mime or "application/octet-stream")},
timeout=request_timeout,
)
response.raise_for_status()View on GitHub (pinned to 77b7c6c40c)
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.
Example fix
# inspect the payload printed in the error and confirm it contains a file_id field.
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Triggered when the Reducto /upload endpoint returns HTTP 200 but the JSON payload has no file_id.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/92451aac74e370a0.
Report an issue: GitHub.