BerriAI/litellm · error · ValueError

Monthly resets currently only support 1 month intervals

Error message

Monthly resets currently only support 1 month intervals

What it means

Guard in the monthly reset-time handler: monthly resets are only implemented for value==1 (a reset on the 1st of the next month); any other monthly interval (e.g. '2mo') cannot be honored, so the caller is told it is unsupported.

Solutions

  1. Use a 1-month interval for monthly resets (e.g. '1mo').
  2. Split multi-month budgets into separate monthly resets or use a different reset period.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/litellm_core_utils/duration_parser.py:375 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/cca8d3700cd1f4f5. Report an issue: GitHub.

Appendix: source

Thrown at litellm/litellm_core_utils/duration_parser.py:375

    base_midnight: datetime,
    value: int,
    reset_time_of_day: time,
) -> datetime:
    """
    Handle monthly reset times. Resets land on the 1st at `reset_time_of_day`; if the
    1st of the current month at that time has already passed, roll to the 1st of next month.

    Args:
        current_time: Current datetime
        base_midnight: Midnight of current day
        value: Number of months (currently only supports 1 month resets)
        reset_time_of_day: Wall-clock time the reset lands on

    Returns:
        datetime: First day of the next reset month at `reset_time_of_day`
    """
    if value != 1:
        raise ValueError("Monthly resets currently only support 1 month intervals")

    first_of_this_month: Final = base_midnight.replace(day=1)
    candidate: Final = _apply_time_of_day(first_of_this_month, reset_time_of_day)
    if candidate <= current_time:
        return _apply_time_of_day(_first_of_next_month(first_of_this_month), reset_time_of_day)
    return candidate

View on GitHub (pinned to 77b7c6c40c)