#28568 [Bug]: [Bug] Anthropic Messages Adapter: response.id doesn't match spend logs request_id for non-Anthropic backends
### 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…