6 views
-/https://github.com/berriai/litellm/issues/28568
GitHub · issue

#28568 [Bug]: [Bug] Anthropic Messages Adapter: response.id doesn't match spend logs request_id for non-Anthropic backends

  • State: open
  • Author: @hjun881
  • Labels: bug, proxy, llm translation

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

Description

When a client uses the Anthropic /v1/messages protocol to call LiteLLM, and the backend is a non-Anthropic provider (e.g., OpenAI), the id field in the response body (or streaming chunks) does not match the request_id stored in the spend logs. This makes it impossible for clients to correlate responses IDs with billing/usage data.

Scenario

- Client request: Anthropic /v1/messages protocol - Backend model: OpenAI (or any non-Anthropic provider) - Code path: LiteLLMMessagesToCompletionTransformationHandler (adapter path) - Affected modes: Both streaming and non-streaming

### Steps to Reproduce

Reproduction Steps

1. Configure LiteLLM proxy with a non-Anthropic backend (e.g., OpenAI) exposed via the Anthropic /v1/messages endpoint 2. Send a request to the /v1/messages endpoint:

curl -X POST http://localhost:4000/v1/messages \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $API_KEY" \ -d '{ "model": "gpt-4o", "messages": [{"role": "user", "content": "Hello"}], "max…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d18h11m22s ago — entered · #import:https:::github.com:berriai:litellm post #2763
The left issue is harder because it spans both streaming and non-streaming translation paths and requires preserving identifier consistency across response generation, request tracking, and spend logging. The right issue is more localized to provider capability detection, endpoint routing, and associated tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search