AI & LLM

AI Image Generation Request & Response JSON Example

A JSON example of a text-to-image generation request and response — includes the prompt, size, model, and returned image URLs. Copy-ready for DALL·E and image generation APIs.

{
  "created": 1716902400,
  "data": [
    {
      "url": "https://oaidalleapi.example.com/img/abc123.png",
      "revised_prompt": "A minimalist logo of a fox reading JSON, flat vector style, blue accent."
    }
  ]
}

Field Reference

createdrequiredintegerUnix timestamp of generation
datarequiredarray<object>One entry per generated image (n controls how many)
data[].urloptionalstringTemporary URL to the image; expires, so download promptly. Absent if b64_json was requested
data[].b64_jsonoptionalstringBase64-encoded image bytes when response_format is b64_json
data[].revised_promptoptionalstringThe prompt after the model's automatic rewriting

Variants

Generation requestDescribe the image, choose a size and how many to generate.
{
  "model": "dall-e-3",
  "prompt": "A minimalist logo of a fox reading JSON, flat vector style, blue accent.",
  "size": "1024x1024",
  "quality": "standard",
  "n": 1,
  "response_format": "url"
}

Common Use Cases

  • Generating marketing images, avatars, or icons from text prompts
  • Building a creative tool that turns descriptions into pictures
  • Producing image variations or assets programmatically
image generationdall-etext to imageai imagesgenerative ai

Validate or format this JSON

One click loads this exact example into the tool — no copy-paste needed. Format it, validate it, explore the tree, or generate TypeScript types instantly.

Frequently Asked Questions

Use 'url' for quick previews, but the URL expires (often within an hour), so download and store the image if you need it long-term. Use 'b64_json' to receive the raw bytes inline and avoid a second download request, at the cost of a much larger JSON payload.

Some models automatically rewrite your prompt to add detail and safety. revised_prompt shows the actual prompt used, which is useful for debugging why an image looks the way it does and for reproducing results.

Related JSON Examples