Edit one or more images with GPT Image using the OpenAI Images editing request format.POST https://api.mixroute.ai/v1/images/edits
Models
Model ID
Capabilities and Limits
gpt-image-2.5-flare
Fast GPT Image 2.5 model for image generation and editing.
gpt-image-2.5-sunburst
GPT Image 2.5 model for precise generation, demanding edits, and detailed visual assets.
gpt-image-2
Generation and editing; flexible sizes; fixed high input fidelity.
gpt-image-1.5
Generation and editing; standard image sizes.
gpt-image-1
Generation and editing; standard image sizes.
Request Parameters
Field
Type
Required
Description
model
string
Yes
Complete model ID from the table above. Set it explicitly for routing.
prompt
string
Yes
Description of the desired output or edit, at most 32000 characters.
image
file | file[]
Yes
PNG, JPEG, or WebP inputs, each under 50 MB, up to 16 images. Upload files as multipart form data; repeat image[] for multiple files.
mask
file
No
PNG mask under 4 MB with the same pixel dimensions as the first source image. Fully transparent pixels identify the region to edit; a multi-image request applies the mask to its first image.
input_fidelity
string
No
high or low for GPT Image 1/1.5. GPT Image 2 uses fixed high fidelity. Omit this optional field in the GPT Image 2.5 examples.
n
integer
No
Number of output images, 1-10; default 1.
size
string
No
Output dimensions, or auto (default). See the model-specific size rules below.
quality
string
No
auto (default), low, medium, or high. GPT Image 2.5 Flare/Sunburst additionally support xhigh and max.
background
string
No
auto (default), opaque, or transparent. Transparency requires PNG or WebP; support on GPT Image 2 is in preview.
output_format
string
No
Encoded image format: png (default), jpeg, or webp.
output_compression
integer
No
Compression setting from 0 to 100, default 100. Only applies to JPEG or WebP output.
stream
boolean
No
Return server-sent events when true; default false.
partial_images
integer
No
Streaming-only partial-image count, 0-3. With 0, the final image is sent without intermediate images; fewer partial images may arrive if generation finishes early.
user
string
No
Stable identifier for the end user, used for abuse monitoring. Avoid raw personal information.
Size Rules
Model
Allowed Sizes
GPT Image 1 / 1.5
auto, 1024x1024, 1536x1024, 1024x1536
GPT Image 2 / 2.5
auto or WIDTHxHEIGHT. Both edges must be divisible by 16; each edge is at most 3840 px; long/short ratio at most 3:1; total pixels 655360-8294400.
GPT Image 2 resolutions above 3686400 total pixels are experimental. These GPT models return Base64 image data; do not send DALL-E-specific response_format or style.
Use multipart/form-data, not a JSON image URL object. Let cURL or the SDK set the multipart boundary. input_fidelity=auto/medium and a top-level images JSON array are not fields of this OpenAI request.
Examples
Use your MixRoute key in the MIXROUTE_API_KEY environment variable. Requests use Authorization: Bearer .... Replace source-image placeholders with accessible images or local files before editing.
curl --request POST "https://api.mixroute.ai/v1/images/edits" \ --header "Authorization: Bearer $MIXROUTE_API_KEY" \ --form "model=gpt-image-2.5-flare" \ --form "image[]=@source.png" \ --form "prompt=Make the mug blue while preserving its shape, lighting, and background." \ --form "size=1024x1024" \ --form "quality=low" \ --form "output_format=png"
Python
import osimport base64from pathlib import Pathfrom openai import OpenAIclient = OpenAI(api_key=os.environ["MIXROUTE_API_KEY"], base_url="https://api.mixroute.ai/v1")with open("source.png", "rb") as source: result = client.images.edit( model="gpt-image-2.5-flare", image=source, prompt="Make the mug blue while preserving its shape, lighting, and background.", size="1024x1024", quality="low", output_format="png", )Path("edited.png").write_bytes(base64.b64decode(result.data[0].b64_json))
For masked editing, add the mask file. For multiple references, provide additional image files; a mask still applies only to the first.
Response
Read each image from data[].b64_json and decode it using the requested output_format. Streaming returns partial/completed image events; use the final completed event for the final file.GPT Image generation
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"MixRoute","colors":{"primary":"#7B1FA2","light":"#9C27B0","dark":"#7B1FA2"},"logo":{"light":"https://mintcdn.com/personal-a5418d9f/gmsYcyD3CEVDrHlx/logo/mixroute_logo_light.svg?fit=max\u0026auto=format\u0026n=gmsYcyD3CEVDrHlx\u0026q=85\u0026s=265a1a46d074895bd39b660678e01cd8","dark":"https://mintcdn.com/personal-a5418d9f/gmsYcyD3CEVDrHlx/logo/mixroute_logo_dark.svg?fit=max\u0026auto=format\u0026n=gmsYcyD3CEVDrHlx\u0026q=85\u0026s=98fd320a3e678bc64086c7d2f0dc84c1","href":"https://mixroute.ai/"},"favicon":"https://mintcdn.com/personal-a5418d9f/gmsYcyD3CEVDrHlx/mixroute.svg?fit=max\u0026auto=format\u0026n=gmsYcyD3CEVDrHlx\u0026q=85\u0026s=0f5f32b1b26993bc7cedaee3e45d2eb0","api":{"mdx":{"server":"https://api.mixroute.ai"}},"navbar":{"links":[],"primary":{"type":"button","label":"Get Started","href":"https://console.mixroute.ai"}},"footer":{"socials":{}},"seo":{"metatags":{"canonical":"https://mixroute.ai/docs"}},"integrations":{"gtm":{"tagId":"GTM-W54W5KHJ"}},"styling":{"latex":false},"navigation":{"languages":[{"language":"en","default":true,"href":"introduction"},{"language":"zh-Hans","href":"zh-Hans/introduction"},{"language":"zh-Hant","href":"zh-Hant/introduction"},{"language":"ja","href":"ja/introduction"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"personal-a5418d9f","hasAudioNarration":false,"actualSubdomain":"personal-a5418d9f","customDomains":["mixroute.ai"],"gitSource":{"type":"github","owner":"cherish-cherry","repo":"mixroute-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":false},"entitlements":{},"buildId":"6afd8488edadaaf94a62d4d9","clientVersion":"0.0.4205","searchFilterCounts":[{"language":"en","tag":"Home","count":263},{"language":"ja","tag":"ホーム","count":263},{"language":"zh-Hans","tag":"首页","count":263},{"language":"zh-Hant","tag":"首頁","count":263},{"language":"en","tag":"Model Introduction","count":245},{"language":"ja","tag":"モデル紹介","count":245},{"language":"zh-Hans","tag":"模型介绍","count":245},{"language":"zh-Hant","tag":"模型介紹","count":245},{"language":"en","tag":"OpenAI","count":58},{"language":"ja","tag":"OpenAI","count":58},{"language":"zh-Hans","tag":"OpenAI","count":58},{"language":"zh-Hant","tag":"OpenAI","count":58},{"language":"en","tag":"API Reference","count":44},{"language":"ja","tag":"APIリファレンス","count":44},{"language":"zh-Hans","tag":"API 手册","count":44},{"language":"zh-Hant","tag":"API 手冊","count":44},{"language":"en","tag":"Google","count":36},{"language":"ja","tag":"Google","count":36},{"language":"zh-Hans","tag":"Google","count":36},{"language":"zh-Hant","tag":"Google","count":36},{"language":"en","tag":"Alibaba","count":26},{"language":"ja","tag":"Alibaba","count":26},{"language":"zh-Hans","tag":"Alibaba","count":26},{"language":"zh-Hant","tag":"Alibaba","count":26},{"language":"en","tag":"Zhipu","count":24},{"language":"ja","tag":"Zhipu","count":24},{"language":"zh-Hans","tag":"Zhipu","count":24},{"language":"zh-Hant","tag":"Zhipu","count":24},{"language":"en","tag":"xAI","count":20},{"language":"ja","tag":"xAI","count":20},{"language":"zh-Hans","tag":"xAI","count":20},{"language":"zh-Hant","tag":"xAI","count":20},{"language":"en","tag":"Integrations","count":18},{"language":"ja","tag":"連携","count":18},{"language":"zh-Hans","tag":"开发工具 \u0026 平台","count":18},{"language":"zh-Hant","tag":"開發工具 \u0026 平台","count":18},{"language":"en","tag":"Anthropic","count":16},{"language":"ja","tag":"Anthropic","count":16},{"language":"zh-Hans","tag":"Anthropic","count":16},{"language":"zh-Hant","tag":"Anthropic","count":16}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"/docs","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"header img,#navbar img,[class*=\"logo\"] img,[class*=\"Logo\"] img,a[href=\"/\"] img,a[href=\"/cn\"] img,a[href=\"/en\"] img,a[href=\"/zh-Hant\"] img{max-height:32px!important;height:32px!important;width:auto!important}.card,[class*=\"Card\"]{position:relative!important;background-color:#f5f5f7!important;border:none!important;overflow:visible!important}.card::before,[class*=\"Card\"]::before{content:\"\";position:absolute;inset:-2px;border-radius:14px;z-index:-1;padding:2px;background:linear-gradient(135deg, #ff8a65 0%, #e91e63 35%, #9c27b0 70%, #673ab7 100%);-webkit-mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude}html.dark .card,html.dark [class*=\"Card\"],.dark .card,.dark [class*=\"Card\"],[data-theme=\"dark\"] .card,[data-theme=\"dark\"] [class*=\"Card\"]{background-color:#2d2d2d!important;color:#e5e5e5}html.dark .card::before,html.dark [class*=\"Card\"]::before,.dark .card::before,.dark [class*=\"Card\"]::before,[data-theme=\"dark\"] .card::before,[data-theme=\"dark\"] [class*=\"Card\"]::before{background:linear-gradient(135deg, #ff9a56 0%, #ff6b9d 35%, #c44dff 70%, #6b7aff 100%)}html.dark .card a,html.dark [class*=\"Card\"] a,.dark .card a,.dark [class*=\"Card\"] a,[data-theme=\"dark\"] .card a,[data-theme=\"dark\"] [class*=\"Card\"] a{color:#a78bfa}html.dark #content img[src=\"https://cdn.jsdelivr.net/npm/@lobehub/icons-static-svg@1.91.0/icons/openai.svg\"],html.dark #content img[src=\"https://cdn.jsdelivr.net/npm/@lobehub/icons-static-svg@1.91.0/icons/grok.svg\"]{filter:invert(1)}"}],"page":{"pagePath":"api-reference/endpoint/gpt-image-edit","slug":"/api-reference/endpoint/gpt-image-edit","pageMetadata":{"title":"GPT Image Editing","sidebarTitle":"GPT Image Editing","description":"GPT Image image editing fields, model constraints, and request examples.","api":"POST /v1/images/edits","playground":"none","og:title":"GPT Image Editing API Reference - MixRoute","href":"/api-reference/endpoint/gpt-image-edit"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"GPT Image image editing fields, model constraints, and request examples.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Info,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Edit one or more images with GPT Image using the OpenAI Images editing request format.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.code,{children:`POST https://api.mixroute.ai/v1/images/edits`})}),`\n`,_jsx(Heading,{level:`2`,id:`models`,children:`Models`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Model ID`}),_jsx(_components.th,{children:`Capabilities and Limits`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`gpt-image-2.5-flare`})}),_jsx(_components.td,{children:`Fast GPT Image 2.5 model for image generation and editing.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`gpt-image-2.5-sunburst`})}),_jsx(_components.td,{children:`GPT Image 2.5 model for precise generation, demanding edits, and detailed visual assets.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`gpt-image-2`})}),_jsx(_components.td,{children:`Generation and editing; flexible sizes; fixed high input fidelity.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`gpt-image-1.5`})}),_jsx(_components.td,{children:`Generation and editing; standard image sizes.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`gpt-image-1`})}),_jsx(_components.td,{children:`Generation and editing; standard image sizes.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`request-parameters`,children:`Request Parameters`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Required`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`model`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Yes`}),_jsx(_components.td,{children:`Complete model ID from the table above. Set it explicitly for routing.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`prompt`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Yes`}),_jsx(_components.td,{children:`Description of the desired output or edit, at most 32000 characters.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`image`})}),_jsx(_components.td,{children:`file | file[]`}),_jsx(_components.td,{children:`Yes`}),_jsxs(_components.td,{children:[`PNG, JPEG, or WebP inputs, each under 50 MB, up to 16 images. Upload files as multipart form data; repeat `,_jsx(_components.code,{children:`image[]`}),` for multiple files.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`mask`})}),_jsx(_components.td,{children:`file`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`PNG mask under 4 MB with the same pixel dimensions as the first source image. Fully transparent pixels identify the region to edit; a multi-image request applies the mask to its first image.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`input_fidelity`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`No`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`high`}),` or `,_jsx(_components.code,{children:`low`}),` for GPT Image 1/1.5. GPT Image 2 uses fixed high fidelity. Omit this optional field in the GPT Image 2.5 examples.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`n`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Number of output images, 1-10; default 1.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`size`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`No`}),_jsxs(_components.td,{children:[`Output dimensions, or `,_jsx(_components.code,{children:`auto`}),` (default). See the model-specific size rules below.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`quality`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`No`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`auto`}),` (default), `,_jsx(_components.code,{children:`low`}),`, `,_jsx(_components.code,{children:`medium`}),`, or `,_jsx(_components.code,{children:`high`}),`. GPT Image 2.5 Flare/Sunburst additionally support `,_jsx(_components.code,{children:`xhigh`}),` and `,_jsx(_components.code,{children:`max`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`background`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`No`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`auto`}),` (default), `,_jsx(_components.code,{children:`opaque`}),`, or `,_jsx(_components.code,{children:`transparent`}),`. Transparency requires PNG or WebP; support on GPT Image 2 is in preview.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`output_format`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`No`}),_jsxs(_components.td,{children:[`Encoded image format: `,_jsx(_components.code,{children:`png`}),` (default), `,_jsx(_components.code,{children:`jpeg`}),`, or `,_jsx(_components.code,{children:`webp`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`output_compression`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Compression setting from 0 to 100, default 100. Only applies to JPEG or WebP output.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`stream`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Return server-sent events when true; default false.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`partial_images`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Streaming-only partial-image count, 0-3. With 0, the final image is sent without intermediate images; fewer partial images may arrive if generation finishes early.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`user`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Stable identifier for the end user, used for abuse monitoring. Avoid raw personal information.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`size-rules`,children:`Size Rules`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Model`}),_jsx(_components.th,{children:`Allowed Sizes`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`GPT Image 1 / 1.5`}),_jsxs(_components.td,{\"data-numeric\":`true`,children:[_jsx(_components.code,{children:`auto`}),`, `,_jsx(_components.code,{children:`1024x1024`}),`, `,_jsx(_components.code,{children:`1536x1024`}),`, `,_jsx(_components.code,{children:`1024x1536`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`GPT Image 2 / 2.5`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`auto`}),` or `,_jsx(_components.code,{children:`WIDTHxHEIGHT`}),`. Both edges must be divisible by 16; each edge is at most 3840 px; long/short ratio at most 3:1; total pixels 655360-8294400.`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`GPT Image 2 resolutions above 3686400 total pixels are experimental. These GPT models return Base64 image data; do not send DALL-E-specific `,_jsx(_components.code,{children:`response_format`}),` or `,_jsx(_components.code,{children:`style`}),`.`]}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[`Use multipart/form-data, not a JSON image URL object. Let cURL or the SDK set the multipart boundary. `,_jsx(_components.code,{children:`input_fidelity=auto/medium`}),` and a top-level `,_jsx(_components.code,{children:`images`}),` JSON array are not fields of this OpenAI request.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`examples`,children:`Examples`}),`\n`,_jsxs(_components.p,{children:[`Use your MixRoute key in the `,_jsx(_components.code,{children:`MIXROUTE_API_KEY`}),` environment variable. Requests use `,_jsx(_components.code,{children:`Authorization: Bearer ...`}),`. Replace source-image placeholders with accessible images or local files before editing.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --request`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.mixroute.ai/v1/images/edits\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$MIXROUTE_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --form`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model=gpt-image-2.5-flare\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --form`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"image[]=@source.png\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --form`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"prompt=Make the mug blue while preserving its shape, lighting, and background.\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --form`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"size=1024x1024\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --form`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"quality=low\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --form`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"output_format=png\"`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`python`,children:`Python`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` base64`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` pathlib `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Path`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` openai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"MIXROUTE_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`], `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`base_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.mixroute.ai/v1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`with`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` open`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"source.png\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"rb\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` source:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` result `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.images.edit(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-image-2.5-flare\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` image`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`source,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` prompt`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Make the mug blue while preserving its shape, lighting, and background.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` size`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"1024x1024\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` quality`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"low\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` output_format`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"png\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`Path(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"edited.png\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).write_bytes(base64.b64decode(result.data[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].b64_json))`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`For masked editing, add the `,_jsx(_components.code,{children:`mask`}),` file. For multiple references, provide additional image files; a mask still applies only to the first.`]}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[`Read each image from `,_jsx(_components.code,{children:`data[].b64_json`}),` and decode it using the requested `,_jsx(_components.code,{children:`output_format`}),`. Streaming returns partial/completed image events; use the final completed event for the final file.`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.a,{href:`/api-reference/endpoint/gpt-image`,children:`GPT Image generation`})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"GPT Image Editing","sidebarTitle":"GPT Image Editing","description":"GPT Image image editing fields, model constraints, and request examples.","api":"POST /v1/images/edits","playground":"none","og:title":"GPT Image Editing API Reference - MixRoute","href":"/api-reference/endpoint/gpt-image-edit"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Models","slug":"models","depth":2,"children":[]},{"title":"Request Parameters","slug":"request-parameters","depth":2,"children":[]},{"title":"Size Rules","slug":"size-rules","depth":2,"children":[]},{"title":"Examples","slug":"examples","depth":2,"children":[{"title":"Python","slug":"python","depth":3,"children":[]}]},{"title":"Response","slug":"response","depth":2,"children":[]}],"codeExamples":{},"endpoint":{"title":"GPT Image Editing","path":"/v1/images/edits","servers":[{"url":"https://api.mixroute.ai"}],"method":"post","request":{"security":[],"parameters":{"query":{},"header":{},"cookie":{},"path":{}},"body":{}},"response":{},"deprecated":false}},"jsLinks":[],"subdomain":"personal-a5418d9f","siteName":"MixRoute","title":"GPT Image Editing API Reference - MixRoute","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/api-reference/endpoint/gpt-image-edit","matchLevel":0},"zh-Hans":{"href":"/zh-Hans/api-reference/endpoint/gpt-image-edit","matchLevel":1},"zh-Hant":{"href":"/zh-Hant/api-reference/endpoint/gpt-image-edit","matchLevel":1},"ja":{"href":"/ja/api-reference/endpoint/gpt-image-edit","matchLevel":1}}},"lastModified":"2026-11-16T03:01:26.940Z","originalFileLocation":"api-reference/endpoint/gpt-image-edit.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"GPT Image image editing fields, model constraints, and request examples.\">\u003cmeta data-mint-head name=\"application-name\" content=\"MixRoute\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/personal-a5418d9f/dv2IYF4xw-oEMCIM/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/personal-a5418d9f/dv2IYF4xw-oEMCIM/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/personal-a5418d9f/dv2IYF4xw-oEMCIM/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/personal-a5418d9f/dv2IYF4xw-oEMCIM/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/personal-a5418d9f/dv2IYF4xw-oEMCIM/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/personal-a5418d9f/dv2IYF4xw-oEMCIM/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/personal-a5418d9f/dv2IYF4xw-oEMCIM/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/personal-a5418d9f/dv2IYF4xw-oEMCIM/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/personal-a5418d9f/dv2IYF4xw-oEMCIM/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"GPT Image Editing API Reference - MixRoute\">\u003cmeta data-mint-head property=\"og:description\" content=\"GPT Image image editing fields, model constraints, and request examples.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"MixRoute\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://mixroute.ai/docs/api-reference/endpoint/gpt-image-edit\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://personal-a5418d9f.mintlify.site/docs/_mintlify/api/og/v2?division=Image+Series\u0026amp;title=GPT+Image+Editing\u0026amp;description=GPT+Image+image+editing+fields%2C+model+constraints%2C+and+request+examples.\u0026amp;theme=4006ee24882b0e4bcca4d898\u0026amp;signature=436ed09b1df29cfd2e4f3a5399e17b6a7b38921a96a4125082632b854d27cc19\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"GPT Image Editing API Reference - MixRoute\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"GPT Image image editing fields, model constraints, and request examples.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://personal-a5418d9f.mintlify.site/docs/_mintlify/api/og/v2?division=Image+Series\u0026amp;title=GPT+Image+Editing\u0026amp;description=GPT+Image+image+editing+fields%2C+model+constraints%2C+and+request+examples.\u0026amp;theme=4006ee24882b0e4bcca4d898\u0026amp;signature=436ed09b1df29cfd2e4f3a5399e17b6a7b38921a96a4125082632b854d27cc19\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/personal-a5418d9f/dv2IYF4xw-oEMCIM/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"MixRoute\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#7B1FA2\">\u003clink data-mint-head rel=\"canonical\" href=\"https://mixroute.ai/docs/api-reference/endpoint/gpt-image-edit\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/api-reference/endpoint/gpt-image-edit.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://mixroute.ai/docs/api-reference/endpoint/gpt-image-edit\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-Hans\" href=\"https://mixroute.ai/docs/zh-Hans/api-reference/endpoint/gpt-image-edit\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-Hant\" href=\"https://mixroute.ai/docs/zh-Hant/api-reference/endpoint/gpt-image-edit\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ja\" href=\"https://mixroute.ai/docs/ja/api-reference/endpoint/gpt-image-edit\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://mixroute.ai/docs/api-reference/endpoint/gpt-image-edit\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://mixroute.ai/#organization\",\"name\":\"MixRoute\",\"url\":\"https://mixroute.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/personal-a5418d9f/gmsYcyD3CEVDrHlx/logo/mixroute_logo_light.svg?fit=max\u0026auto=format\u0026n=gmsYcyD3CEVDrHlx\u0026q=85\u0026s=265a1a46d074895bd39b660678e01cd8\"}},{\"@type\":\"WebSite\",\"@id\":\"https://mixroute.ai/docs#website\",\"name\":\"MixRoute\",\"url\":\"https://mixroute.ai/docs\",\"publisher\":{\"@id\":\"https://mixroute.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://mixroute.ai/docs/api-reference/endpoint/gpt-image-edit#webpage\",\"url\":\"https://mixroute.ai/docs/api-reference/endpoint/gpt-image-edit\",\"name\":\"GPT Image Editing\",\"description\":\"GPT Image image editing fields, model constraints, and request examples.\",\"dateModified\":\"2026-11-16T03:01:26.940Z\",\"isPartOf\":{\"@id\":\"https://mixroute.ai/docs#website\"},\"breadcrumb\":{\"@id\":\"https://mixroute.ai/docs/api-reference/endpoint/gpt-image-edit#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://mixroute.ai/docs/api-reference/endpoint/gpt-image-edit#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Image Series\",\"item\":\"https://mixroute.ai/docs/api-reference/endpoint/image-generation\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"GPT Image Editing\",\"item\":\"https://mixroute.ai/docs/api-reference/endpoint/gpt-image-edit\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://mixroute.ai/docs/api-reference/endpoint/gpt-image-edit#apireference\",\"headline\":\"GPT Image Editing\",\"name\":\"GPT Image Editing\",\"description\":\"GPT Image image editing fields, model constraints, and request examples.\",\"url\":\"https://mixroute.ai/docs/api-reference/endpoint/gpt-image-edit\",\"mainEntityOfPage\":{\"@id\":\"https://mixroute.ai/docs/api-reference/endpoint/gpt-image-edit#webpage\"},\"dateModified\":\"2026-11-16T03:01:26.940Z\",\"publisher\":{\"@id\":\"https://mixroute.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://mixroute.ai/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"MixRoute\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"MixRoute\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/api-reference/endpoint/gpt-image-edit.md","siteName":"MixRoute","nav":{"global":null,"languages":[{"language":"en","default":true,"tabs":[{"tab":"Home","pages":[{"title":"Home","href":"/introduction"}]},{"tab":"API Reference","groups":[{"group":"Popular Models","pages":[{"title":"Popular Models","href":"/api-reference/models"}]},{"group":"OpenAI SDK Usage","pages":[{"title":"OpenAI SDK Usage","href":"/api-reference/openai-sdk"}]},{"group":"System API","icon":"server","pages":[{"title":"Authentication and Quota","sidebarTitle":"Authentication and Quota","icon":{"name":"shield-keyhole","library":"lucide"},"href":"/api-reference/system-api/authentication-and-quota"},{"title":"API Key Management","sidebarTitle":"API Key Management","icon":{"name":"key","library":"lucide"},"href":"/api-reference/system-api/api-key-management"},{"title":"Smart Routing API","sidebarTitle":"Smart Routing API","icon":{"name":"route","library":"lucide"},"href":"/api-reference/system-api/smart-routing"},{"title":"Billing and Auto-Recharge","sidebarTitle":"Billing and Auto-Recharge","icon":"https://d3gk2c5xim1je2.cloudfront.net/fontawesome/v7.2.0/solid/wallet.svg","href":"/api-reference/system-api/billing-and-auto-recharge"},{"title":"User Logs \u0026 Usage Statistics","icon":{"name":"book-open","library":"lucide"},"api":"GET /api/log/self","hideApiMarker":true,"href":"/api-reference/endpoint/user-logs"}]},{"group":"Text Series","pages":[{"title":"Gemini Native (Text)","api":"POST /v1beta/models/{model}:generateContent","sidebarTitle":"Gemini Text","href":"/api-reference/endpoint/gemini-native"},{"title":"Chat Completions (OpenAI)","api":"POST /v1/chat/completions","sidebarTitle":"Chat Completions","href":"/api-reference/endpoint/chat-openai"},{"title":"Create Responses Request (OpenAI)","api":"POST /v1/responses","sidebarTitle":"Responses","href":"/api-reference/endpoint/responses-openai"},{"title":"Create Messages (Claude)","api":"POST /v1/messages","sidebarTitle":"Claude Messages","href":"/api-reference/endpoint/messages"},{"title":"Count Tokens (Claude)","api":"POST /v1/messages/count_tokens","sidebarTitle":"Claude Token Count","href":"/api-reference/endpoint/count-tokens"},{"title":"Document Reranking","sidebarTitle":"Rerank","api":"POST /v1/rerank","playground":"none","hidden":false,"href":"/api-reference/endpoint/rerank"}]},{"group":"Decision Models","icon":"list-check","pages":[{"title":"Jev Decisions","sidebarTitle":"Jev Decisions","api":"POST /typesafe/v1/systemone","playground":"none","href":"/api-reference/endpoint/jev"},{"title":"OpenAI Decisions API","sidebarTitle":"OpenAI Decisions","api":"POST /v1/decisions","playground":"none","href":"/api-reference/endpoint/decisions"},{"title":"Google Decisions API","sidebarTitle":"Google Decisions","api":"POST /v1beta/decisions","playground":"none","href":"/api-reference/endpoint/google-decisions"}]},{"group":"Embedding Series","pages":[{"title":"Text Embeddings","api":"POST /v1/embeddings","sidebarTitle":"Text Embeddings","href":"/api-reference/endpoint/embeddings"},{"title":"Gemini Text Embedding (embedContent)","api":"POST /v1/models/{model}:embedContent","sidebarTitle":"Gemini Embeddings","href":"/api-reference/endpoint/gemini-embed-content"}]},{"group":"Image Series","pages":[{"title":"Image API Overview","api":"POST /v1/images/generations","sidebarTitle":"Overview","hideApiMarker":true,"playground":"none","href":"/api-reference/endpoint/image-generation"},{"title":"Seedream 5.5","sidebarTitle":"Seedream 5.5","api":"POST /v1/images/generations","playground":"none","href":"/api-reference/endpoint/seedream"},{"title":"GPT Image","sidebarTitle":"GPT Image","description":"GPT Image image generation fields, model constraints, and request examples.","api":"POST /v1/images/generations","playground":"none","href":"/api-reference/endpoint/gpt-image"},{"title":"GPT Image Editing","sidebarTitle":"GPT Image Editing","api":"POST /v1/images/edits","playground":"none","href":"/api-reference/endpoint/gpt-image-edit"},{"title":"Grok Imagine","sidebarTitle":"Grok Imagine","description":"Grok Imagine image generation fields, model constraints, and request examples.","api":"POST /v1/images/generations","playground":"none","href":"/api-reference/endpoint/grok-imagine-image"},{"title":"Grok Imagine Editing","sidebarTitle":"Grok Imagine Editing","api":"POST /v1/images/edits","playground":"none","href":"/api-reference/endpoint/grok-imagine-edit"},{"title":"Qwen Image","sidebarTitle":"Qwen Image","api":"POST /v1/images/generations","playground":"none","href":"/api-reference/endpoint/qwen-image"},{"title":"Qwen Image Editing","sidebarTitle":"Qwen Image Editing","api":"POST /v1/images/generations","playground":"none","href":"/api-reference/endpoint/qwen-image-edit"},{"title":"Gemini Native (Image)","api":"POST /v1/models/{model}:generateContent","sidebarTitle":"Gemini Images","playground":"none","href":"/api-reference/endpoint/nano-banana"},{"title":"Gemini Native (Image, Streaming)","api":"POST /v1/models/{model}:streamGenerateContent","sidebarTitle":"Gemini Image Stream","playground":"none","href":"/api-reference/endpoint/nano-banana-stream"}]},{"group":"Video Series","pages":[{"title":"Video API Overview","api":"POST /v1/video/generations","sidebarTitle":"Overview","hideApiMarker":true,"href":"/api-reference/endpoint/submit-video-task"},{"title":"Seedance","sidebarTitle":"Seedance","api":"POST /v1/video/generations","playground":"none","href":"/api-reference/endpoint/seedance"},{"title":"Doubao","sidebarTitle":"Doubao","api":"POST /v1/video/generations","playground":"none","href":"/api-reference/endpoint/doubao"},{"title":"Dreamina","sidebarTitle":"Dreamina","api":"POST /v1/video/generations","playground":"none","href":"/api-reference/endpoint/dreamina"},{"title":"Wan","sidebarTitle":"Wan","api":"POST /v1/video/generations","playground":"none","href":"/api-reference/endpoint/wan"},{"title":"Veo","api":"POST /v1/video/generations","sidebarTitle":"Veo","playground":"none","href":"/api-reference/endpoint/veo"},{"title":"MiniMax H3","sidebarTitle":"MiniMax H3","api":"POST /v1/video/generations","playground":"none","href":"/api-reference/endpoint/minimax-h3"},{"group":"Kling","icon":"film","pages":[{"title":"Kling Overview","sidebarTitle":"Overview","href":"/api-reference/endpoint/kling"},{"title":"Kling Text to Video","sidebarTitle":"Text to Video","api":"POST /kling/text-to-video/{model}","playground":"none","href":"/api-reference/endpoint/kling-text-to-video"},{"title":"Kling Image to Video","sidebarTitle":"Image to Video","api":"POST /kling/image-to-video/{model}","playground":"none","href":"/api-reference/endpoint/kling-image-to-video"},{"title":"Kling Omni Generation and Editing","sidebarTitle":"Omni Generation and Editing","api":"POST /kling/omni-video/{model}","playground":"none","href":"/api-reference/endpoint/kling-omni-video"},{"title":"Kling Motion Control","sidebarTitle":"Motion Control","api":"POST /kling/motion-control/{model}","playground":"none","href":"/api-reference/endpoint/kling-motion-control"},{"title":"Query Kling Task","sidebarTitle":"Query Kling Task","api":"GET /kling/tasks","playground":"none","href":"/api-reference/endpoint/kling-tasks"}]},{"title":"Query Video Task","api":"GET /v1/video/generations/{task_id}","href":"/api-reference/endpoint/query-video-task"},{"title":"Download Video","api":"GET /v1/video/generations/download","href":"/api-reference/endpoint/download-video"}]},{"group":"Others","pages":[{"title":"List Models","api":"GET /v1/models","href":"/api-reference/endpoint/list-models"},{"title":"Gemini Live","api":"WSS /v1beta/models/{model}/liveStream","hidden":true,"href":"/api-reference/endpoint/gemini-live"}]}]},{"tab":"Smart Routing","pages":[{"title":"Smart Routing","href":"/api-reference/smart-routing"}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/integrations/lobehub"}]},{"tab":"FAQ","pages":[{"title":"FAQ","href":"/faq/model-changing"}]}]},{"language":"zh-Hans","pages":[{"title":"zh-Hans","href":"/zh-Hans/api-reference/endpoint/gpt-image-edit"}]},{"language":"zh-Hant","pages":[{"title":"zh-Hant","href":"/zh-Hant/api-reference/endpoint/gpt-image-edit"}]},{"language":"ja","pages":[{"title":"ja","href":"/ja/api-reference/endpoint/gpt-image-edit"}]}]},"basePath":"","title":"GPT Image Editing API Reference - MixRoute","deploymentId":"dpl_J2QdBVuN65x4CCtpqPb371YPt4xi","buildId":"dpl_J2QdBVuN65x4CCtpqPb371YPt4xi","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-tiVafkWW.js","utils-CURQcKis.js","cloneDeep-D7WNbvHt.js","_Uint8Array-BY_XlfVz.js","isObject-FP1Yky1u.js","utils-CdFTKPRO.js","addUniqueKeysToSchema-BSfwE63N.js","snippetPresets-BHyg8yZ0.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-CQdVXSju.js","isEqual-ft5OxoSH.js","usePlaygroundInputsStore-BILH4rrw.js","shallow-DterCiSU.js","getApiPlaygroundDisplay-uFtORr6j.js","CodeSnippet-BeuhEvUS.js","CodeSnippets-laCoJsvn.js","Page-CTsmHnLF.js","getPastedJson-DOT1n5Lt.js","icon-COH-nmcZ.js","MethodPill-BbAWkCf6.js","DuplicateIcon-CpagiAFQ.js","createIcon-Bw2Dnowf.js","DynamicMarkdown-DzuINhDe.js","SectionHeading-B3H20qI6.js","axios-vUo_bRtp.js"]}