{"record":{"id":"fa187eb45cd0765e","repo":"BerriAI/litellm","slug":"cannot-move-team-to-organization-team-has-access","errorCode":null,"errorMessage":"Cannot move team to organization. Team has access to all proxy models, but the organization does not.","messagePattern":"Cannot move team to organization\\. Team has access to all proxy models, but the organization does not\\.","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_endpoints.py","lineNumber":1792,"sourceCode":"    - The team's tpm/rpm limit must be less than the org's tpm/rpm limit\n\n    Proxy admins bypass the membership check and instead trigger auto-add of\n    missing members (handled by the caller). This supports SSO/Entra setups\n    where org membership tables are empty but proxy admins still need to group\n    teams under orgs for budget/model governance.\n    \"\"\"\n\n    # If the team's organization is the same as the new organization, return True\n    # Since no changes are being made\n    if team.organization_id == organization.organization_id:\n        return True\n\n    # Check if the org has access to the team's models\n    if len(organization.models) > 0:\n        if SpecialModelNames.all_proxy_models.value in organization.models:\n            pass\n        elif team.models is None or len(team.models) == 0:\n            raise HTTPException(\n                status_code=403,\n                detail={\n                    \"error\": \"Cannot move team to organization. Team has access to all proxy models, but the organization does not.\"\n                },\n            )\n        else:\n            for model in team.models:\n                can_org_access_model(\n                    model=model,\n                    org_object=organization,\n                    llm_router=llm_router,\n                )\n\n    # Check if the team's budget is less than the org's max_budget\n    if (\n        team.max_budget\n        and organization.litellm_budget_table\n        and organization.litellm_budget_table.max_budget","sourceCodeStart":1774,"sourceCodeEnd":1810,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_endpoints.py#L1774-L1810","documentation":"Team-to-org move check: the team currently has access to all proxy models but the destination organization's models list is restrictive, so moving would silently shrink or conflict with the team's model access; the move is refused with 400.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_endpoints.py:1792 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Restrict the team's models to a subset the organization allows, or grant the org access to all models first."],"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"}