{"record":{"id":"eb44743542d4ea62","repo":"BerriAI/litellm","slug":"you-must-be-a-proxy-admin-or-team-admin-to-reset-k","errorCode":null,"errorMessage":"You must be a proxy admin or team admin to reset key spend","messagePattern":"You must be a proxy admin or team admin to reset key spend","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"litellm/proxy/management_endpoints/key_management_endpoints.py","lineNumber":5096,"sourceCode":") -> None:\n    if user_api_key_dict.user_role == LitellmUserRoles.PROXY_ADMIN.value:\n        return\n\n    if key_in_db.team_id is not None:\n        team_table: Final = await get_team_object(\n            team_id=key_in_db.team_id,\n            prisma_client=prisma_client,\n            user_api_key_cache=user_api_key_cache,\n            check_db_only=True,\n        )\n        if team_table is not None:\n            if _is_user_team_admin(\n                user_api_key_dict=user_api_key_dict,\n                team_obj=team_table,\n            ):\n                return\n\n    raise HTTPException(\n        status_code=status.HTTP_403_FORBIDDEN,\n        detail={\"error\": \"You must be a proxy admin or team admin to reset key spend\"},\n    )\n\n\ndef _validate_reset_spend_value(reset_to: object, key_in_db: LiteLLM_VerificationToken) -> float:\n    if not isinstance(reset_to, (int, float)):\n        raise HTTPException(\n            status_code=status.HTTP_400_BAD_REQUEST,\n            detail={\"error\": \"reset_to must be a float\"},\n        )\n\n    reset_to = float(reset_to)\n\n    if reset_to < 0:\n        raise HTTPException(\n            status_code=status.HTTP_400_BAD_REQUEST,\n            detail={\"error\": \"reset_to must be >= 0\"},","sourceCodeStart":5078,"sourceCodeEnd":5114,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/key_management_endpoints.py#L5078-L5114","documentation":"Error \"You must be a proxy admin or team admin to reset key spend\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/key_management_endpoints.py:5096 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Authenticate with a proxy admin or team admin key.","Ask an admin to reset the key spend."],"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"}