BerriAI/litellm · error · HTTPException

Raw provider {resource_kind} ids cannot be used when require

Error message

Raw provider {resource_kind} ids cannot be used when require_managed_files is enabled in litellm_settings. Use the LiteLLM managed {resource_kind} id returned when the {resource_kind} was created.

What it means

Error "Raw provider {resource_kind} ids cannot be used when require_managed_files is enabled in litellm_settings. Use the LiteLLM managed {resource_kind} id returned when the {resource_kind} was created." thrown in BerriAI/litellm.

Source

Thrown at litellm/proxy/openai_files_endpoints/common_utils.py:954

    provider under shared credentials without any tenant check; knowing another tenant's provider
    id would be enough to read, reuse, or destroy the object behind it.

    Raises:
        HTTPException: 400 for a raw id, 403 for an inaccessible managed id, or 500 when
            ownership validation is unavailable.
    """
    from fastapi import HTTPException

    import litellm

    if litellm.require_managed_files is not True:
        return

    if not resource_id:
        return

    if not _is_base64_encoded_unified_file_id(resource_id):
        raise HTTPException(
            status_code=400,
            detail=(
                f"Raw provider {resource_kind} ids cannot be used when require_managed_files is enabled in "
                f"litellm_settings. Use the LiteLLM managed {resource_kind} id returned when the "
                f"{resource_kind} was created."
            ),
        )

    if not isinstance(managed_files_obj, ManagedResourceAccessChecker):
        raise HTTPException(
            status_code=500,
            detail="Managed resource ownership validation is unavailable.",
        )

    can_access: Final = (
        await managed_files_obj.can_user_call_unified_file_id(resource_id, user_api_key_dict)
        if resource_kind == "file"
        else await managed_files_obj.can_user_call_unified_object_id(resource_id, user_api_key_dict)

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Use the LiteLLM managed resource id returned when the resource was created, not the raw provider id.

When it happens

Trigger: Thrown at litellm/proxy/openai_files_endpoints/common_utils.py:954 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/a27ef56994d74cbb. Report an issue: GitHub.