BerriAI/litellm · error · ValueError

reducto:// file IDs are not accepted through the proxy OCR A

Error message

reducto:// file IDs are not accepted through the proxy OCR API; upload the file in the same request via multipart/form-data with a 'file' field, or pass an inline base64 data URI as the document URL.

What it means

Error "reducto:// file IDs are not accepted through the proxy OCR API; upload the file in the same request via multipart/form-data with a 'file' field, or pass an inline base64 data URI as the document URL." thrown in BerriAI/litellm.

Source

Thrown at litellm/proxy/ocr_endpoints/endpoints.py:188

    if isinstance(doc, dict) and doc.get("type") == "file":
        raise ValueError(
            "document type 'file' is not supported through the JSON API. "
            "To upload a local file, use multipart/form-data with a 'file' field. "
            "For JSON requests, use 'document_url' or 'image_url' document types."
        )

    # Security: reject provider-native file IDs (e.g. reducto://) received via
    # JSON. These IDs are not scoped to the LiteLLM proxy user/key, so an
    # authenticated user who obtains another user's file ID could submit it
    # here and receive the OCR result using the proxy's shared provider
    # credentials. Force callers to upload fresh content per request via
    # multipart/form-data or an inline base64 data URI, both of which produce
    # a server-mediated upload bound to the current request.
    if isinstance(doc, dict):
        for url_field in ("document_url", "image_url"):
            url_value = doc.get(url_field)
            if isinstance(url_value, str) and url_value.startswith("reducto://"):
                raise ValueError(
                    "reducto:// file IDs are not accepted through the proxy "
                    "OCR API; upload the file in the same request via "
                    "multipart/form-data with a 'file' field, or pass an "
                    "inline base64 data URI as the document URL."
                )

    return data


@router.post(
    "/v1/ocr",
    dependencies=[Depends(user_api_key_auth)],
    response_class=ORJSONResponse,
    tags=["ocr"],
)
@router.post(
    "/ocr",
    dependencies=[Depends(user_api_key_auth)],

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Upload the file via multipart/form-data with a 'file' field, or pass an inline base64 data URI as the document URL.

When it happens

Trigger: Thrown at litellm/proxy/ocr_endpoints/endpoints.py:188 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/27507027dba19f15. Report an issue: GitHub.