You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The openmeter integration doesn't work correctly, the cloudevent subject field transmitted by litellm is invalid and the openmeter server throws a status code 400.
The cloudEvent config on the openmeter end is configured correctly (as shown in the official openmeter docs), as demonstrated by the following test curl that runs successfully:
subject= (kwargs.get("user", None),) # end-user passed in via 'user' param
where the user OpenAI spec field is extracted and used as the subject for the cloudevent event.
Thanks for the great project!
Relevant log output
litellm-1 | {"message": "LiteLLM.LoggingError: [Non-Blocking] Exception occurred while success logging Traceback (most recent call last):\n File \"/usr/local/lib/python3.13/site-packages/litellm/integrations/openmeter.py\", line 124, in async_log_success_event\n await self.async_http_handler.post(\n ...<3 lines>...\n )\n File \"/usr/local/lib/python3.13/site-packages/litellm/llms/custom_httpx/http_handler.py\", line 219, in post\n raise e\n File \"/usr/local/lib/python3.13/site-packages/litellm/llms/custom_httpx/http_handler.py\", line 177, in post\n response.raise_for_status()\n ~~~~~~~~~~~~~~~~~~~~~~~~~^^\n File \"/usr/local/lib/python3.13/site-packages/httpx/_models.py\", line 761, in raise_for_status\n raise HTTPStatusError(message, request=request, response=self)\nhttpx.HTTPStatusError: Client error '400 Bad Request' for url 'https://openmeter.cloud/api/v1/events'\nFor more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/usr/local/lib/python3.13/site-packages/litellm/litellm_core_utils/litellm_logging.py\", line 1602, in async_success_handler\n await callback.async_log_success_event(\n ...<6 lines>...\n )\n File \"/usr/local/lib/python3.13/site-packages/litellm/integrations/openmeter.py\", line 130, in async_log_success_event\n raise Exception(f\"OpenMeter logging error: {e.response.text}\")\nException: OpenMeter logging error: {\"type\":\"about:blank\",\"title\":\"Bad Request\",\"status\":400,\"detail\":\"request body has an error: doesn't match schema #/components/schemas/Event: Error at \\\"/subject\\\": value must be a string\"}\n\n", "level": "ERROR", "timestamp": "2025-01-05T03:36:32.704192"}
Are you a ML Ops Team?
No
What LiteLLM version are you on ?
v1.56.9
Twitter / LinkedIn details
No response
The text was updated successfully, but these errors were encountered:
What happened?
The openmeter integration doesn't work correctly, the cloudevent subject field transmitted by litellm is invalid and the openmeter server throws a status code 400.
The cloudEvent config on the openmeter end is configured correctly (as shown in the official openmeter docs), as demonstrated by the following test curl that runs successfully:
The problem appears to be in the extraction of the user field inside the openmeter code:
litellm/litellm/integrations/openmeter.py
Line 68 in 9cfd7c7
where the user OpenAI spec field is extracted and used as the subject for the cloudevent event.
Thanks for the great project!
Relevant log output
Are you a ML Ops Team?
No
What LiteLLM version are you on ?
v1.56.9
Twitter / LinkedIn details
No response
The text was updated successfully, but these errors were encountered: