{"record":{"id":"4e57ca98ddcc939e","repo":"BerriAI/litellm","slug":"set-either-max-budget-or-budget-id-not-both","errorCode":null,"errorMessage":"Set either 'max_budget' or 'budget_id', not both.","messagePattern":"Set either 'max_budget' or 'budget_id', not both\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/_types.py","lineNumber":1788,"sourceCode":"    Create a new customer, allocate a budget to them\n    \"\"\"\n\n    user_id: str\n    alias: str | None = None  # human-friendly alias\n    blocked: bool = False  # allow/disallow requests for this end-user\n    budget_id: str | None = None  # give either a budget_id or max_budget\n    spend: float | None = None\n    allowed_model_region: AllowedModelRegion | None = (\n        None  # require all user requests to use models in this specific region\n    )\n    default_model: str | None = None  # if no equivalent model in allowed region - default all requests to this model\n    object_permission: LiteLLM_ObjectPermissionBase | None = None\n\n    @model_validator(mode=\"before\")\n    @classmethod\n    def check_user_info(cls, values):\n        if values.get(\"max_budget\") is not None and values.get(\"budget_id\") is not None:\n            raise ValueError(\"Set either 'max_budget' or 'budget_id', not both.\")\n\n        return values\n\n\nclass UpdateCustomerRequest(LiteLLMPydanticObjectBase):\n    \"\"\"\n    Update a Customer, use this to update customer budgets etc\n\n    \"\"\"\n\n    user_id: str\n    alias: str | None = None  # human-friendly alias\n    blocked: bool = False  # allow/disallow requests for this end-user\n    max_budget: float | None = None\n    budget_id: str | None = None  # give either a budget_id or max_budget\n    allowed_model_region: AllowedModelRegion | None = (\n        None  # require all user requests to use models in this specific region\n    )","sourceCodeStart":1770,"sourceCodeEnd":1806,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/_types.py#L1770-L1806","documentation":"Pydantic validator on the new-customer request rejecting a payload that sets both budget_id and max_budget. These are the two mutually exclusive ways to allocate spend budget to an end customer — reference an existing budget or create one inline from a number — and supplying both makes the intended allocation ambiguous, so the create is refused.","triggerScenarios":"Thrown at litellm/proxy/_types.py:1788 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set only one of max_budget or budget_id."],"exampleFix":"budget_id='budget-1'  # and omit max_budget","handlingStrategy":"validation","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"}