{"record":{"id":"718d005204f3de7f","repo":"BerriAI/litellm","slug":"start-date-and-end-date-must-be-provided-together","errorCode":null,"errorMessage":"start_date and end_date must be provided together","messagePattern":"start_date and end_date must be provided together","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/tag_management_endpoints.py","lineNumber":553,"sourceCode":"                \"updated_at\": tag_record.updated_at.isoformat(),\n                \"created_by\": tag_record.created_by,\n            }\n\n            # Add budget info if available\n            if hasattr(tag_record, \"litellm_budget_table\") and tag_record.litellm_budget_table:\n                tag_dict[\"litellm_budget_table\"] = tag_record.litellm_budget_table\n\n            requested_tags[tag_record.tag_name] = tag_dict\n\n        return requested_tags\n    except Exception as e:\n        raise HTTPException(status_code=500, detail=str(e))\n\n\ndef _validate_tag_list_date_range(start_date: str | None, end_date: str | None) -> None:\n    \"\"\"Require both dates together, and enforce YYYY-MM-DD format with start <= end.\"\"\"\n    if (start_date is None) != (end_date is None):\n        raise HTTPException(\n            status_code=400,\n            detail=\"start_date and end_date must be provided together\",\n        )\n    if start_date is None:\n        return\n    try:\n        start: Final = datetime.strptime(start_date, \"%Y-%m-%d\")\n        end: Final = datetime.strptime(end_date, \"%Y-%m-%d\")\n    except ValueError as e:\n        raise HTTPException(\n            status_code=400,\n            detail=f\"Invalid date format, expected YYYY-MM-DD: {e}\",\n        )\n    if start > end:\n        raise HTTPException(\n            status_code=400,\n            detail=\"start_date must be on or before end_date\",\n        )","sourceCodeStart":535,"sourceCodeEnd":571,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/tag_management_endpoints.py#L535-L571","documentation":"_validate_tag_list_date_range enforces paired date filters: supplying exactly one of start_date/end_date to tag listing is ambiguous, so a 400 is raised. At-fault input is an unpaired optional date-range parameter.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/tag_management_endpoints.py:553 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide both start_date and end_date, or neither."],"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-14T05:17:10.506Z"}