{"record":{"id":"4e7a4f73f8f87280","repo":"BerriAI/litellm","slug":"prisma-client-is-required-for-service-account-keys","errorCode":null,"errorMessage":"prisma_client is required for service account keys. Please specify `prisma_client` in the request body.","messagePattern":"prisma_client is required for service account keys\\. Please specify `prisma_client` in the request body\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/key_management_endpoints.py","lineNumber":762,"sourceCode":"            },\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.\",\n        )\n    return True\n\n\n_BUDGET_NUMERIC_KEYS = frozenset([\"max_budget\", \"soft_budget\", \"max_parallel_requests\", \"tpm_limit\", \"rpm_limit\"])\n","sourceCodeStart":744,"sourceCodeEnd":780,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/key_management_endpoints.py#L744-L780","documentation":"Error \"prisma_client is required for service account keys. Please specify `prisma_client` in the request body.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/key_management_endpoints.py:762 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the proxy is connected to a database (set DATABASE_URL) before creating service account keys.","Restart the proxy after configuring the database connection."],"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-14T05:17:10.506Z"}