{
 "kind": "api",
 "slug": "openai-gpt-image",
 "path": "apis/openai-gpt-image/",
 "name": "OpenAI Image API (GPT Image)",
 "logo": "https://agentgid.com/media/avatars/openai.png",
 "maker": "OpenAI",
 "density": "full",
 "crumbs": [
  [
   "APIs",
   "apis/"
  ],
  [
   "Image generation APIs",
   "apis/image-generation/"
  ]
 ],
 "lead": "Make and edit pictures from text.",
 "chips": [
  {
   "label": "Image generation APIs",
   "path": "apis/image-generation/"
  },
  {
   "label": "Up · live status",
   "live": true
  }
 ],
 "primary": {
  "label": "Copy prompt for your agent",
  "copy": "Add image generation to my app on the server: call OpenAI images.generate with gpt-image-2.6-flare and quality \"low\" for drafts, decode b64_json, save the PNG to storage and return its URL; key from OPENAI_API_KEY, never in browser code."
 },
 "links": [
  {
   "label": "Website",
   "href": "https://developers.openai.com"
  },
  {
   "label": "Pricing",
   "href": "https://developers.openai.com/api/docs/guides/image-generation"
  },
  {
   "label": "GitHub",
   "href": "https://github.com/openai/openai-node"
  }
 ],
 "track": "Outages, price changes and new versions on your dashboard",
 "verdicts": [
  {
   "key": "price",
   "label": "Price",
   "value": "Paid",
   "status": "info",
   "sub": "from $0.006",
   "quote": null,
   "note": "No free tier on the pricing page. As reported on the official pricing page, checked Nov 1, 2026.",
   "src": "https://developers.openai.com/api/docs/guides/image-generation"
  },
  {
   "key": "commercial",
   "label": "Commercial use",
   "value": "With conditions",
   "status": "cond",
   "sub": "Does not train on your data",
   "quote": "Yes, customers own their input and output from our models, including in the case of embeddings.",
   "note": "You own inputs and outputs; prompts and pictures must pass OpenAI's content policy and follow its Terms of Use (the policy pages block automated readers, so read them in a browser).",
   "src": "https://developers.openai.com/api/docs/guides/embeddings.md"
  },
  {
   "key": "key",
   "label": "Key & sign-up",
   "value": "API key, server only",
   "status": "info",
   "sub": "Env var OPENAI_API_KEY",
   "quote": "Load API keys from an environment variable or key management service on the server.",
   "note": "OpenAI API key sent as a Bearer header from your server (Authorization: Bearer $OPENAI_API_KEY); the organization may need verification first",
   "src": "https://developers.openai.com/api/reference/overview.md"
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Community MCP server",
   "status": "cond",
   "sub": "llms.txt · SDK",
   "quote": "This MCP server is documentation-only. It does not call the OpenAI API on your behalf.",
   "note": " Our agent check: 4 of 6 (Nov 13, 2026).",
   "src": "https://developers.openai.com/learn/docs-mcp.md"
  }
 ],
 "vfoot": "Checked against the maker's official pages, pricing on Nov 1, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What OpenAI Image API (GPT Image) does",
   "parts": [
    {
     "t": "prose",
     "text": "GPT Image is OpenAI's paid online service for making pictures from a written description and for editing pictures you already have. Your server sends a prompt, and optionally photos, and gets back a finished image file to show or save. It can also return a logo as an editable vector file or a short looping animation."
    },
    {
     "t": "list",
     "items": [
      "OpenAI Image API (GPT Image) is one of 13 APIs in the Image generation APIs category on AgentGid.",
      "It is not among the 3 that can be started for free.",
      "4 of them ship an official MCP server; OpenAI Image API (GPT Image) does not.",
      "Its official SDK is the 1st most downloaded in the category (156M a week)."
     ],
     "muted": true
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Illustrations for posts and lessons",
       "text": "Make a matching picture for each blog post, lesson or children's story from a short description, instead of searching stock sites.",
       "idea": false
      },
      {
       "title": "Product shots without a background",
       "text": "Cut a product out of a phone photo onto a see-through background, ready to place on any page or banner.",
       "idea": false
      },
      {
       "title": "Change one part of a photo",
       "text": "Mark an area of a room or product photo and describe the change, such as adding a pool or swapping a color, while everything else stays the same.",
       "idea": false
      },
      {
       "title": "A logo you can recolor later",
       "text": "Get a simple logo or icon as a vector file, so a designer can change its colors and shapes without redrawing it.",
       "idea": false
      },
      {
       "title": "Short looping animations",
       "text": "Turn a description of a small motion, like a lantern lifting and lowering, into a looping GIF for a page or a message.",
       "idea": false
      },
      {
       "title": "Cover images for every article",
       "text": "Generate a cover in your site's style each time an editor publishes a post, with the title as the prompt.",
       "idea": true
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "OpenAI Image API (GPT Image) popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "148M",
       "l": "SDK downloads a week",
       "d": "+18.0% on the 4-week average",
       "up": true
      },
      {
       "n": "11.3K",
       "l": "GitHub stars, openai/openai-node"
      }
     ]
    },
    {
     "t": "small",
     "text": "SDK downloads from npm and PyPI, weekly. Numbers as of Nov 17, 2026."
    }
   ]
  },
  {
   "id": "pricing",
   "nav": "Pricing and limits",
   "h2": "Pricing",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Free tier",
       "v": "None"
      },
      {
       "l": "Cheapest plan",
       "v": "No monthly plan"
      },
      {
       "l": "Usage price",
       "v": "gpt-image-2 1024x1024: $0.006 low / $0.053 medium / $0.211 high per image"
      },
      {
       "l": "Plans",
       "v": "Newest models gpt-image-2.5-sunburst and -flare: $8/1M image input, $30/1M image output tokens (Batch 50% off). gpt-image-2 standard: $8 input / $30 output per 1M image tokens. Legacy per-image tables also list GPT Image 1.5, 1 and 1 Mini."
      }
     ]
    },
    {
     "t": "h3",
     "text": "What one action costs"
    },
    {
     "t": "table",
     "head": [
      "Action",
      "Price"
     ],
     "num": true,
     "rows": [
      [
       "1 image, gpt-image-2, 1024x1024, low quality",
       "$0.006"
      ],
      [
       "1 image, gpt-image-2, 1024x1024, medium quality",
       "$0.053"
      ],
      [
       "1 image, gpt-image-2, 1024x1024, high quality",
       "$0.211"
      ],
      [
       "1M image output tokens, gpt-image-2.6-sunburst or -flare (standard)",
       "$30.00"
      ],
      [
       "1M image output tokens, gpt-image-2 (Batch)",
       "$15.00"
      ]
     ]
    },
    {
     "t": "small",
     "text": "As reported on the official pricing page, checked Nov 1, 2026. Prices change: confirm before you buy.",
     "link": "developers.openai.com/api/docs/guides/image-generation",
     "href": "https://developers.openai.com/api/docs/guides/image-generation"
    }
   ]
  },
  {
   "id": "limits",
   "nav": null,
   "spy_as": "pricing",
   "h2": "Limits",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Usage tiers (Free, Build, Launch, Grow)",
       "v": "Images per minute (IPM) and other limits depend on your tier and the model; see the limits page in your account",
       "src": "https://developers.openai.com/api/docs/guides/rate-limits.md"
      },
      {
       "l": "All plans",
       "v": "Custom sizes in multiples of 16, aspect ratio from 1:3 to 3:1, up to 3840x2160",
       "src": "https://developers.openai.com/api/reference/resources/images/methods/generate.md"
      }
     ]
    },
    {
     "t": "small",
     "text": "From the official docs.",
     "link": "developers.openai.com/api/docs/guides/rate-limits.md",
     "href": "https://developers.openai.com/api/docs/guides/rate-limits.md"
    }
   ]
  },
  {
   "id": "status",
   "nav": "Status",
   "h2": "Status and incidents",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Right now",
       "v": "Up",
       "status": "yes",
       "sub": "All Systems Operational"
      },
      {
       "l": "Last 30 days",
       "v": "19 incidents, 2 of them major"
      }
     ]
    },
    {
     "t": "small",
     "text": "From the official status page, checked Nov 23, 2026.",
     "link": "status.openai.com",
     "href": "https://status.openai.com"
    }
   ]
  },
  {
   "id": "access",
   "nav": "Access and terms",
   "h2": "Key and access",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "How it signs in",
       "v": "OpenAI API key sent as a Bearer header from your server (Authorization: Bearer $OPENAI_API_KEY); the organization may need verification first"
      },
      {
       "l": "Environment variable",
       "v": "OPENAI_API_KEY",
       "code": true
      },
      {
       "l": "Safe in browser code",
       "v": "No, keep it on your server",
       "status": "no"
      },
      {
       "l": "Card at sign-up",
       "v": "Not stated on the pages we read"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Steps only a person can do"
    },
    {
     "t": "list",
     "items": [
      "Sign in to the OpenAI platform and create an API key. Put it in .env as OPENAI_API_KEY (kept out of git) and read it on the server only.",
      "Complete API Organization Verification if the dashboard asks for it before GPT Image works. Retry the first request; no code change.",
      "Add a payment method and buy prepaid credits. No code change."
     ]
    }
   ]
  },
  {
   "id": "terms",
   "nav": null,
   "spy_as": "access",
   "h2": "Commercial use and your data",
   "parts": [
    {
     "t": "prose",
     "text": "It is a paid online service, not open source. You own the prompts and images you send and the pictures you get back. Prompts and results must follow OpenAI's content rules, which filter every request."
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In a paid app",
       "v": "With conditions",
       "status": "cond",
       "sub": "You own inputs and outputs; prompts and pictures must pass OpenAI's content policy and follow its Terms of Use (the policy pages block automated readers, so read them in a browser).",
       "quote": "Yes, customers own their input and output from our models, including in the case of embeddings.",
       "src": "https://developers.openai.com/api/docs/guides/embeddings.md"
      },
      {
       "l": "client-work",
       "v": "With conditions",
       "status": "cond",
       "sub": "Use a separate project and service account key per client app, and pass a hashed safety identifier for each end user.",
       "quote": "Don't share one developer's key across a team or use that person's identity as the permanent identity of a production application.",
       "src": "https://developers.openai.com/api/docs/guides/api-keys.md"
      },
      {
       "l": "redistribute-files",
       "v": "With conditions",
       "status": "cond",
       "sub": "You own the generated pictures and may pass them on; the content policy still applies, and photos you edit keep their own rights.",
       "quote": "Yes, customers own their input and output from our models, including in the case of embeddings.",
       "src": "https://developers.openai.com/api/docs/guides/embeddings.md"
      },
      {
       "l": "Trains on what you send",
       "v": "“As of March 1, 2023, data sent to the OpenAI API is not used to train or improve OpenAI models (unless you explicitly opt in to share data with us).”",
       "quote": null,
       "src": "https://developers.openai.com/api/docs/guides/your-data.md"
      },
      {
       "l": "Keeps your data",
       "v": "Image requests are kept in abuse monitoring logs up to 30 days, not as application state; input images are scanned for CSAM and flagged ones are kept for review.",
       "quote": "Image and file inputs are scanned for CSAM content upon submission.",
       "src": "https://developers.openai.com/api/docs/guides/your-data.md"
      },
      {
       "l": "Where data is stored",
       "v": "Data residency per project for eligible customers (via sales).",
       "quote": "Data residency controls are a project configuration option that allow you to configure the location of infrastructure OpenAI uses to provide services.",
       "src": "https://developers.openai.com/api/docs/guides/your-data.md"
      }
     ]
    }
   ]
  },
  {
   "id": "errors",
   "nav": null,
   "spy_as": "access",
   "h2": "Errors to handle",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "400 image_generation_user_error (for example moderation_blocked)",
       "v": "The prompt or input image was rejected, for example by the content filter.",
       "sub": "Do not retry as is; change the prompt or the input images, and read error.code."
      },
      {
       "l": "401 Incorrect API key provided",
       "v": "The key sent with the request is wrong or was revoked.",
       "sub": "Check the key; do not retry unchanged."
      },
      {
       "l": "429 Rate limit reached for requests",
       "v": "Too many images or requests per minute for your tier.",
       "sub": "Retry with backoff after Retry-After."
      },
      {
       "l": "429 credit_balance_exhausted",
       "v": "No prepaid credits left.",
       "sub": "Top up credits; retrying does not help."
      },
      {
       "l": "500 Server error",
       "v": "A problem on OpenAI's side.",
       "sub": "Retry after a short wait with backoff."
      }
     ]
    }
   ]
  },
  {
   "id": "agent",
   "nav": "For agents",
   "h2": "Use it from an agent",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Our agent check",
       "v": "4 of 6: llms.txt yes, OpenAPI no, SDK yes, MCP no, status page yes, AI assistants allowed yes",
       "sub": "Checked Nov 13, 2026."
      },
      {
       "l": "MCP server",
       "v": "OpenAI Docs MCP (documentation only)",
       "sub": "claude mcp add --transport http openaiDeveloperDocs https://developers.openai.com/mcp"
      },
      {
       "l": "npm",
       "v": "npm install openai",
       "code": true
      },
      {
       "l": "PyPI",
       "v": "pip install openai",
       "code": true
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "OpenAI Image API (GPT Image)",
       "me": true,
       "facts": [
        "from $0.006",
        "No free tier"
       ]
      },
      {
       "name": "Gemini API image generation (Nano Banana / Imagen)",
       "why": "Pick Gemini image generation (Nano Banana) when you already use the Gemini API; our catalog lists it at $0.0336 per image.",
       "path": "apis/google-gemini-image/",
       "facts": [
        "from $0.0336 per 1K image",
        "No free tier"
       ]
      },
      {
       "name": "Recraft API",
       "why": "Pick Recraft when vector (SVG) images and vectorizing existing pictures are the main need; our catalog lists $0.035 per image.",
       "path": "apis/recraft/",
       "facts": [
        "from $0.04 per raster image",
        "No free tier",
        "Official MCP"
       ]
      },
      {
       "name": "FLUX API",
       "why": "Pick the FLUX API for FLUX.2 and FLUX 3 generation and editing; our catalog lists it from $0.014 per image.",
       "path": "apis/bfl-flux/",
       "facts": [
        "from $0.03/image",
        "No free tier",
        "Official MCP"
       ]
      }
     ],
     "more": "All image generation apis APIs",
     "more_path": "apis/image-generation/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "Add image generation to my app on the server: call OpenAI images.generate with gpt-image-2.6-flare and quality \"low\" for drafts, decode b64_json, save the PNG to storage and return its URL; key from OPENAI_API_KEY, never in browser code."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Create an OpenAI API key, keep it in OPENAI_API_KEY on the server, and complete organization verification if the dashboard asks for it.",
       "code": "export OPENAI_API_KEY=\"your_api_key_here\"",
       "src": "https://developers.openai.com/api/docs/guides/image-generation.md"
      },
      {
       "text": "Install the official package (pip install openai or npm install openai).",
       "code": "pip install openai",
       "src": "https://developers.openai.com/api/docs/quickstart.md"
      },
      {
       "text": "Ask for an image and save the returned base64 data as a file.",
       "code": "curl -X POST \"https://api.openai.com/v1/images/generations\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H \"Content-type: application/json\" \\\n  -d '{\n    \"model\": \"gpt-image-2.5-sunburst\",\n    \"prompt\": \"A children'\\''s book drawing of a veterinarian using a stethoscope to listen to the heartbeat of a baby otter.\"\n  }' | jq -r '.data[0].b64_json' | base64 --decode > otter.png\n",
       "src": "https://developers.openai.com/api/docs/guides/image-generation.md"
      }
     ]
    },
    {
     "t": "h3",
     "text": "First request"
    },
    {
     "t": "tabs",
     "label": "First request",
     "items": [
      {
       "tab": "Request",
       "code": "curl https://api.openai.com/v1/images/generations \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -d '{\n    \"model\": \"gpt-image-2.5-flare\",\n    \"prompt\": \"A cute baby sea otter\",\n    \"n\": 1,\n    \"size\": \"1024x1024\"\n  }'\n",
       "intro": null
      },
      {
       "tab": "Response",
       "code": "{\n  \"created\": 1713833628,\n  \"data\": [\n    {\n      \"b64_json\": \"...\"\n    }\n  ],\n  \"usage\": {\n    \"total_tokens\": 100,\n    \"input_tokens\": 50,\n    \"output_tokens\": 50,\n    \"input_tokens_details\": {\n      \"text_tokens\": 10,\n      \"image_tokens\": 40\n    }\n  }\n}\n"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "model=\"gpt-image-1\" (or dall-e-3 code copied from an old tutorial)",
       "fix": "model=\"gpt-image-2.6-flare\" or \"gpt-image-2.6-sunburst\" (or the 2.5 versions)",
       "why": "gpt-image-1 was shut down, and old DALL-E examples assume features GPT Image does not have."
      },
      {
       "dont": "Reading result.data[0].url or passing response_format=\"url\"",
       "fix": "Decode result.data[0].b64_json and save or upload the bytes yourself",
       "why": "GPT Image models only return base64 data, never a hosted link."
      },
      {
       "dont": "Asking for a transparent background with output_format=\"jpeg\", or drawing a checkerboard in the prompt",
       "fix": "background=\"transparent\" with output_format=\"png\" or \"webp\", and an isolated subject in the prompt",
       "why": "Only PNG and WebP keep transparency; a drawn checkerboard is not transparency."
      },
      {
       "dont": "Retrying a moderation_blocked error in a loop",
       "fix": "Show the person a message and ask for a changed prompt or image",
       "why": "User-correctable errors fail again until the request changes."
      },
      {
       "dont": "A 30-second HTTP timeout on the server route that calls images.generate",
       "fix": "Allow at least 2 minutes, or stream partial images to show progress",
       "why": "Complex prompts can take up to 2 minutes."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "How much does one picture cost?",
       "a": "It depends on model, size and quality. For gpt-image-2 at 1024x1024 the docs list $0.006 low, $0.053 medium and $0.211 high; newer models are billed per image token.",
       "evidence": {
        "url": "https://developers.openai.com/api/docs/guides/image-generation.md",
        "quote": "GPT Image 2 Additional sizes available Low $0.006 $0.005 $0.005 Medium $0.053 $0.041 $0.041 High $0.211"
       }
      },
      {
       "q": "Do I get a link or a file back?",
       "a": "A file. GPT Image models always return the picture as base64 text that your code decodes and saves.",
       "evidence": {
        "url": "https://developers.openai.com/api/reference/resources/images/methods/generate.md",
        "quote": "Unsupported for GPT image models, which always return base64-encoded images."
       }
      },
      {
       "q": "Can I use the pictures in my product?",
       "a": "Yes, you own your inputs and outputs, as long as prompts and results follow OpenAI's content policy.",
       "evidence": {
        "url": "https://developers.openai.com/api/docs/guides/embeddings.md",
        "quote": "Yes, customers own their input and output from our models, including in the case of embeddings."
       }
      },
      {
       "q": "Can I get a transparent PNG?",
       "a": "Yes. Ask for an isolated subject and set background to transparent with PNG or WebP output.",
       "evidence": {
        "url": "https://developers.openai.com/api/docs/guides/image-prompting.md",
        "quote": "For a raster logo you can place on another background, use output_format=\"png\" and background=\"transparent\"."
       }
      },
      {
       "q": "Which model should I start with?",
       "a": "GPT Image 2.6 Flare when speed matters most, GPT Image 2.6 Sunburst when detail, layout or precise edits matter.",
       "evidence": {
        "url": "https://developers.openai.com/api/docs/guides/image-prompting.md",
        "quote": "For a new workflow, start with GPT Image 2.6 Flare if response time matters most."
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Maker",
   "OpenAI"
  ],
  [
   "Category",
   "Image generation APIs"
  ],
  [
   "Status",
   "Up · 19 incidents in 30 days"
  ],
  [
   "Price",
   "from $0.006"
  ],
  [
   "Official SDK",
   "npm openai, PyPI openai"
  ],
  [
   "Latest SDK",
   "3.48.0 on npm"
  ],
  [
   "Agent check",
   "4 of 6"
  ],
  [
   "Pricing checked",
   "Nov 1, 2026"
  ]
 ],
 "good": [
  "You need an OpenAI account, prepaid credits, a secret key on your server, and maybe a one-time organization check.",
  "A complex picture can take up to two minutes, so show a progress message and do not cut the request off early.",
  "Small exact text, the same character across many pictures, and precise layouts can still come out wrong."
 ],
 "checked_line": "Read by AgentGid from 19 official pages, card checked Nov 10, 2026; usage numbers update daily."
}