BerriAI/litellm · error · ProxyException
bad_request
bad_request
Error message
Please provide start_date and end_date
What it means
Error "Please provide start_date and end_date" thrown in BerriAI/litellm.
Source
Thrown at litellm/proxy/spend_tracking/spend_management_endpoints.py:1919
Spend with Start Date and End Date
```
curl -X GET "http://0.0.0.0:4000/spend/tags?start_date=2022-01-01&end_date=2022-02-01" \
-H "Authorization: Bearer sk-1234"
```
"""
import traceback
from litellm.proxy.proxy_server import prisma_client
try:
if prisma_client is None:
raise Exception(
"Database not connected. Connect a database to your proxy - https://docs.litellm.ai/docs/simple_proxy#managing-auth---virtual-keys"
)
if end_date is None or start_date is None:
raise ProxyException(
message="Please provide start_date and end_date",
type="bad_request",
param=None,
code=status.HTTP_400_BAD_REQUEST,
)
response: Final = await ui_get_spend_by_tags(
start_date=start_date,
end_date=end_date,
tags_str=tags,
prisma_client=prisma_client,
)
return response
except Exception as e:
error_trace: Final = traceback.format_exc()
error_str: Final = str(e) + "\n" + error_trace
if isinstance(e, HTTPException):
raise ProxyException(View on GitHub (pinned to 77b7c6c40c)
Solutions
- Pass both start_date and end_date query parameters to the spend report endpoint.
When it happens
Trigger: Thrown at litellm/proxy/spend_tracking/spend_management_endpoints.py:1919 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
Background: BAD_REQUEST error code: request rejected as invalid (HTTP 400) - causes and fixes across libraries — this error's family across 8 libraries.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/dc142ba39fcf61ae.
Report an issue: GitHub.