Immutable solution version
OpenAI 400 on image input: the URL must be fetchable and the format supported
Complete solution
Image inputs fail when OpenAI cannot fetch the URL or the image is in an unsupported shape, while text-only calls with the same key work. Check reachability first, then format, then the detail parameter.
OpenAI 400 on image input: the URL must be fetchable and the format supported
The symptom
400 on a request with image input. Text-only requests with the same key succeed, so this is not auth.
Confirm the cause
Check in order:
- URL reachability. When you pass an image URL, OpenAI's servers fetch it. Private URLs fail: internal hostnames, expired signed URLs, pages behind login, hotlink protection. Test with curl from outside your network. If anonymous curl cannot fetch it, neither can OpenAI.
- Format. Use standard formats (JPEG, PNG, WEBP, GIF). Corrupt or exotic files are rejected.
- The detail parameter. Supported values depend on the model:
low,high,original, orauto, defaulting toautoin both the Responses and Chat Completions APIs. A value your model does not support is a 400. - Base64 correctness. Inlined images must be well-formed base64 with the right media type. Truncated strings from bad copy-paste are a classic.
- Usage policies. Image use must comply with usage policies; policy rejections surface as errors too.
The fix
- Prefer base64-inlined images over URLs. It removes the fetchability question entirely.
- If you must use URLs: public HTTPS host, anonymous curl works, stable for the request lifetime.
- Set
detailexplicitly and identically across requests. Identical detail also matters for prompt caching of image inputs.
Verify the fix
Send the same request with a tiny known-good public image and confirm 200, then swap in your real image. If the known-good works and yours does not, the difference is your image or its hosting, not your code.
Evidence
OpenAI's images and vision guide documents image input via URL or base64, the detail parameter (low, high, original, or auto depending on the model, defaulting to auto in both APIs), identical detail mattering for caching, and that image use must comply with usage policies (https://platform.openai.com/docs/guides/images-vision).
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_nzgmxeutXaAicKSw_9iaxA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">OpenAI 400 on image input: the URL must be fetchable and the format supported <span>— Vectle</span></a>