{"record":{"id":"8350cac4b9bada98","repo":"BerriAI/litellm","slug":"team-id-is-required-for-service-account-keys-plea","errorCode":null,"errorMessage":"team_id is required for service account keys. Please specify `team_id` in the request body.","messagePattern":"team_id is required for service account keys\\. Please specify `team_id` in the request body\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/key_management_endpoints.py","lineNumber":756,"sourceCode":"            status_code=400,\n            detail={\n                \"error\": (\n                    f\"budget_limits entry max_budget ({over_ceiling.max_budget}) \"\n                    f\"cannot exceed the caller's own max_budget ({delegation_ceiling}).\"\n                )\n            },\n        )\n\n\nasync def validate_team_id_used_in_service_account_request(\n    team_id: str | None,\n    prisma_client: PrismaClient | None,\n):\n    \"\"\"\n    Validate team_id is used in the request body for generating a service account key\n    \"\"\"\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.\",","sourceCodeStart":738,"sourceCodeEnd":774,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/key_management_endpoints.py#L738-L774","documentation":"Error \"team_id is required for service account keys. Please specify `team_id` in the request body.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/key_management_endpoints.py:756 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include a valid team_id in the request body for the service account key.","Create a regular user-bound key instead if no team is involved."],"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"}