{"record":{"id":"25cd761fbc5e1489","repo":"BerriAI/litellm","slug":"max-budget-higher-than-user-max-user-max-budget","errorCode":null,"errorMessage":"max budget higher than user max. User max budget={user_obj.max_budget}. User role={user_api_key_dict.user_role}","messagePattern":"max budget higher than user max\\. User max budget=(.+?)\\. User role=(.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_endpoints.py","lineNumber":1056,"sourceCode":"    caller's own limits, so a non-admin user cannot mint a brand-new team that\n    is richer than themselves.\n\n    Only used by /team/new for standalone teams (organization_id is None).\n    /team/update does NOT call this — an existing team's admin is already\n    authorized via _verify_team_access() and is not gated by their personal\n    wallet. Org-scoped teams use _check_org_team_limits() instead.\n    \"\"\"\n    # Validate team budget against user's max_budget\n    if data.max_budget is not None and user_api_key_dict.user_id is not None:\n        user_obj: Final = await get_user_object(\n            user_id=user_api_key_dict.user_id,\n            prisma_client=prisma_client,\n            user_api_key_cache=user_api_key_cache,\n            user_id_upsert=False,\n        )\n\n        if user_obj is not None and user_obj.max_budget is not None and data.max_budget > user_obj.max_budget:\n            raise HTTPException(\n                status_code=400,\n                detail={\n                    \"error\": f\"max budget higher than user max. User max budget={user_obj.max_budget}. User role={user_api_key_dict.user_role}\"\n                },\n            )\n\n    # Validate team models against user's allowed models\n    if data.models is not None and len(user_api_key_dict.models) > 0:\n        for m in data.models:\n            if m not in user_api_key_dict.models:\n                raise HTTPException(\n                    status_code=400,\n                    detail={\n                        \"error\": f\"Model not in allowed user models. User allowed models={user_api_key_dict.models}. User id={user_api_key_dict.user_id}\"\n                    },\n                )\n\n    # Validate team TPM/RPM against user's TPM/RPM limits","sourceCodeStart":1038,"sourceCodeEnd":1074,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_endpoints.py#L1038-L1074","documentation":"Standalone-team wallet guard on /team/new: a non-admin creator's requested team max_budget exceeds their own user max_budget, which would let the user mint a team richer than themselves; refused with 400 naming the user's budget and role.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_endpoints.py:1056 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set max_budget at or below your user's max budget."],"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-14T00:17:10.932Z"}