BerriAI/litellm · error · HTTPException

Managed ID was minted for provider '{payload.provider}', not

Error message

Managed ID was minted for provider '{payload.provider}', not '{provider}'.

What it means

Raised while resolving a passthrough managed ID when the decoded ManagedIdPayload records a different provider than the one of the endpoint being called — the ID was minted for another provider and must not be forwarded to this one.

Source

Thrown at litellm/proxy/pass_through_endpoints/managed_id_rewriter.py:328

    Raises ``HTTPException(404)`` on unknown / forged managed IDs — never
    forwarded upstream as a literal string.
    """
    payload: Final[ManagedIdPayload | None] = decode(managed_id)
    if payload is None:
        return managed_id  # not a passthrough managed ID; pass through
    verbose_proxy_logger.debug(
        "managed_id_rewriter: resolving managed id provider=%s raw_prefix=%s",
        provider,
        (
            payload.raw_provider_id.split("_", 1)[0]
            if "_" in payload.raw_provider_id
            else payload.raw_provider_id.split("-", 1)[0]
        ),
    )

    # 1. Cross-route (cross-provider) check
    if payload.provider != provider:
        raise HTTPException(
            status_code=404,
            detail=(f"Managed ID was minted for provider '{payload.provider}', not '{provider}'."),
        )

    row_created_by: str | None = None
    row_team_id: str | None = None
    found = False

    raw_id: Final = payload.raw_provider_id

    # 2. DB lookup — pick table based on raw ID prefix
    if any(raw_id.startswith(p) for p in _FILE_PREFIXES):
        # File table — use hook's internal cache for speed when available
        if isinstance(managed_files_hook, ManagedFileIdReader):
            try:
                file_row: Final = await managed_files_hook.get_unified_file_id(
                    managed_id,
                    litellm_parent_otel_span=None,

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Use the managed ID with the same provider it was created for; mint a new ID for the other provider if needed.
  2. Check that the provider in the request path matches the provider embedded in the managed ID.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/pass_through_endpoints/managed_id_rewriter.py:328 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/cda02fc421dede98. Report an issue: GitHub.