{"record":{"id":"3354053b9c7049ff","repo":"BerriAI/litellm","slug":"model-m-not-in-team-s-allowed-models-team-all","errorCode":null,"errorMessage":"Model '{m}' not in team's allowed models. Team allowed models={team_models}. Team: {team_object.team_id}","messagePattern":"Model '(.+?)' not in team's allowed models\\. Team allowed models=(.+?)\\. Team: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"enterprise/litellm_enterprise/proxy/management_endpoints/project_endpoints.py","lineNumber":171,"sourceCode":"    # --- soft_budget < max_budget ---\n    if data.soft_budget is not None and data.max_budget is not None:\n        if data.soft_budget >= data.max_budget:\n            raise HTTPException(\n                status_code=400,\n                detail={\n                    \"error\": f\"soft_budget ({data.soft_budget}) must be strictly lower than max_budget ({data.max_budget})\"\n                },\n            )\n\n    # --- Validate project models are a subset of team models ---\n    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 ---","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/enterprise/litellm_enterprise/proxy/management_endpoints/project_endpoints.py#L153-L189","documentation":"Project models must be a subset of the parent team's models: _check_team_project_limits iterates data.models and rejects any model not in team_object.models with HTTP 400 naming the offending model and the allowed list. Validation is skipped only when the team's list contains 'all-proxy-models'.","triggerScenarios":"POST /project/new with models: [\"claude-3-sonnet\"] while the referenced team's models are e.g. [\"gpt-4o\"].","commonSituations":"New model rolled out at project level before being added to the team; project payloads copied across teams with different allowlists; team model lists edited after projects were templated.","solutions":["Remove the offending model from the project's models list","Add the model to the team first via POST /team/update, then retry","Or set the team's models to [\"all-proxy-models\"] to delegate allowlisting to projects"],"exampleFix":"# before\nteam models: [\"gpt-4o\"]\nproject payload: {\"models\": [\"claude-3-sonnet\"]}\n\n# after\nteam models: [\"gpt-4o\", \"claude-3-sonnet\"]\nproject payload: {\"models\": [\"claude-3-sonnet\"]}","handlingStrategy":"validation","validationCode":"team = await get(f\"/team/info?team_id={data['team_id']}\")\nteam_models = set(team[\"team_info\"][\"models\"] or [])\nif \"all-proxy-models\" not in team_models:\n    bad = set(data.get(\"models\") or []) - team_models\n    if bad:\n        raise ValueError(f\"models {bad} not allowed for team; add them to the team first\")","typeGuard":null,"tryCatchPattern":"try:\n    await post(\"/project/new\", json=data)\nexcept HTTPStatusError as e:\n    if e.response.status_code == 400 and \"not in team's allowed models\" in e.response.text:\n        await add_models_to_team(data[\"team_id\"], data[\"models\"])\n        retry()\n    raise","preventionTips":["Fetch the team's model list and intersect before submitting project payloads","Add new models at the team level first, then propagate to projects"],"tags":["litellm","projects","teams","model-access","validation","http-400"],"backgroundTag":"model-not-in-allowed-list","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}