You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Running the following script from the readme importosfromopenaiimportOpenAIclient=OpenAI(
# This is the default and can be omittedapi_key=os.environ.get("OPENAI_API_KEY"),
)
prompt="What is in this image?"img_url="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/2023_06_08_Raccoon1.jpg/1599px-2023_06_08_Raccoon1.jpg"response=client.responses.create(
model="gpt-4o-mini",
input=[
{
"role": "user",
"content": [
{"type": "input_text", "text": prompt},
{"type": "input_image", "image_url": f"{img_url}"},
],
}
],
)
# throws openai.BadRequestError: Errorcode: 400- {'error': {'message': 'Error while downloading https://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/2023_06_08_Raccoon1.jpg/1599px-2023_06_08_Raccoon1.jpg.', 'type': 'invalid_request_error', 'param': 'url', 'code': 'invalid_value'}}
Thanks for reporting this! Fixed in #3849 using the image from our vision docs, with its usage rights verified and the example tested successfully against the live API.
Activity
docs: use smaller image URL in vision example
docs: fix broken image URL in vision example
Fix vision example to use Chat Completions API
docs: use smaller image URL in vision example
mvanhorn commentedon Mar 10, 2026
I've submitted a fix for this in PR #2955. Uses a smaller (440px) thumbnail of the same raccoon image to stay within the API's download size limits.
khalidsaidi commentedon Mar 25, 2026
A2ABench has an accepted answer for this imported thread.
ai villagenightcityblade commentedon Apr 29, 2026
Hi, I'd like to work on this. I'll submit a PR shortly.
zuhabul commentedon May 9, 2026
Updated in the same PR from @zuhabul: https://github.com/openai/openai-python/pull/3216\n\nIncludes the README image URL size fix alongside the compatibility patch.
nightcityblade commentedon May 15, 2026
Unclaiming this — I noticed there are already linked PRs, so I won’t duplicate the work. Sorry for the noise.
docs: fix vision example image URL (1599px → 640px)
LeonxLJX commentedon Sep 1, 2026
I'd like to take this one (
Vision example throws an error). I'll dig into the root cause and follow up with a PR shortly. (claiming via @LeonxLJX)LeonxLJX commentedon Sep 1, 2026
I'd like to take this one (
Vision example throws an error). I'll look into the root cause and follow up with a PR. (claiming via @LeonxLJX)LeonxLJX commentedon Sep 1, 2026
I'd like to take this one (
Vision example throws an error). I'll look into the root cause and follow up with a PR. (claiming via @LeonxLJX)docs: use the vision guide image in README example (#3849)
marcuswood-oai commentedon Sep 10, 2026
Thanks for reporting this! Fixed in #3849 using the image from our vision docs, with its usage rights verified and the example tested successfully against the live API.