Skip to content

client.images.edit() method failed to pass image_url as image input #3256

Open

Description

@zh0903

Confirm this is an issue with the Python library and not an underlying OpenAI API

  • This is an issue with the Python library

Describe the bug

client.images.edit() method failed to pass image_url as image input.

As indicated in following doc, /images/edits supports image_url as input (JSON).
But when passing url to client.images.edit(), rather than file object, API throws 400 error.

I am afraid /images/edits doesn't support image_url as image input. Doc is wrong.

https://developers.openai.com/api/reference/resources/images/methods/edit#(resource)%20images%20%3E%20(method)%20edit%20%3E%20(params)%200.non_streaming%20%3E%20(param)%20images%20%3E%20(schema)

To Reproduce

result = client.images.edit(
model="gpt-image-1.5",
images={
image_url: "https://yavuzceliker.github.io/sample-images/image-1021.jpg"},
prompt=prompt
)

Code snippets

OS

Windows 11

Python version

v3.11.4

Library version

2.26.0

Activity

  1. moltx commented on May 18, 2026

    @moltx

    smoke

  2. zh0903 commented on May 18, 2026

    @zh0903
    Author
  3. nightcityblade commented on Jul 3, 2026

    @nightcityblade
    Contributor

    Hi, I'd like to work on this. I'll submit a PR shortly.

  4. nightcityblade commented on Jul 3, 2026

    @nightcityblade
    Contributor

    I took a look and this appears to need a larger API-shape change than I can finish quickly in a safe one-commit PR, so I'm releasing this for someone else to pick up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions