BerriAI/litellm · error · HTTPException

Invalid expires value. Supported: 'active', 'expired'.

Error message

Invalid expires value. Supported: 'active', 'expired'.

What it means

Error "Invalid expires value. Supported: 'active', 'expired'." thrown in BerriAI/litellm.

Source

Thrown at litellm/proxy/management_endpoints/key_management_endpoints.py:5506

    """
    try:
        from litellm.proxy.proxy_server import prisma_client

        verbose_proxy_logger.debug("Entering list_keys function")

        if prisma_client is None:
            verbose_proxy_logger.error("Database not connected")
            raise Exception("Database not connected")

        # Validate status parameter
        if status is not None and status != "deleted":
            raise HTTPException(
                status_code=400,
                detail={"error": "Invalid status value. Currently only 'deleted' is supported."},
            )

        if isinstance(expires, str) and expires not in VALID_EXPIRES_FILTER_VALUES:
            raise HTTPException(
                status_code=400,
                detail={"error": "Invalid expires value. Supported: 'active', 'expired'."},
            )

        complete_user_info: Final = await validate_key_list_check(
            user_api_key_dict=user_api_key_dict,
            user_id=user_id,
            team_id=team_id,
            organization_id=organization_id,
            key_alias=key_alias,
            key_hash=key_hash,
            prisma_client=prisma_client,
        )

        # Fetch team objects once when needed for either admin or member filtering.
        # This avoids duplicate DB queries for the same team data.
        if include_team_keys or include_created_by_keys:
            team_objects = await _fetch_user_team_objects(

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Use expires='active' or expires='expired', or omit the filter.
  2. Check the endpoint documentation for supported expires values.

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/key_management_endpoints.py:5506 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/47a77b6d14604896. Report an issue: GitHub.