Models like Nano Banana (Gemini Image) support edits — provide a source image + prompt.
This endpoint takes JSON with a base64 image, not multipart/form-data. The OpenAI SDK’s client.images.edit(...) sends multipart and will not work against it — call it over plain HTTP as below.
curl https://api.infery.ai/v1/images/edits \ -H "Authorization: Bearer $INFERY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "nano-banana", "prompt": "Replace the background with a tropical beach", "image_base64": "<base64 of source image>", "image_mime_type": "image/png" }'
image_mime_type defaults to image/png. An optional mask_base64 (transparent = the region to repaint) enables in-painting where the model supports a mask.
Image-edit capability is model-dependent, and it is decided per source rather than per model: a request routed to a source that takes no input image is refused with 400 edit_not_supported before anything is billed. See Models catalog for which models edit.
Output quality. Checked against the chosen model's own input schema — refused with 400 when that schema is the provider's own and the value is not in it, snapped for a synthesized schema, and dropped for a model that declares no quality at all. OpenAI's standard/hd and GPT Image's low/medium/high/auto are two such sets among many; read the one that applies from GET /v1/models.
What it does on THIS endpoint is select a price, not a rendering: the credit hold and the settle look the image price up by quality, and no edit path forwards the value to a provider (OpenAI's edit is a multipart form that omits it; the FAL and Replicate input mappers exclude it). On POST /v1/images/generations it reaches the provider and changes the image. Declared here because the endpoint accepts, validates and bills on it.
Aspect ratio of the edited image. Honoured by every edit-capable provider that has a field for it — Google Imagen (aspectRatio), Replicate and FAL — and dropped for a model that has none. For a model with a stored input schema the value is checked against that schema's own enum and refused with 400 if it is not a member, so read the allowed set from GET /v1/models rather than assuming a fixed list.
How much the source image steers the result — lower keeps more of the original, higher follows the prompt more freely. Clamped to the range the chosen model's own input schema declares (0–1 on every model that exposes it today) and dropped entirely for a model that does not, so it is silently inert rather than an error on the models that ignore it.
REQUIRED by some models and absent from most: luma-photon-modify and luma-photon-flash-modify will not run an edit without it. It is not marked required here because this one operation is shared by every edit-capable model, the large majority of which neither need nor accept it — check the chosen model's schema in GET /v1/models.
Output resolution for the models that size their output by label rather than by pixels (Imagen Standard/Ultra 1K|2K, Gemini 3 image 1K|2K|4K) — the same field POST /v1/images/generations takes. Checked against the chosen model's own input schema and dropped for a model that does not declare it.
Unlike quality above it is carried through on the edit paths that have a field for it (Gemini as imageSize, xAI as resolution). It is also a BILLING dimension: with no size sent, this is what the image price is looked up by.
Style hint. Checked against the chosen model's own input schema — refused with 400 when that schema is the provider's own and the value is not in it, and dropped for a model that declares no style. Read the allowed set from GET /v1/models rather than assuming DALL-E's vivid/natural.
INERT on this endpoint, like quality: no edit path forwards it to a provider. Declared because the endpoint accepts and validates it — sending an unacceptable value is a 400 you would otherwise meet without warning.
Background treatment — GPT Image's transparent/opaque/auto is one model family's set, not this endpoint's. Checked against the chosen model's own input schema and dropped for a model that declares no background. INERT here for the same reason as style above: no edit path forwards it. On POST /v1/images/generations it does reach GPT Image and change the result.
Person-generation policy. Accepted and validated here — any other value is refused with 400 — but unlike POST /v1/images/generations, no edit-capable provider currently forwards it upstream, so on this endpoint it constrains what you may send without changing what you get back.
Diffusion steps. Validated and priced here exactly as on POST /v1/images/generations — a whole number in 1–100 or a 400, and on a per-megapixel model the price is multiplied by max(1, steps ÷ the model's default steps).
INERT as a rendering control on this endpoint, like quality and style above: no edit path forwards it to a provider. Declared because sending an out-of-range value is a 400, and sending an in-range one can raise what the edit costs.
Prompt rewriting. Reaches no provider from this endpoint — the edit request object has no such field — but it is read by the shared price-parameter builder, which uses it to pick z-image-turbo's extend (absent or true) or noextend (false) rate. So on this route it selects a price and nothing else.
Credits actually settled for this request (1 credit = $0.01). May be fractional.
Example:
40
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Infery.ai","colors":{"primary":"#2E5BE8","light":"#7B99F2","dark":"#1F41B0"},"logo":{"light":"https://mintcdn.com/inferyai/0Jgb47bSQtZI-re9/brand/logo-light.svg?fit=max\u0026auto=format\u0026n=0Jgb47bSQtZI-re9\u0026q=85\u0026s=d3ebed9120aa8e785f372aa43a7cccf3","dark":"https://mintcdn.com/inferyai/0Jgb47bSQtZI-re9/brand/logo-dark.svg?fit=max\u0026auto=format\u0026n=0Jgb47bSQtZI-re9\u0026q=85\u0026s=da2c52e6d74e21413d1e79df66776bb3"},"favicon":"https://mintcdn.com/inferyai/rVSpR6coVFjanvjI/brand/icon.svg?fit=max\u0026auto=format\u0026n=rVSpR6coVFjanvjI\u0026q=85\u0026s=9fa7355d4fc03bbe56cb42824f82e371","background":{"color":{"light":"#FFFFFF","dark":"#08090B"}},"navbar":{"links":[{"href":"https://app.infery.ai","label":"Studio"},{"href":"https://infery.ai/pricing","label":"Pricing"}],"primary":{"type":"button","label":"Sign in","href":"https://app.infery.ai/login"}},"footer":{"socials":{"website":"https://infery.ai","x":"https://x.com/infery_ai","github":"https://github.com/infery-ai"}},"seo":{"metatags":{"og:site_name":"Infery.ai Docs","og:type":"website","og:image":"https://docs.infery.ai/brand/og.jpg","twitter:card":"summary_large_image","twitter:site":"@infery_ai","robots":"index, follow"},"indexing":"all"},"fonts":{"heading":{"family":"Bricolage Grotesque","weight":700},"body":{"family":"IBM Plex Sans","weight":400}},"integrations":{"gtm":{"tagId":"GTM-P3237J9B"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"inferyai","hasAudioNarration":false,"actualSubdomain":"inferyai","customDomains":["docs.infery.ai"],"gitSource":{"type":"github","owner":"infery-ai","repo":"infery-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ac0d01453c5cd08031ddef8","collectionId":"e9cbfa7c-70b0-4c88-a370-6174686c606c","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ac0d01453c5cd08031ddef8"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ac0d01453c5cd08031ddef8","clientVersion":"0.0.3965","searchFilterCounts":[{"language":"default","tag":"Guides","count":85},{"language":"default","tag":"API Reference","count":38},{"language":"default","tag":"Workflows","count":20},{"language":"default","tag":"Models","count":17},{"language":"default","tag":"Studio","count":10},{"language":"default","tag":"Tools","count":8},{"language":"default","tag":"SDKs","count":6},{"language":"default","tag":"Files","count":5},{"language":"default","tag":"Workspaces","count":5},{"language":"default","tag":"Overview","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","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":"editor-v7-file-tree","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":"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":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","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":"per-site-search-delta","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":"editor-private-page-search","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":"editor-nav-generations","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":"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":"byok-sep-25","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":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","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}],"isAtlas":false,"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"api-reference/images/edits","slug":"/api-reference/images/edits","pageMetadata":{"title":"Edit an image","description":"POST /v1/images/edits — modify an existing image with a prompt.","openapi":"openapi.json POST /v1/images/edits","href":"/api-reference/images/edits"},"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: \"POST /v1/images/edits — modify an existing image with a prompt.\"\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`,em:`em`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{CodeBlock,Frame,Heading,OptimizedImage,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Models like Nano Banana (Gemini Image) support edits — provide a source image + prompt.`}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`This endpoint takes `,_jsx(_components.strong,{children:`JSON with a base64 image`}),`, not `,_jsx(_components.code,{children:`multipart/form-data`}),`. The OpenAI SDK’s `,_jsx(_components.code,{children:`client.images.edit(...)`}),` sends multipart and will not work against it — call it over plain HTTP as below.`]})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,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:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.infery.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:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$INFERY_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:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_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:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"nano-banana\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"prompt\": \"Replace the background with a tropical beach\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"image_base64\": \"\u003cbase64 of source image>\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"image_mime_type\": \"image/png\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`image_mime_type`}),` defaults to `,_jsx(_components.code,{children:`image/png`}),`. An optional `,_jsx(_components.code,{children:`mask_base64`}),` (transparent = the region to repaint) enables in-painting where the model supports a mask.`]}),`\n`,_jsx(Heading,{level:`3`,id:`sample-output`,children:`Sample output`}),`\n`,_jsx(Frame,{caption:`Source image — autumn Japanese garden`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/inferyai/5YDpMTITcUUspdCA/samples/image.png?fit=max\u0026auto=format\u0026n=5YDpMTITcUUspdCA\u0026q=85\u0026s=2f7c6a22252e41004c0e7d721f028888`,alt:`Source image before edit`,\"data-og-width\":`1024`,width:`1024`,\"data-og-height\":`1024`,height:`1024`,\"data-path\":`samples/image.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/inferyai/5YDpMTITcUUspdCA/samples/image.png?w=280\u0026fit=max\u0026auto=format\u0026n=5YDpMTITcUUspdCA\u0026q=85\u0026s=df4f6adf94507c896d99882f8c0cf74c 280w, https://mintcdn.com/inferyai/5YDpMTITcUUspdCA/samples/image.png?w=560\u0026fit=max\u0026auto=format\u0026n=5YDpMTITcUUspdCA\u0026q=85\u0026s=40d82b0255b096212281cd366118ca1e 560w, https://mintcdn.com/inferyai/5YDpMTITcUUspdCA/samples/image.png?w=840\u0026fit=max\u0026auto=format\u0026n=5YDpMTITcUUspdCA\u0026q=85\u0026s=44006d2283cf4009da81b23b0e4d37f6 840w, https://mintcdn.com/inferyai/5YDpMTITcUUspdCA/samples/image.png?w=1100\u0026fit=max\u0026auto=format\u0026n=5YDpMTITcUUspdCA\u0026q=85\u0026s=468657087396c6bde0d94c8067e6163a 1100w, https://mintcdn.com/inferyai/5YDpMTITcUUspdCA/samples/image.png?w=1650\u0026fit=max\u0026auto=format\u0026n=5YDpMTITcUUspdCA\u0026q=85\u0026s=2921ed44e661697ab1b52fac5ffc6b0c 1650w, https://mintcdn.com/inferyai/5YDpMTITcUUspdCA/samples/image.png?w=2500\u0026fit=max\u0026auto=format\u0026n=5YDpMTITcUUspdCA\u0026q=85\u0026s=9287b718bc9ace3e367614eb23f840c6 2500w`})}),`\n`,_jsx(Frame,{caption:`Edited: 'Transform this into a snowy winter wonderland — keep the layout intact.' (nano-banana)`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/inferyai/5YDpMTITcUUspdCA/samples/image-edit.png?fit=max\u0026auto=format\u0026n=5YDpMTITcUUspdCA\u0026q=85\u0026s=835e681979410038634eb22d3ad3f7d2`,alt:`Image after edit`,\"data-og-width\":`1024`,width:`1024`,\"data-og-height\":`1024`,height:`1024`,\"data-path\":`samples/image-edit.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/inferyai/5YDpMTITcUUspdCA/samples/image-edit.png?w=280\u0026fit=max\u0026auto=format\u0026n=5YDpMTITcUUspdCA\u0026q=85\u0026s=d449d6d70950ec52cbe814312b64fce8 280w, https://mintcdn.com/inferyai/5YDpMTITcUUspdCA/samples/image-edit.png?w=560\u0026fit=max\u0026auto=format\u0026n=5YDpMTITcUUspdCA\u0026q=85\u0026s=01941a79550316a1d2ded4429f3563a5 560w, https://mintcdn.com/inferyai/5YDpMTITcUUspdCA/samples/image-edit.png?w=840\u0026fit=max\u0026auto=format\u0026n=5YDpMTITcUUspdCA\u0026q=85\u0026s=f396f79c0d9974e7e06240181852c94d 840w, https://mintcdn.com/inferyai/5YDpMTITcUUspdCA/samples/image-edit.png?w=1100\u0026fit=max\u0026auto=format\u0026n=5YDpMTITcUUspdCA\u0026q=85\u0026s=bc57bd2b24ecc74490f81f2e740df212 1100w, https://mintcdn.com/inferyai/5YDpMTITcUUspdCA/samples/image-edit.png?w=1650\u0026fit=max\u0026auto=format\u0026n=5YDpMTITcUUspdCA\u0026q=85\u0026s=5c1be7a05d977c2a6799e6525f42ca7b 1650w, https://mintcdn.com/inferyai/5YDpMTITcUUspdCA/samples/image-edit.png?w=2500\u0026fit=max\u0026auto=format\u0026n=5YDpMTITcUUspdCA\u0026q=85\u0026s=3c86af0b8f9bc9f47517a470d5b12af7 2500w`})}),`\n`,_jsx(_components.p,{children:_jsxs(_components.em,{children:[`Image-edit output format matches `,_jsx(_components.a,{href:`/api-reference/images/generations`,children:`image generation`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`supported-models`,children:`Supported models`}),`\n`,_jsxs(_components.p,{children:[`Image-edit capability is model-dependent, and it is decided per source rather than per model: a request routed to a source that takes no input image is refused with `,_jsx(_components.code,{children:`400 edit_not_supported`}),` before anything is billed. See `,_jsx(_components.a,{href:`/models/catalog`,children:`Models catalog`}),` for which models edit.`]})]})}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":"Edit an image","description":"POST /v1/images/edits — modify an existing image with a prompt.","openapi":"openapi.json POST /v1/images/edits","href":"/api-reference/images/edits"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Sample output","slug":"sample-output","depth":3,"children":[]},{"title":"Supported models","slug":"supported-models","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"createImageEdit","parameters":[],"requestBody":"5c2b50ec-6904-4dd4-a1e9-53354975f318","responses":{"200":"28a988bf-7308-4734-abaa-b467114d9893","400":"160aa6c3-2f3d-4ef1-b509-eade67f4ba60","401":"6eb9411d-6627-4ae4-bf56-daae178fa9f6","404":"f92a376e-84b2-4214-ab75-9440e0964831"},"security":["4e49b2dc-dbce-4c17-9a6e-b7b57051b518"],"summary":"Edit an existing image","tags":["Images"],"method":"post","type":"path","servers":["70c58c78-558b-477f-817f-fa094a9f1354","250da9ba-2678-444c-bc3b-e169d87db6d0"],"path":"/v1/images/edits","baseUrlOptions":["https://api.infery.ai","http://localhost:3001"],"title":"Edit an existing image","description":"POST /v1/images/edits — modify an existing image with a prompt.","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","prompt","image_base64"],"properties":{"model":{"type":"string","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"prompt":{"type":"string","description":"Edit instruction","isRequired":true,"uniqueKey":"prompt","typeLabel":"string"},"image_base64":{"type":"string","description":"Base64-encoded source image","isRequired":true,"uniqueKey":"image_base64","typeLabel":"string"},"image_mime_type":{"type":"string","default":"image/png","uniqueKey":"image_mime_type","typeLabel":"string"},"mask_base64":{"type":"string","description":"Base64-encoded mask (transparent area = edit region)","uniqueKey":"mask_base64","typeLabel":"string"},"mask_mime_type":{"type":"string","default":"image/png","uniqueKey":"mask_mime_type","typeLabel":"string"},"n":{"type":"integer","default":1,"uniqueKey":"n","typeLabel":"integer"},"size":{"type":"string","example":"1024x1024","description":"Must be one of the sizes the chosen model declares (`GET /v1/models`). Refused with 400 otherwise.","uniqueKey":"size","typeLabel":"string"},"quality":{"type":"string","example":"high","description":"Output quality. Checked against the chosen model's own input schema — refused with 400 when that schema is the provider's own and the value is not in it, snapped for a synthesized schema, and dropped for a model that declares no `quality` at all. OpenAI's `standard`/`hd` and GPT Image's `low`/`medium`/`high`/`auto` are two such sets among many; read the one that applies from `GET /v1/models`.\n\nWhat it does on THIS endpoint is select a price, not a rendering: the credit hold and the settle look the image price up by quality, and no edit path forwards the value to a provider (OpenAI's edit is a multipart form that omits it; the FAL and Replicate input mappers exclude it). On `POST /v1/images/generations` it reaches the provider and changes the image. Declared here because the endpoint accepts, validates and bills on it.","uniqueKey":"quality","typeLabel":"string"},"aspect_ratio":{"type":"string","example":"16:9","description":"Aspect ratio of the edited image. Honoured by every edit-capable provider that has a field for it — Google Imagen (`aspectRatio`), Replicate and FAL — and dropped for a model that has none. For a model with a stored input schema the value is checked against that schema's own enum and refused with 400 if it is not a member, so read the allowed set from `GET /v1/models` rather than assuming a fixed list.","uniqueKey":"aspect_ratio","typeLabel":"string"},"strength":{"type":"number","example":0.35,"description":"How much the source image steers the result — lower keeps more of the original, higher follows the prompt more freely. Clamped to the range the chosen model's own input schema declares (0–1 on every model that exposes it today) and dropped entirely for a model that does not, so it is silently inert rather than an error on the models that ignore it.\n\nREQUIRED by some models and absent from most: `luma-photon-modify` and `luma-photon-flash-modify` will not run an edit without it. It is not marked required here because this one operation is shared by every edit-capable model, the large majority of which neither need nor accept it — check the chosen model's schema in `GET /v1/models`.","uniqueKey":"strength","typeLabel":"number"},"image_size":{"type":"string","example":"2K","description":"Output resolution for the models that size their output by label rather than by pixels (Imagen Standard/Ultra `1K`|`2K`, Gemini 3 image `1K`|`2K`|`4K`) — the same field `POST /v1/images/generations` takes. Checked against the chosen model's own input schema and dropped for a model that does not declare it.\n\nUnlike `quality` above it is carried through on the edit paths that have a field for it (Gemini as `imageSize`, xAI as `resolution`). It is also a BILLING dimension: with no `size` sent, this is what the image price is looked up by.","uniqueKey":"image_size","typeLabel":"string"},"style":{"type":"string","example":"natural","description":"Style hint. Checked against the chosen model's own input schema — refused with 400 when that schema is the provider's own and the value is not in it, and dropped for a model that declares no `style`. Read the allowed set from `GET /v1/models` rather than assuming DALL-E's `vivid`/`natural`.\n\nINERT on this endpoint, like `quality`: no edit path forwards it to a provider. Declared because the endpoint accepts and validates it — sending an unacceptable value is a 400 you would otherwise meet without warning.","uniqueKey":"style","typeLabel":"string"},"background":{"type":"string","example":"transparent","description":"Background treatment — GPT Image's `transparent`/`opaque`/`auto` is one model family's set, not this endpoint's. Checked against the chosen model's own input schema and dropped for a model that declares no `background`. INERT here for the same reason as `style` above: no edit path forwards it. On `POST /v1/images/generations` it does reach GPT Image and change the result.","uniqueKey":"background","typeLabel":"string"},"person_generation":{"type":"string","enum":["dont_allow","allow_adult","allow_all"],"description":"Person-generation policy. Accepted and validated here — any other value is refused with 400 — but unlike `POST /v1/images/generations`, no edit-capable provider currently forwards it upstream, so on this endpoint it constrains what you may send without changing what you get back.","uniqueKey":"person_generation","typeLabel":"enum\u003cstring>"},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","uniqueKey":"response_format","typeLabel":"enum\u003cstring>"},"steps":{"type":"integer","minimum":1,"maximum":100,"example":4,"description":"Diffusion steps. Validated and priced here exactly as on `POST /v1/images/generations` — a whole number in 1–100 or a 400, and on a per-megapixel model the price is multiplied by `max(1, steps ÷ the model's default steps)`.\n\nINERT as a rendering control on this endpoint, like `quality` and `style` above: no edit path forwards it to a provider. Declared because sending an out-of-range value is a 400, and sending an in-range one can raise what the edit costs.","uniqueKey":"steps","typeLabel":"integer"},"prompt_extend":{"type":"boolean","example":false,"description":"Prompt rewriting. Reaches no provider from this endpoint — the edit request object has no such field — but it is read by the shared price-parameter builder, which uses it to pick `z-image-turbo`'s `extend` (absent or `true`) or `noextend` (`false`) rate. So on this route it selects a price and nothing else.","uniqueKey":"prompt_extend","typeLabel":"boolean"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"model":"\u003cstring>","prompt":"\u003cstring>","image_base64":"\u003cstring>","image_mime_type":"image/png","mask_base64":"\u003cstring>","mask_mime_type":"image/png","n":1,"size":"1024x1024","quality":"high","aspect_ratio":"16:9","strength":0.35,"image_size":"2K","style":"natural","background":"transparent","response_format":"url","steps":4,"prompt_extend":false}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"28a988bf-7308-4734-abaa-b467114d9893":{"description":"Image edit result","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"integer","description":"Unix timestamp, in seconds, of when the result was produced.","example":1713204900,"isRequired":true,"uniqueKey":"created","typeLabel":"integer"},"data":{"description":"One entry per produced image, in the order the provider returned them.","type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"Provider-hosted download URL for this image. Ephemeral — these expire in roughly an hour, so download or copy the bytes promptly rather than storing the URL. Absent when the model answered with inline bytes instead (`b64_json`), which is why this is OPTIONAL here while `MediaArtifactDto.url` is required: `ImageResult` (`providers/image-types.ts`) declares all of `url`/`b64_json`/`revised_prompt` optional, and each direct provider populates whichever the request asked for.","example":"https://example.com/image.png","uniqueKey":"data.items.[INDEX].url","typeLabel":"string"},"b64_json":{"type":"string","description":"Inline base64-encoded image bytes. Present when `response_format=b64_json` was asked for, and always for the GPT Image models, which return bytes exclusively.","uniqueKey":"data.items.[INDEX].b64_json","typeLabel":"string"},"revised_prompt":{"type":"string","description":"The prompt as the model rewrote it (DALL·E 3; the Google models echo the request prompt here).","uniqueKey":"data.items.[INDEX].revised_prompt","typeLabel":"string"},"file_id":{"type":"string","description":"Identifier of the durable `ApiFile` this image was registered as, usable with `GET /v1/files/{fileId}` and `GET /v1/files/{fileId}/content`. Only produced on the media-job path, and omitted (never null) for an artifact whose registration failed — registration is bookkeeping and never blocks or reshapes the deliverable. Registered bytes count towards the workspace storage quota.","example":"file_1hR9xTPZqK4mVLc2nJ7fY5wB","uniqueKey":"data.items.[INDEX].file_id","typeLabel":"string"}},"uniqueKey":"data.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"data","typeLabel":"object[]"},"credits_used":{"type":"number","description":"Credits actually settled for this request (1 credit = $0.01). May be fractional.","example":40,"isRequired":true,"uniqueKey":"credits_used","typeLabel":"number"}},"required":["created","data","credits_used"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"created":1713204900,"data":[{"url":"https://example.com/image.png","b64_json":"\u003cstring>","revised_prompt":"\u003cstring>","file_id":"file_1hR9xTPZqK4mVLc2nJ7fY5wB"}],"credits_used":40}}},"exampleType":"generated"}},"exampleType":"generated"},"160aa6c3-2f3d-4ef1-b509-eade67f4ba60":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","description":"The error envelope. Every non-2xx response from this API has this shape, so a client can parse failures without branching on the endpoint.","required":["message","type","code","param"],"properties":{"message":{"type":"string","example":"Model not found","description":"Human-readable error message","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","example":"invalid_request_error","description":"Error category","enum":["invalid_request_error","authentication_error","permission_error","quota_exceeded","rate_limit_error","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"oneOf":[{"type":"string","example":"model_not_found","description":"Stable machine-readable error code. Branch on this rather than on `message`, which is prose and may be reworded.","isRequired":true,"uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","example":"model_not_found","description":"Stable machine-readable error code. Branch on this rather than on `message`, which is prose and may be reworded.","isRequired":true,"uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","example":"model","description":"Name of the request parameter that triggered the error. `null` when the error is not attributable to one field.","isRequired":true,"uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","example":"model","description":"Name of the request parameter that triggered the error. `null` when the error is not attributable to one field.","isRequired":true,"uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.param","typeLabel":"string | null"},"job_id":{"type":"string","example":"job_1hR9xTPZqK4mVLc2nJ7fY5wB","description":"Handle to work that is ALREADY RUNNING AND ALREADY BILLED, present on the few errors that carry one. When it is here, this is not a failure to retry — retrying pays twice. Collect the result from `GET /v1/images/jobs/{job_id}`, which serves every durable media job regardless of modality.\n\nTwo situations produce it. A media generation that outruns the gateway's wait answers `504` with `code: \"job_timeout\"` and keeps working. And `POST /v1/audio/speech` answers **500** with `code: \"artifact_unreadable\"` when the speech was generated and settled but could not be read back from storage — the audio exists and is paid for; only this response failed.\n\nDeclared here rather than per-endpoint because the rule is about the FIELD, not the status: if this is present, there is a paid-for result to collect. It was undeclared until now, so a client generated from this document could not see the one field that recovers money already spent.","uniqueKey":"error.job_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"Model not found","type":"invalid_request_error","code":"model_not_found","param":"model","job_id":"job_1hR9xTPZqK4mVLc2nJ7fY5wB"}}}},"exampleType":"generated"}},"exampleType":"generated"},"6eb9411d-6627-4ae4-bf56-daae178fa9f6":{"description":"Unauthorized — invalid or missing API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","description":"The error envelope. Every non-2xx response from this API has this shape, so a client can parse failures without branching on the endpoint.","required":["message","type","code","param"],"properties":{"message":{"type":"string","example":"Model not found","description":"Human-readable error message","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","example":"invalid_request_error","description":"Error category","enum":["invalid_request_error","authentication_error","permission_error","quota_exceeded","rate_limit_error","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"oneOf":[{"type":"string","example":"model_not_found","description":"Stable machine-readable error code. Branch on this rather than on `message`, which is prose and may be reworded.","isRequired":true,"uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","example":"model_not_found","description":"Stable machine-readable error code. Branch on this rather than on `message`, which is prose and may be reworded.","isRequired":true,"uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","example":"model","description":"Name of the request parameter that triggered the error. `null` when the error is not attributable to one field.","isRequired":true,"uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","example":"model","description":"Name of the request parameter that triggered the error. `null` when the error is not attributable to one field.","isRequired":true,"uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.param","typeLabel":"string | null"},"job_id":{"type":"string","example":"job_1hR9xTPZqK4mVLc2nJ7fY5wB","description":"Handle to work that is ALREADY RUNNING AND ALREADY BILLED, present on the few errors that carry one. When it is here, this is not a failure to retry — retrying pays twice. Collect the result from `GET /v1/images/jobs/{job_id}`, which serves every durable media job regardless of modality.\n\nTwo situations produce it. A media generation that outruns the gateway's wait answers `504` with `code: \"job_timeout\"` and keeps working. And `POST /v1/audio/speech` answers **500** with `code: \"artifact_unreadable\"` when the speech was generated and settled but could not be read back from storage — the audio exists and is paid for; only this response failed.\n\nDeclared here rather than per-endpoint because the rule is about the FIELD, not the status: if this is present, there is a paid-for result to collect. It was undeclared until now, so a client generated from this document could not see the one field that recovers money already spent.","uniqueKey":"error.job_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"Model not found","type":"invalid_request_error","code":"model_not_found","param":"model","job_id":"job_1hR9xTPZqK4mVLc2nJ7fY5wB"}}}},"exampleType":"generated"}},"exampleType":"generated"},"f92a376e-84b2-4214-ab75-9440e0964831":{"description":"Model not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","description":"The error envelope. Every non-2xx response from this API has this shape, so a client can parse failures without branching on the endpoint.","required":["message","type","code","param"],"properties":{"message":{"type":"string","example":"Model not found","description":"Human-readable error message","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","example":"invalid_request_error","description":"Error category","enum":["invalid_request_error","authentication_error","permission_error","quota_exceeded","rate_limit_error","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"oneOf":[{"type":"string","example":"model_not_found","description":"Stable machine-readable error code. Branch on this rather than on `message`, which is prose and may be reworded.","isRequired":true,"uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","example":"model_not_found","description":"Stable machine-readable error code. Branch on this rather than on `message`, which is prose and may be reworded.","isRequired":true,"uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","example":"model","description":"Name of the request parameter that triggered the error. `null` when the error is not attributable to one field.","isRequired":true,"uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","example":"model","description":"Name of the request parameter that triggered the error. `null` when the error is not attributable to one field.","isRequired":true,"uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.param","typeLabel":"string | null"},"job_id":{"type":"string","example":"job_1hR9xTPZqK4mVLc2nJ7fY5wB","description":"Handle to work that is ALREADY RUNNING AND ALREADY BILLED, present on the few errors that carry one. When it is here, this is not a failure to retry — retrying pays twice. Collect the result from `GET /v1/images/jobs/{job_id}`, which serves every durable media job regardless of modality.\n\nTwo situations produce it. A media generation that outruns the gateway's wait answers `504` with `code: \"job_timeout\"` and keeps working. And `POST /v1/audio/speech` answers **500** with `code: \"artifact_unreadable\"` when the speech was generated and settled but could not be read back from storage — the audio exists and is paid for; only this response failed.\n\nDeclared here rather than per-endpoint because the rule is about the FIELD, not the status: if this is present, there is a paid-for result to collect. It was undeclared until now, so a client generated from this document could not see the one field that recovers money already spent.","uniqueKey":"error.job_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"Model not found","type":"invalid_request_error","code":"model_not_found","param":"model","job_id":"job_1hR9xTPZqK4mVLc2nJ7fY5wB"}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"4e49b2dc-dbce-4c17-9a6e-b7b57051b518":{"ApiKey":{"type":"apiKey","in":"header","name":"Authorization","description":"API key in format: Bearer inf_***","scopes":[]}}},"servers":{"70c58c78-558b-477f-817f-fa094a9f1354":{"url":"https://api.infery.ai","description":"Production"},"250da9ba-2678-444c-bc3b-e169d87db6d0":{"url":"http://localhost:3001","description":"Local"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"Authorization","description":"API key in format: Bearer inf_***","scopes":[]},"schema":{"title":"Authorization","type":"string","description":"API key in format: Bearer inf_***","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"ApiKey","name":"Authorization"}],"title":"ApiKey"}]},"originalFileLocation":"openapi.json"},"subdomain":"inferyai","siteName":"Infery.ai","title":"Edit an image - Infery.ai","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-19T11:36:41.705Z","originalFileLocation":"api-reference/images/edits.mdx"},"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=\"POST /v1/images/edits — modify an existing image with a prompt.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Infery.ai\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"index, follow\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/inferyai/nYe38cZ0EVrE-Nwe/_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=\"/mintlify-assets/_mintlify/favicons/inferyai/nYe38cZ0EVrE-Nwe/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/inferyai/nYe38cZ0EVrE-Nwe/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/inferyai/nYe38cZ0EVrE-Nwe/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/inferyai/nYe38cZ0EVrE-Nwe/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/inferyai/nYe38cZ0EVrE-Nwe/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/inferyai/nYe38cZ0EVrE-Nwe/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/inferyai/nYe38cZ0EVrE-Nwe/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/inferyai/nYe38cZ0EVrE-Nwe/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Edit an image - Infery.ai\">\u003cmeta data-mint-head property=\"og:description\" content=\"POST /v1/images/edits — modify an existing image with a prompt.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Infery.ai Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.infery.ai/api-reference/images/edits\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://docs.infery.ai/brand/og.jpg\">\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=\"Edit an image - Infery.ai\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"POST /v1/images/edits — modify an existing image with a prompt.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://docs.infery.ai/brand/og.jpg\">\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=\"/mintlify-assets/_mintlify/favicons/inferyai/nYe38cZ0EVrE-Nwe/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Infery.ai\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2E5BE8\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.infery.ai/api-reference/images/edits\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/images/edits.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.infery.ai/#organization\",\"name\":\"Infery.ai\",\"url\":\"https://docs.infery.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/inferyai/0Jgb47bSQtZI-re9/brand/logo-light.svg?fit=max\u0026auto=format\u0026n=0Jgb47bSQtZI-re9\u0026q=85\u0026s=d3ebed9120aa8e785f372aa43a7cccf3\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.infery.ai#website\",\"name\":\"Infery.ai\",\"url\":\"https://docs.infery.ai\",\"publisher\":{\"@id\":\"https://docs.infery.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.infery.ai/api-reference/images/edits#webpage\",\"url\":\"https://docs.infery.ai/api-reference/images/edits\",\"name\":\"Edit an image\",\"description\":\"POST /v1/images/edits — modify an existing image with a prompt.\",\"dateModified\":\"2026-08-19T11:36:41.705Z\",\"isPartOf\":{\"@id\":\"https://docs.infery.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.infery.ai/api-reference/images/edits#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.infery.ai/api-reference/images/edits#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Images\",\"item\":\"https://docs.infery.ai/api-reference/images/generations\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Edit an image\",\"item\":\"https://docs.infery.ai/api-reference/images/edits\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.infery.ai/api-reference/images/edits#apireference\",\"headline\":\"Edit an image\",\"name\":\"Edit an image\",\"description\":\"POST /v1/images/edits — modify an existing image with a prompt.\",\"url\":\"https://docs.infery.ai/api-reference/images/edits\",\"mainEntityOfPage\":{\"@id\":\"https://docs.infery.ai/api-reference/images/edits#webpage\"},\"image\":\"https://docs.infery.ai/brand/og.jpg\",\"dateModified\":\"2026-08-19T11:36:41.705Z\",\"publisher\":{\"@id\":\"https://docs.infery.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.infery.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Infery.ai\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Infery.ai","nav":{"global":null,"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":"/introduction"}]},{"tab":"API Reference","groups":[{"group":"Overview","pages":[{"title":"API overview","href":"/api-reference/introduction"},{"title":"Authentication","href":"/api-reference/authentication"},{"title":"Errors","href":"/api-reference/errors"},{"title":"Rate limits","href":"/api-reference/rate-limits"}]},{"group":"Chat Completions","pages":[{"title":"Chat completions","openapi":"openapi.json POST /v1/chat/completions","href":"/api-reference/chat-completions"}]},{"group":"Embeddings","pages":[{"title":"Embeddings","openapi":"openapi.json POST /v1/embeddings","href":"/api-reference/embeddings"}]},{"group":"Images","pages":[{"title":"Generate an image","description":"POST /v1/images/generations — text-to-image generation.","openapi":"openapi.json POST /v1/images/generations","href":"/api-reference/images/generations"},{"title":"Edit an image","openapi":"openapi.json POST /v1/images/edits","href":"/api-reference/images/edits"},{"title":"Upscale an image","description":"POST /v1/images/upscale","openapi":"openapi.json POST /v1/images/upscale","href":"/api-reference/images/upscale"}]},{"group":"Audio","pages":[{"title":"Text-to-speech","openapi":"openapi.json POST /v1/audio/speech","href":"/api-reference/audio/speech"},{"title":"Speech-to-text","openapi":"openapi.json POST /v1/audio/transcriptions","href":"/api-reference/audio/transcriptions"},{"title":"Transform audio","openapi":"openapi.json POST /v1/audio/transformations","href":"/api-reference/audio/transformations"}]},{"group":"Video","pages":[{"title":"Create video generation","openapi":"openapi.json POST /v1/videos/generations","href":"/api-reference/videos/generations"},{"title":"Get video generation status","openapi":"openapi.json GET /v1/videos/generations/{jobId}","href":"/api-reference/videos/status"},{"title":"Upscale a video","openapi":"openapi.json POST /v1/video/upscale","href":"/api-reference/videos/upscale"}]},{"group":"Music","pages":[{"title":"Music","openapi":"openapi.json POST /v1/music/generations","href":"/api-reference/music"}]},{"group":"Files","pages":[{"title":"Upload a file","openapi":"openapi.json POST /v1/files","href":"/api-reference/files/upload"},{"title":"List files","openapi":"openapi.json GET /v1/files","href":"/api-reference/files/list"},{"title":"Retrieve file metadata","openapi":"openapi.json GET /v1/files/{fileId}","href":"/api-reference/files/retrieve"},{"title":"Delete a file","openapi":"openapi.json DELETE /v1/files/{fileId}","href":"/api-reference/files/delete"},{"title":"Download file contents","openapi":"openapi.json GET /v1/files/{fileId}/content","href":"/api-reference/files/content"}]},{"group":"Models","pages":[{"title":"Models","openapi":"openapi.json GET /v1/models","href":"/api-reference/models"},{"title":"Estimate a model request","openapi":"openapi.json POST /v1/models/{slug}/estimate","href":"/api-reference/models-estimate"}]},{"group":"Capabilities","pages":[{"title":"List capabilities","openapi":"openapi.json GET /v1/tools","href":"/api-reference/tools"},{"title":"Run a capability","openapi":"openapi.json POST /v1/capabilities/{id}/run","href":"/api-reference/capabilities/run"},{"title":"Generate a 3D model","openapi":"openapi.json POST /v1/3d/generations","href":"/api-reference/3d/generations"}]},{"group":"Workflows","pages":[{"title":"Run a workflow","openapi":"openapi.json POST /v1/workflows/runs","href":"/api-reference/workflows/run"},{"title":"Retrieve a run","openapi":"openapi.json GET /v1/workflows/runs/{id}","href":"/api-reference/workflows/run-retrieve"},{"title":"Cancel a run","openapi":"openapi.json POST /v1/workflows/runs/{id}/cancel","href":"/api-reference/workflows/run-cancel"},{"title":"Run logs","openapi":"openapi.json GET /v1/workflows/runs/{id}/logs","href":"/api-reference/workflows/run-logs"},{"title":"Estimate a run","openapi":"openapi.json POST /v1/workflows/estimate","href":"/api-reference/workflows/estimate"},{"title":"Create a workflow","openapi":"openapi.json POST /v1/workflows","href":"/api-reference/workflows/create"},{"title":"List workflows","openapi":"openapi.json GET /v1/workflows","href":"/api-reference/workflows/list"},{"title":"Retrieve a workflow","openapi":"openapi.json GET /v1/workflows/{id}","href":"/api-reference/workflows/retrieve"},{"title":"Update a workflow","openapi":"openapi.json PUT /v1/workflows/{id}","href":"/api-reference/workflows/update"},{"title":"Delete a workflow","openapi":"openapi.json DELETE /v1/workflows/{id}","href":"/api-reference/workflows/delete"},{"title":"List templates","openapi":"openapi.json GET /v1/workflows/templates","href":"/api-reference/workflows/templates-list"},{"title":"Retrieve a template","openapi":"openapi.json GET /v1/workflows/templates/{slug}","href":"/api-reference/workflows/templates-retrieve"}]}]}]},"title":"Edit an image - Infery.ai","buildId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","deploymentId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","07c022d89b","a74be98ba7","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-Bbp7I60D.js","utils-C3RIvJha.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DqD-vLt8.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-B31Loprg.js","snippetPresets-DKpk-b8t.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-Cj65AhOR.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BXtn5gcC.js","shallow-RY2b03Cp.js","getApiPlaygroundDisplay-B0jeiPk3.js","CodeSnippet-CYgBjjwn.js","CodeSnippets-DOngDrYB.js","Page-n7I5XbKb.js","getPastedJson-DRQbJx-T.js","icon-CQiQCicY.js","MethodPill-BKTLdNtu.js","DuplicateIcon-B9jpAdat.js","createIcon-DCddRrXv.js","DynamicMarkdown-a8hUKrw6.js","SectionHeading-eECVV2eH.js","axios-vUo_bRtp.js","Frame-Cz91mEGH.js","zoom-image-lightbox-CaUwvYH3.js","lightbox-handle-r17bVUz3.js","Markdown--GF7ZIpf.js","clsx-DZLdJUrt.js","lib--scc4DXi.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-2LoAhjKH.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-Zwc0ZncM.js"]}