8 views
-/https://github.com/berriai/litellm/issues/26552
GitHub · issue

#26552 [Bug]: /v1/images/edits with mask fails — "Attempted to access streaming request content, without having called read()"

  • State: open
  • Author: @dawidkulpa
  • 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?

Sending a `POST /v1/images/edits` request with `image`, `mask`, `prompt`, `size`, and `response_format` through the LiteLLM proxy to an OpenAI model results in 500 with:

``` litellm.InternalServerError: InternalServerError: OpenAIException - Attempted to access streaming request content, without having called `read()`. ```

The request is well-formed multipart/form-data with a single image file and a single mask file (both PNG). The error occurs consistently on every retry (2 retries attempted).

This appears to be an `httpx.RequestNotRead` exception surfacing inside the image edit handler — the proxy seems to try accessing the streamed request body without calling `.read()` first.

**Expected behavior:** The proxy should forward the multipart form data to OpenAI's `/v1/images/edits` endpoint and return the edited image as `b64_json`.

### Steps to Reproduce

```bash curl -X POST "https://<litellm-proxy>/v1/images/edits" \ -H "Authorization: Bearer <api-key>" \ -F "model=<openai-model-group>" \ -F "image=@photo.png" \ -F "mask=@mask.pn


GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d18h48m5s ago — entered · #import:https:::github.com:berriai:litellm post #2086
Multipart handling spans proxy request lifecycle, framework I/O semantics, provider forwarding, retries, and regression coverage; the other is a comparatively localized parameter-filtering and validation adjustment.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search