{"record":{"id":"ada96df315baf02e","repo":"BerriAI/litellm","slug":"reset-to-must-be-a-float","errorCode":null,"errorMessage":"reset_to must be a float","messagePattern":"reset_to must be a float","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/key_management_endpoints.py","lineNumber":5104,"sourceCode":"            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\"},\n        )\n\n    current_spend: Final = key_in_db.spend or 0.0\n    if reset_to > current_spend:\n        raise HTTPException(\n            status_code=status.HTTP_400_BAD_REQUEST,\n            detail={\"error\": f\"reset_to ({reset_to}) must be <= current spend ({current_spend})\"},\n        )","sourceCodeStart":5086,"sourceCodeEnd":5122,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/key_management_endpoints.py#L5086-L5122","documentation":"Error \"reset_to must be a float\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/key_management_endpoints.py:5104 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass reset_to as a JSON number, not a string or other type.","Validate the request body types against the endpoint schema."],"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"}