{"record":{"id":"27657fa7297d37ff","repo":"BerriAI/litellm","slug":"models-cannot-be-set-to-null-send-to-clear-it","errorCode":null,"errorMessage":"models cannot be set to null; send [] to clear it","messagePattern":"models cannot be set to null; send \\[\\] to clear it","errorType":"http","errorClass":"HTTPException","httpStatus":422,"severity":"error","filePath":"litellm/proxy/management_endpoints/organization_endpoints.py","lineNumber":812,"sourceCode":"            detail={\"error\": f\"soft_budget must be a non-negative finite number. Received: {data.soft_budget}\"},\n        )\n    if data.model_max_budget:\n        from litellm.proxy.management_endpoints.key_management_endpoints import (\n            validate_model_max_budget,\n        )\n\n        try:\n            validate_model_max_budget(data.model_max_budget)\n        except ValueError as e:\n            raise HTTPException(status_code=422, detail={\"error\": str(e)})\n\n    if \"organization_alias\" in data.model_fields_set and data.organization_alias is None:\n        raise HTTPException(\n            status_code=422,\n            detail={\"error\": \"organization_alias cannot be cleared; it is required\"},\n        )\n    if \"models\" in data.model_fields_set and data.models is None:\n        raise HTTPException(\n            status_code=422,\n            detail={\"error\": \"models cannot be set to null; send [] to clear it\"},\n        )\n    if data.object_permission is not None and not data.object_permission.model_dump(exclude_none=True):\n        raise HTTPException(\n            status_code=422,\n            detail={\n                \"error\": \"object_permission cannot be an empty object; send null to clear it, or a non-empty object to set grants\"\n            },\n        )\n\n    await _verify_org_access(\n        organization_id=organization_id,\n        user_api_key_dict=user_api_key_dict,\n        prisma_client=prisma_client,\n    )\n\n    existing_organization_row: Final = await _table(OrganizationRepository(prisma_client)).find_unique(","sourceCodeStart":794,"sourceCodeEnd":830,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/organization_endpoints.py#L794-L830","documentation":"Null-semantics guard on organization update: the payload sets models to null explicitly. Null is ambiguous for a list field, so the API requires an explicit empty list [] to clear the model scope; null is rejected with 422.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/organization_endpoints.py:812 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send [] to clear models instead of null."],"exampleFix":null,"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"}