{"record":{"id":"7ae9c0ec2c761149","repo":"BerriAI/litellm","slug":"budget-id-is-required","errorCode":null,"errorMessage":"budget_id is required","messagePattern":"budget_id is required","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/budget_management_endpoints.py","lineNumber":147,"sourceCode":"    - budget_duration: Optional[str] - Budget reset period (\"30d\", \"1h\", etc.)\n    - budget_id: Optional[str] - The id of the budget. If not provided, a new id will be generated.\n    - max_budget: Optional[float] - The max budget for the budget.\n    - soft_budget: Optional[float] - The soft budget for the budget.\n    - max_parallel_requests: Optional[int] - The max number of parallel requests for the budget.\n    - tpm_limit: Optional[int] - The tokens per minute limit for the budget.\n    - rpm_limit: Optional[int] - The requests per minute limit for the budget.\n    - model_max_budget: Optional[dict] - Specify max budget for a given model. Example: {\"openai/gpt-4o-mini\": {\"max_budget\": 100.0, \"budget_duration\": \"1d\", \"tpm_limit\": 100000, \"rpm_limit\": 100000}}\n    - budget_reset_at: Optional[datetime] - Update the Datetime when the budget was last reset.\n    \"\"\"\n    from litellm.proxy.proxy_server import litellm_proxy_admin_name, prisma_client\n\n    if prisma_client is None:\n        raise HTTPException(\n            status_code=500,\n            detail={\"error\": CommonProxyErrors.db_not_connected_error.value},\n        )\n    if budget_obj.budget_id is None:\n        raise HTTPException(status_code=400, detail={\"error\": \"budget_id is required\"})\n\n    # Validate budget values are not negative\n    if budget_obj.max_budget is not None and (not math.isfinite(budget_obj.max_budget) or budget_obj.max_budget < 0):\n        raise HTTPException(\n            status_code=400,\n            detail={\"error\": f\"max_budget must be a non-negative finite number. Received: {budget_obj.max_budget}\"},\n        )\n    if budget_obj.soft_budget is not None and (not math.isfinite(budget_obj.soft_budget) or budget_obj.soft_budget < 0):\n        raise HTTPException(\n            status_code=400,\n            detail={\"error\": f\"soft_budget must be a non-negative finite number. Received: {budget_obj.soft_budget}\"},\n        )\n\n    validate_budget_duration(budget_obj.budget_duration)\n\n    # Validate model_max_budget if present in update\n    if budget_obj.model_max_budget is not None and len(budget_obj.model_max_budget) > 0:\n        from litellm.proxy.management_endpoints.key_management_endpoints import (","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/budget_management_endpoints.py#L129-L165","documentation":"Error \"budget_id is required\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/budget_management_endpoints.py:147 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include budget_id in the request body or path."],"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"}