{"record":{"id":"4669c52b52e3f950","repo":"BerriAI/litellm","slug":"project-max-budget-data-max-budget-exceeds-tea","errorCode":null,"errorMessage":"Project max_budget ({data.max_budget}) exceeds team's max_budget ({team_object.max_budget}). Team: {team_object.team_id}","messagePattern":"Project max_budget \\((.+?)\\) exceeds team's max_budget \\((.+?)\\)\\. Team: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"enterprise/litellm_enterprise/proxy/management_endpoints/project_endpoints.py","lineNumber":182,"sourceCode":"    project_models = data.models\n    team_models: list[str] = team_object.models or []\n    if project_models and len(team_models) > 0:\n        # If team has 'all-proxy-models', skip validation as it allows all models\n        if SpecialModelNames.all_proxy_models.value not in team_models:\n            for m in project_models:\n                if m not in team_models:\n                    raise HTTPException(\n                        status_code=400,\n                        detail={\n                            \"error\": f\"Model '{m}' not in team's allowed models. Team allowed models={team_models}. Team: {team_object.team_id}\"\n                        },\n                    )\n\n    # --- Validate project max_budget <= team max_budget ---\n    # Team stores budget fields directly (max_budget, tpm_limit, rpm_limit)\n    # unlike Project which uses a separate LiteLLM_BudgetTable relation\n    if data.max_budget is not None and team_object.max_budget is not None and data.max_budget > team_object.max_budget:\n        raise HTTPException(\n            status_code=400,\n            detail={\n                \"error\": f\"Project max_budget ({data.max_budget}) exceeds team's max_budget ({team_object.max_budget}). Team: {team_object.team_id}\"\n            },\n        )\n\n    # --- Validate project tpm_limit <= team tpm_limit ---\n    if data.tpm_limit is not None and team_object.tpm_limit is not None and data.tpm_limit > team_object.tpm_limit:\n        raise HTTPException(\n            status_code=400,\n            detail={\n                \"error\": f\"Project tpm_limit ({data.tpm_limit}) exceeds team's tpm_limit ({team_object.tpm_limit}). Team: {team_object.team_id}\"\n            },\n        )\n\n    # --- Validate project rpm_limit <= team rpm_limit ---\n    if data.rpm_limit is not None and team_object.rpm_limit is not None and data.rpm_limit > team_object.rpm_limit:\n        raise HTTPException(","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/enterprise/litellm_enterprise/proxy/management_endpoints/project_endpoints.py#L164-L200","documentation":"Team-level budget guard in _check_team_project_limits: a project's max_budget may not exceed its team's max_budget when the team has one configured (teams store budget fields directly, unlike projects which use a BudgetTable relation). Violations return HTTP 400 with both values and the team id.","triggerScenarios":"POST /project/new or /project/update with max_budget 1000 when the referenced team's max_budget is 500.","commonSituations":"Teams quota'd lower than project templates assume; budgets raised at project level without raising the parent team first.","solutions":["Lower the project max_budget to <= the team's max_budget","Raise the team's max_budget first via team update, then retry the project request","Omit the project max_budget to inherit the team's budgeting"],"exampleFix":"# before\nteam max_budget: 500\nproject payload: {\"max_budget\": 1000}\n\n# after\nteam max_budget: 500\nproject payload: {\"max_budget\": 500}","handlingStrategy":"validation","validationCode":"team = await get(f\"/team/info?team_id={data['team_id']}\")\nteam_max = team[\"team_info\"][\"max_budget\"]\nif team_max is not None and data.get(\"max_budget\") is not None and data[\"max_budget\"] > team_max:\n    data[\"max_budget\"] = team_max  # or raise and raise the team budget first","typeGuard":null,"tryCatchPattern":"try:\n    await post(\"/project/new\", json=data)\nexcept HTTPStatusError as e:\n    if e.response.status_code == 400 and \"exceeds team's max_budget\" in e.response.text:\n        await raise_team_budget(data[\"team_id\"], data[\"max_budget\"])\n        retry()\n    raise","preventionTips":["Always read the parent team's limits before setting child project budgets","Provision teams with headroom above intended project budgets"],"tags":["litellm","projects","teams","budget","validation","http-400"],"backgroundTag":"quota-exceeds-parent-limit","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}