client.images.edit() method failed to pass image_url as image input
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 31.6k
- Forks
- 5.7k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 96
Description
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.
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at client.images.edit() and reproduce the 400 error with the image_url example from the issue. Compare the library's request handling with the referenced /images/edits documentation and verify that the resulting behavior or documentation clearly matches the supported input format.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100