BerriAI/litellm · error · HTTPException

A PTU deployment bills by reserved capacity, so {', '.join(p

Error message

A PTU deployment bills by reserved capacity, so {', '.join(priced)} cannot be charged on top of it. Send 0 or no value, or remove ptu_count and cost_per_ptu_per_hour to bill per token.

What it means

Error "A PTU deployment bills by reserved capacity, so {', '.join(priced)} cannot be charged on top of it. Send 0 or no value, or remove ptu_count and cost_per_ptu_per_hour to bill per token." thrown in BerriAI/litellm.

Source

Thrown at litellm/proxy/management_endpoints/model_management_endpoints.py:414

    """Refuse a rate the caller supplies for a deployment that bills reserved capacity.

    Separate from the zeroing so the team-model path can run it before it touches the team, whose
    ACL write autocommits: a refusal raised after it would leave the team changed and the
    deployment row never written.
    """
    if not is_ptu_cost_attribution_enabled():
        return
    if model_info.get("ptu_count") is None or model_info.get("cost_per_ptu_per_hour") is None:
        return
    priced: Final = tuple(
        sorted(
            tuple(field for field in _CUSTOM_PRICING_FIELDS if _is_nonzero_price(supplied.get(field)))
            + tuple(field for field in _PTU_EMPTIED_PRICING_FIELDS if supplied.get(field))
        )
    )
    if not priced:
        return
    raise HTTPException(
        status_code=400,
        detail=(
            f"A PTU deployment bills by reserved capacity, so {', '.join(priced)} cannot be charged on "
            "top of it. Send 0 or no value, or remove ptu_count and cost_per_ptu_per_hour to bill per token."
        ),
    )


def _ptu_zeroed_pricing(
    *,
    model_info: Mapping[str, object],
    litellm_params: Mapping[str, object],
    supplied: Mapping[str, object],
) -> Mapping[str, float | tuple[()] | Mapping[str, float]]:
    """The pricing a PTU deployment must carry, empty unless one is being stored.

    Reserved capacity is already billed by the flat cost the rollup writes, so charging the
    traffic it serves bills the same tokens twice. Left unset the rate falls back to the public

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Send 0 or omit per-token pricing fields for PTU deployments, or remove ptu_count and cost_per_ptu_per_hour to bill per token.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/model_management_endpoints.py:414 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/c30037ecfa94b241. Report an issue: GitHub.