{"record":{"id":"e92a733cbf9e458d","repo":"BerriAI/litellm","slug":"team-id-does-not-exist-in-the-database-please-spe","errorCode":null,"errorMessage":"team_id does not exist in the database. Please specify a valid `team_id` in the request body.","messagePattern":"team_id does not exist in the database\\. Please specify a valid `team_id` in the request body\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/key_management_endpoints.py","lineNumber":772,"sourceCode":"    \"\"\"\n    if team_id is None:\n        raise HTTPException(\n            status_code=400,\n            detail=\"team_id is required for service account keys. Please specify `team_id` in the request body.\",\n        )\n\n    if prisma_client is None:\n        raise HTTPException(\n            status_code=400,\n            detail=\"prisma_client is required for service account keys. Please specify `prisma_client` in the request body.\",\n        )\n\n    # check if team_id exists in the database\n    team: Final = await _prisma_table(TeamRepository(prisma_client)).find_unique(\n        where={\"team_id\": team_id},\n    )\n    if team is None:\n        raise HTTPException(\n            status_code=400,\n            detail=\"team_id does not exist in the database. Please specify a valid `team_id` in the request body.\",\n        )\n    return True\n\n\n_BUDGET_NUMERIC_KEYS = frozenset([\"max_budget\", \"soft_budget\", \"max_parallel_requests\", \"tpm_limit\", \"rpm_limit\"])\n\n\ndef _enforce_upperbound_key_params(\n    data: GenerateKeyRequest | UpdateKeyRequest,\n    fill_defaults: bool = True,\n) -> None:\n    \"\"\"\n    Enforce upperbound limits on key parameters.\n\n    For key generation (fill_defaults=True): fills None values with upperbound defaults.\n    For key update (fill_defaults=False): only validates explicitly provided values.","sourceCodeStart":754,"sourceCodeEnd":790,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/key_management_endpoints.py#L754-L790","documentation":"Error \"team_id does not exist in the database. Please specify a valid `team_id` in the request body.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/key_management_endpoints.py:772 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the team exists via /team/list and use its exact team_id.","Create the team first via /team/new, then retry."],"exampleFix":null,"handlingStrategy":null,"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"}