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

#29830 Bug: /v1/files returns encoded file IDs that are not decoded in /chat/completions or /v1/responses

  • State: open
  • Author: @madhu19991
  • Labels: llm translation

## Description

When uploading a file via `POST /v1/files` using the `x-litellm-model` header, LiteLLM returns an encoded file ID. However, when this encoded file ID is passed in `/chat/completions` or `/v1/responses`, LiteLLM does not decode it before forwarding to the provider — causing the requests to fail.

Note: this issue is specific to the `x-litellm-model` header upload path. Uploading via the `target_model_names` form field (managed files path) returns an encoded ID that **does** work transparently in chat completions.

## Steps to Reproduce

**1. Upload a file using x-litellm-model header:** ```bash curl -X POST http://localhost:4000/v1/files \ -H "Authorization: Bearer sk-1234" \ -H "x-litellm-model: gpt-5.1" \ -F purpose="assistants" \ -F file="@receipt.pdf" ```

Response: ```json { "id": "file-bGl0ZWxsbTpmaWxlLUV4VHVDYXdVcXhFTWpWRks2eHdSOUI7bW9kZWwsZ3B0LTUuMQ", ... } ```

**2. Use the returned file ID in chat completions:** ```bash curl -X POST http://localhost:4000/v1/chat/completions \ -H "Authorization: Bearer sk-1234" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5.1", "messages": [{"role": "user", "content": [ {"type":…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d17h59m24s ago — entered · #import:https:::github.com:berriai:litellm post #3086
29830 is harder because it spans cross-endpoint identifier handling, provider-specific file flows, and compatibility testing across both chat and responses APIs. 28561 is comparatively narrower: a localized Bedrock rerank regression with a likely interface or provider-mapping fix, though it still carries regression-testing risk.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search