{"record":{"id":"c30037ecfa94b241","repo":"BerriAI/litellm","slug":"a-ptu-deployment-bills-by-reserved-capacity-so","errorCode":null,"errorMessage":"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.","messagePattern":"A PTU deployment bills by reserved capacity, so (.+?) 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\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/model_management_endpoints.py","lineNumber":414,"sourceCode":"    \"\"\"Refuse a rate the caller supplies for a deployment that bills reserved capacity.\n\n    Separate from the zeroing so the team-model path can run it before it touches the team, whose\n    ACL write autocommits: a refusal raised after it would leave the team changed and the\n    deployment row never written.\n    \"\"\"\n    if not is_ptu_cost_attribution_enabled():\n        return\n    if model_info.get(\"ptu_count\") is None or model_info.get(\"cost_per_ptu_per_hour\") is None:\n        return\n    priced: Final = tuple(\n        sorted(\n            tuple(field for field in _CUSTOM_PRICING_FIELDS if _is_nonzero_price(supplied.get(field)))\n            + tuple(field for field in _PTU_EMPTIED_PRICING_FIELDS if supplied.get(field))\n        )\n    )\n    if not priced:\n        return\n    raise HTTPException(\n        status_code=400,\n        detail=(\n            f\"A PTU deployment bills by reserved capacity, so {', '.join(priced)} cannot be charged on \"\n            \"top of it. Send 0 or no value, or remove ptu_count and cost_per_ptu_per_hour to bill per token.\"\n        ),\n    )\n\n\ndef _ptu_zeroed_pricing(\n    *,\n    model_info: Mapping[str, object],\n    litellm_params: Mapping[str, object],\n    supplied: Mapping[str, object],\n) -> Mapping[str, float | tuple[()] | Mapping[str, float]]:\n    \"\"\"The pricing a PTU deployment must carry, empty unless one is being stored.\n\n    Reserved capacity is already billed by the flat cost the rollup writes, so charging the\n    traffic it serves bills the same tokens twice. Left unset the rate falls back to the public","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/model_management_endpoints.py#L396-L432","documentation":"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.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/model_management_endpoints.py:414 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}