litellm - 💡(How to fix) Fix [Bug]: Sending `null` for `budget_duration` or `team_member_budget_duration` does not clear the value on keys or teams

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

No error logs — the requests return 200 OK. The issue is that null values are silently ignored rather than applied.

Fix Action

Fix / Workaround

v1.83.10-stable.patch.1

Code Example

curl -X POST http://localhost:4000/key/generate \
     -H "Authorization: Bearer sk-admin" \
     -H "Content-Type: application/json" \
     -d '{"team_id": "test-team", "max_budget": 100, "budget_duration": "30d"}'

---

curl -X GET "http://localhost:4000/key/info?key=<key_from_step_1>" \
     -H "Authorization: Bearer sk-admin"

---

curl -X POST http://localhost:4000/key/update \
     -H "Authorization: Bearer sk-admin" \
     -H "Content-Type: application/json" \
     -d '{"key": "<key_from_step_1>", "budget_duration": null}'

---

curl -X GET "http://localhost:4000/key/info?key=<key_from_step_1>" \
     -H "Authorization: Bearer sk-admin"

---

curl -X POST http://localhost:4000/team/update \
     -H "Authorization: Bearer sk-admin" \
     -H "Content-Type: application/json" \
     -d '{"team_id": "test-team", "budget_duration": null, "team_member_budget_duration": null}'

---

No error logs — the requests return 200 OK. The issue is that null values are silently ignored rather than applied.
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

When sending null for budget_duration (or team_member_budget_duration) via /key/update or /team/update, the API returns a successful response but does not actually clear the field. The existing value remains unchanged.

The OpenAPI spec defines these fields as anyOf: [{ type: "string" }, { type: "null" }], which implies null is a valid value to unset/clear the duration.

Expected behavior: Sending budget_duration: null should clear the budget duration and make the budget permanent (no automatic reset cycle).

Actual behavior: The request succeeds (200 OK) but the budget_duration value remains unchanged when querying the key or team afterwards.

Steps to Reproduce

  1. Create a key with a budget duration:

    curl -X POST http://localhost:4000/key/generate \
      -H "Authorization: Bearer sk-admin" \
      -H "Content-Type: application/json" \
      -d '{"team_id": "test-team", "max_budget": 100, "budget_duration": "30d"}'
  2. Verify budget_duration is set:

    curl -X GET "http://localhost:4000/key/info?key=<key_from_step_1>" \
      -H "Authorization: Bearer sk-admin"

    Response includes "budget_duration": "30d".

  3. Attempt to clear budget_duration by sending null:

    curl -X POST http://localhost:4000/key/update \
      -H "Authorization: Bearer sk-admin" \
      -H "Content-Type: application/json" \
      -d '{"key": "<key_from_step_1>", "budget_duration": null}'

    Response: 200 OK.

  4. Query the key info again:

    curl -X GET "http://localhost:4000/key/info?key=<key_from_step_1>" \
      -H "Authorization: Bearer sk-admin"

    Result: "budget_duration": "30d" — still set, not cleared.

  5. Same behavior with /team/update:

    curl -X POST http://localhost:4000/team/update \
      -H "Authorization: Bearer sk-admin" \
      -H "Content-Type: application/json" \
      -d '{"team_id": "test-team", "budget_duration": null, "team_member_budget_duration": null}'

    Returns 200 OK but neither field is cleared.

Relevant log output

No error logs — the requests return 200 OK. The issue is that null values are silently ignored rather than applied.

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.83.10-stable.patch.1

Twitter / LinkedIn details

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

litellm - 💡(How to fix) Fix [Bug]: Sending `null` for `budget_duration` or `team_member_budget_duration` does not clear the value on keys or teams