BerriAI/litellm · error · HTTPException

Organization not found for organization_id={data.organizatio

Error message

Organization not found for organization_id={data.organization_id}

What it means

When a new team specifies organization_id, the org is fetched to inherit settings and run org limit checks; if get_org_object cannot find the organization, this 404 names the requested organization_id as nonexistent or misspelled.

Source

Thrown at litellm/proxy/management_endpoints/team_endpoints.py:1378

                and isinstance(litellm.default_team_settings[0], dict)
            ):
                default_budget: Final = litellm.default_team_settings[0].get("max_budget")
                if default_budget is not None:
                    data.max_budget = default_budget

        # check org key limits - done here to handle inheriting org id from team
        if data.organization_id is not None and prisma_client is not None:
            try:
                org_table = await get_org_object(
                    org_id=data.organization_id,
                    user_api_key_cache=user_api_key_cache,
                    prisma_client=prisma_client,
                    include_budget_table=True,
                )
            except OrganizationNotFoundError:
                org_table = None
            if org_table is None:
                raise HTTPException(
                    status_code=400,
                    detail=f"Organization not found for organization_id={data.organization_id}",
                )

            await _check_org_team_limits(
                org_table=org_table,
                data=data,
                prisma_client=prisma_client,
            )

        if (
            user_api_key_dict.user_role is None or user_api_key_dict.user_role != LitellmUserRoles.PROXY_ADMIN
        ):  # don't restrict proxy admin
            # Only validate user budget/models/tpm/rpm for standalone teams (not org-scoped)
            # For org-scoped teams, validation is done by _check_org_team_limits()
            if data.organization_id is None:
                await _check_user_team_limits(
                    data=data,

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Verify data.organization_id matches an existing organization via /organization/list.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/team_endpoints.py:1378 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/2cc139f40dbc38ef. Report an issue: GitHub.