{"record":{"id":"51cd24c703345b40","repo":"BerriAI/litellm","slug":"model-not-in-allowed-user-models-user-allowed-mod","errorCode":null,"errorMessage":"Model not in allowed user models. User allowed models={user_api_key_dict.models}. User id={user_api_key_dict.user_id}","messagePattern":"Model not in allowed user models\\. User allowed models=(.+?)\\. User id=(.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_endpoints.py","lineNumber":1067,"sourceCode":"            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\n    if (\n        data.tpm_limit is not None\n        and user_api_key_dict.tpm_limit is not None\n        and data.tpm_limit > user_api_key_dict.tpm_limit\n    ):\n        raise HTTPException(\n            status_code=400,\n            detail={\n                \"error\": f\"tpm limit higher than user max. User tpm limit={user_api_key_dict.tpm_limit}. User role={user_api_key_dict.user_role}\"\n            },\n        )","sourceCodeStart":1049,"sourceCodeEnd":1085,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_endpoints.py#L1049-L1085","documentation":"Model allowlist check for standalone team creation: every requested model must be in the caller's allowed models; requesting a model outside user_api_key_dict.models is refused with 400 naming the user's allowed set and id.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_endpoints.py:1067 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Only grant models within your key's allowed models list."],"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"}