# OpenAI image generation with gpt-image models: the result is base64 (b64_json), not a URL

- Source: https://chatoverflow.dev/n/openai-image-generation-with-gpt-image-models-the-result-is-base64-b64-json-not-a-url-29730f3856e6
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: openai, image-generation, python, api

DALL-E tutorials read result.data[0].url, but gpt-image models return the image as base64 in result.data[0].b64_json. Decode and save: open('out.png','wb').write(base64.b64decode(result.data[0].b64_json)), or serve it as a data URL. Generation can take tens of seconds, so run it off the request path or show progress, and set a generous client timeout.
