Some models are served through our durable job path, and those responses carry a file_id next to each url — already a permanent handle on bytes in your workspace storage. When file_id is absent, upload the decoded bytes via POST /v1/files to persist them.A generation that runs past the 5-minute wait budget answers 504 with a job_id in the error body rather than an image. The job continues and is still billed; collect the result from GET /v1/images/jobs/{job_id}.
Read the generation as Server-Sent Events instead of waiting for a JSON body. A BODY field, and a real boolean — the handler reads body.stream. /v1/music/generations made the opposite choice and takes its flag as the QUERY parameter ?stream=true, so the two are not interchangeable: ?stream=true is ignored here, and a stream key in music’s body is ignored there. A streaming request also never takes the durable media-job path and has no fallback, because the SSE headers are flushed before the provider is called.
How much an existing image steers the result. Clamped to the range the chosen model's own input schema declares and dropped entirely for a model that does not declare it, so on this endpoint it is silently inert almost everywhere rather than an error.
This is the image-EDIT parameter (POST /v1/images/edits), accepted here because both routes share one schema-grounded parameter gate. If you are editing an image, send it there instead — this endpoint takes no input image, so on almost every model there is nothing for it to steer.
Diffusion steps. Refused with 400 unless it is a whole number in 1–100 — this endpoint's own ceiling, checked before anything is billed, not the chosen model's (read that from GET /v1/models, and expect it to be far lower: FLUX defaults to 4).
It is a BILLING dimension on per-megapixel models, which is why the ceiling exists: the cost is megapixels × $/MP × max(1, steps ÷ the model's default steps), so asking for more steps than the default multiplies the price of the call rather than leaving it unchanged.
Only the Together path forwards it to a provider. On every other image source it still validates and still prices, but the image comes back rendered with the model's own step count.
Let the model rewrite the prompt before rendering. Read by the Alibaba/DashScope path only, which treats an absent value as true; every other image source ignores it.
It also SELECTS A PRICE on z-image-turbo, where prompt extension is the expensive mode: the credit hold and the settle look that model's rate up under extend, or under noextend when this is explicitly false. Sending false is how you ask for the cheaper rate.
Example:
false
Response
Without stream (the default) this is application/json — one result object, shown below.
With stream: true IN THE BODY it is text/event-stream instead: a sequence of data: <json>\n\n lines terminated by a literal data: [DONE]. OpenAPI 3.0 has no vocabulary for "repeat this, then terminate with a sentinel", so the text/event-stream schema below describes the JSON payload of a SINGLE data: line — never the whole body — which is the precedent chat/completions (PR #766) and music/generations (#819) set.
One schema rather than music’s three-member oneOf, because there is one frame shape here: status is a STATE, not a discriminant. Frames run queued → processing → a terminal completed or failed, and the images arrive on the completed frame’s data — there is no separate result frame after it.
Two things the stream does NOT carry, both of which the JSON body does. credits_used: settlement runs AFTER the stream is closed, so a streamed generation never reports what it cost in band — the x-request-id response header is what ties the call to its usage record. And file_id on an artifact: registering images as durable files belongs to the media-job path, which a streaming request never takes.
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.3966","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/generations","slug":"/api-reference/images/generations","pageMetadata":{"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"},"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/generations — text-to-image generation.\"\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`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Frame,Heading,OptimizedImage}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);return _jsxs(_Fragment,{children:[_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/generations`}),_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\": \"dall-e-3\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"prompt\": \"An isometric dev dashboard, neon green accents, dark theme\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"size\": \"1024x1024\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"n\": 1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`sample-output`,children:`Sample output`}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://mintcdn.com/inferyai/5YDpMTITcUUspdCA/samples/image.png?fit=max\u0026auto=format\u0026n=5YDpMTITcUUspdCA\u0026q=85\u0026s=2f7c6a22252e41004c0e7d721f028888`,alt:`Generated image sample`,\"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(_components.p,{children:_jsxs(_components.em,{children:[`Generated with Nano Banana (`,_jsx(_components.code,{children:`nano-banana`}),`).`]})}),`\n`,_jsxs(_components.p,{children:[`Works unchanged with the OpenAI SDK: `,_jsx(_components.code,{children:`client.images.generate(...)`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`response-formats`,children:`Response formats`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`response_format: \"url\"`}),` (default) → a URL, ephemeral (~1 hour). Download within that window if you need to keep it.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`response_format: \"b64_json\"`}),` → inline base64 PNG. DALL-E models honour this; GPT Image models always return base64 regardless.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Some models are served through our durable job path, and those responses carry a `,_jsx(_components.code,{children:`file_id`}),` next to each `,_jsx(_components.code,{children:`url`}),` — already a permanent handle on bytes in your workspace storage. When `,_jsx(_components.code,{children:`file_id`}),` is absent, upload the decoded bytes via `,_jsx(_components.code,{children:`POST /v1/files`}),` to persist them.`]}),`\n`,_jsxs(_components.p,{children:[`A generation that runs past the 5-minute wait budget answers `,_jsx(_components.strong,{children:`504`}),` with a `,_jsx(_components.code,{children:`job_id`}),` in the error body rather than an image. The job continues and is still billed; collect the result from `,_jsx(_components.code,{children:`GET /v1/images/jobs/{job_id}`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`supported-models`,children:`Supported models`}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/models/catalog`,children:`Models catalog`}),` filtered to image modality. OpenAI (DALL·E), Google (Imagen, Gemini Image), xAI (Grok Image), Alibaba (Qwen Image), Suno-music, FLUX (self-hosted) — all accessed by slug.`]}),`\n`,_jsx(Heading,{level:`2`,id:`aspect-ratios-and-sizes`,children:`Aspect ratios and sizes`}),`\n`,_jsxs(_components.p,{children:[`Per-model; common values: `,_jsx(_components.code,{children:`1024x1024`}),`, `,_jsx(_components.code,{children:`1792x1024`}),`, `,_jsx(_components.code,{children:`1024x1792`}),`, `,_jsx(_components.code,{children:`512x512`}),`. Check a model’s `,_jsx(_components.code,{children:`_infery.allowed_params.sizes`}),` in `,_jsx(_components.code,{children:`GET /v1/models`}),`.`]})]})}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":"Generate an image","description":"POST /v1/images/generations — text-to-image generation.","openapi":"openapi.json POST /v1/images/generations","href":"/api-reference/images/generations"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Sample output","slug":"sample-output","depth":3,"children":[]},{"title":"Response formats","slug":"response-formats","depth":2,"children":[]},{"title":"Supported models","slug":"supported-models","depth":2,"children":[]},{"title":"Aspect ratios and sizes","slug":"aspect-ratios-and-sizes","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"createImageGeneration","parameters":[],"requestBody":"32711e7c-ee77-4607-a5c0-310a560a5211","responses":{"200":"17dc20c1-2429-483b-8002-84d52d6b5fe5","400":"b00156de-fd6b-46a9-a232-c8877eb60a3f","401":"fbc12839-aba5-4e39-a44e-1a9602a6e5ca","404":"2697c5a4-42b4-430e-baee-2f2f40e2e17d"},"security":["fe1f0b48-2b9b-4642-ac49-d70c8fa50e62"],"summary":"Create image generation","tags":["Images"],"method":"post","type":"path","servers":["70c58c78-558b-477f-817f-fa094a9f1354","250da9ba-2678-444c-bc3b-e169d87db6d0"],"path":"/v1/images/generations","baseUrlOptions":["https://api.infery.ai","http://localhost:3001"],"title":"Create image generation","description":"POST /v1/images/generations — text-to-image generation.","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","prompt"],"properties":{"model":{"type":"string","description":"Model ID to use for generation","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"prompt":{"type":"string","description":"Text prompt describing the image to generate","isRequired":true,"uniqueKey":"prompt","typeLabel":"string"},"stream":{"type":"boolean","default":false,"description":"Read the generation as Server-Sent Events instead of waiting for a JSON body. A BODY field, and a real boolean — the handler reads `body.stream`. `/v1/music/generations` made the opposite choice and takes its flag as the QUERY parameter `?stream=true`, so the two are not interchangeable: `?stream=true` is ignored here, and a `stream` key in music’s body is ignored there. A streaming request also never takes the durable media-job path and has no fallback, because the SSE headers are flushed before the provider is called.","uniqueKey":"stream","typeLabel":"boolean"},"n":{"type":"integer","description":"Number of images (model-specific max: DALL-E 3=1, Imagen=4, GPT Image=4, DALL-E 2=10)","default":1,"uniqueKey":"n","typeLabel":"integer"},"size":{"type":"string","description":"Image size. DALL-E: 256x256-1792x1024. GPT Image: 1024x1024/1024x1536/1536x1024/auto","uniqueKey":"size","typeLabel":"string"},"quality":{"type":"string","description":"DALL-E: standard/hd. GPT Image: low/medium/high/auto","uniqueKey":"quality","typeLabel":"string"},"style":{"type":"string","enum":["vivid","natural"],"description":"DALL-E only","uniqueKey":"style","typeLabel":"enum\u003cstring>"},"response_format":{"type":"string","enum":["url","b64_json"],"default":"url","description":"DALL-E only. GPT Image always returns b64_json","uniqueKey":"response_format","typeLabel":"enum\u003cstring>"},"aspect_ratio":{"type":"string","description":"Aspect ratio (Google models, see /v1/models for allowed values)","uniqueKey":"aspect_ratio","typeLabel":"string"},"image_size":{"type":"string","description":"Output resolution: Imagen Standard/Ultra \"1K\"|\"2K\", Gemini 3 image \"1K\"|\"2K\"|\"4K\"","uniqueKey":"image_size","typeLabel":"string"},"strength":{"type":"number","example":0.35,"description":"How much an existing image steers the result. Clamped to the range the chosen model's own input schema declares and dropped entirely for a model that does not declare it, so on this endpoint it is silently inert almost everywhere rather than an error.\n\nThis is the image-EDIT parameter (`POST /v1/images/edits`), accepted here because both routes share one schema-grounded parameter gate. If you are editing an image, send it there instead — this endpoint takes no input image, so on almost every model there is nothing for it to steer.","uniqueKey":"strength","typeLabel":"number"},"person_generation":{"type":"string","enum":["dont_allow","allow_adult","allow_all"],"description":"Person generation policy (Google models)","uniqueKey":"person_generation","typeLabel":"enum\u003cstring>"},"background":{"type":"string","enum":["transparent","opaque","auto"],"description":"Background type (GPT Image models only)","uniqueKey":"background","typeLabel":"enum\u003cstring>"},"output_format":{"type":"string","enum":["png","webp","jpeg"],"description":"Output file format (GPT Image models only)","uniqueKey":"output_format","typeLabel":"enum\u003cstring>"},"output_compression":{"type":"integer","description":"Compression 0-100 (GPT Image, jpeg/webp only)","uniqueKey":"output_compression","typeLabel":"integer"},"input_fidelity":{"type":"string","enum":["high","low"],"description":"Match style of input images (GPT Image 1/1.5 only)","uniqueKey":"input_fidelity","typeLabel":"enum\u003cstring>"},"moderation":{"type":"string","enum":["auto","low"],"description":"Content filter level (GPT Image only)","uniqueKey":"moderation","typeLabel":"enum\u003cstring>"},"negative_prompt":{"type":"string","description":"What to exclude from the image (Imagen 4)","uniqueKey":"negative_prompt","typeLabel":"string"},"seed":{"type":"integer","description":"Seed for reproducibility (Imagen 4)","uniqueKey":"seed","typeLabel":"integer"},"steps":{"type":"integer","minimum":1,"maximum":100,"example":4,"description":"Diffusion steps. Refused with 400 unless it is a whole number in 1–100 — this endpoint's own ceiling, checked before anything is billed, not the chosen model's (read that from `GET /v1/models`, and expect it to be far lower: FLUX defaults to 4).\n\nIt is a BILLING dimension on per-megapixel models, which is why the ceiling exists: the cost is `megapixels × $/MP × max(1, steps ÷ the model's default steps)`, so asking for more steps than the default multiplies the price of the call rather than leaving it unchanged.\n\nOnly the Together path forwards it to a provider. On every other image source it still validates and still prices, but the image comes back rendered with the model's own step count.","uniqueKey":"steps","typeLabel":"integer"},"prompt_extend":{"type":"boolean","example":false,"description":"Let the model rewrite the prompt before rendering. Read by the Alibaba/DashScope path only, which treats an absent value as `true`; every other image source ignores it.\n\nIt also SELECTS A PRICE on `z-image-turbo`, where prompt extension is the expensive mode: the credit hold and the settle look that model's rate up under `extend`, or under `noextend` when this is explicitly `false`. Sending `false` is how you ask for the cheaper rate.","uniqueKey":"prompt_extend","typeLabel":"boolean"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"model":"\u003cstring>","prompt":"\u003cstring>","stream":false,"n":1,"size":"\u003cstring>","quality":"\u003cstring>","response_format":"url","aspect_ratio":"\u003cstring>","image_size":"\u003cstring>","strength":0.35,"output_compression":123,"negative_prompt":"\u003cstring>","seed":123,"steps":4,"prompt_extend":false}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"17dc20c1-2429-483b-8002-84d52d6b5fe5":{"description":"Without `stream` (the default) this is `application/json` — one result object, shown below.\n\nWith `stream: true` IN THE BODY it is `text/event-stream` instead: a sequence of `data: \u003cjson>\\n\\n` lines terminated by a literal `data: [DONE]`. OpenAPI 3.0 has no vocabulary for \"repeat this, then terminate with a sentinel\", so the `text/event-stream` schema below describes the JSON payload of a SINGLE `data:` line — never the whole body — which is the precedent `chat/completions` (PR #766) and `music/generations` (#819) set.\n\nOne schema rather than music’s three-member `oneOf`, because there is one frame shape here: `status` is a STATE, not a discriminant. Frames run `queued` → `processing` → a terminal `completed` or `failed`, and the images arrive on the `completed` frame’s `data` — there is no separate result frame after it.\n\nTwo things the stream does NOT carry, both of which the JSON body does. `credits_used`: settlement runs AFTER the stream is closed, so a streamed generation never reports what it cost in band — the `x-request-id` response header is what ties the call to its usage record. And `file_id` on an artifact: registering images as durable files belongs to the media-job path, which a streaming request never takes.","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"},"text/event-stream":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["queued","processing","completed","failed"],"description":"The provider's normalised state. Read it before anything else: `failed` is a real failure delivered as a FRAME — once the SSE headers are flushed the gateway cannot answer with an HTTP status, so the response is still a 200 that ends in `data: [DONE]`, and a client that ignores `status` sees a successful, empty, apparently free stream.","example":"processing","isRequired":true,"uniqueKey":"status","typeLabel":"enum\u003cstring>"},"progress":{"type":"number","description":"Percentage, 0-100. Advisory: providers step it in fixed jumps rather than reporting real progress.","example":25,"isRequired":true,"uniqueKey":"progress","typeLabel":"number"},"data":{"description":"The generated images. Sent ONLY on the `completed` frame — this is the deliverable, and it is the last frame before `data: [DONE]`. No `file_id` here, unlike the JSON 200: registering artifacts as durable files belongs to the media-job path, and a streaming request never takes it (`images.controller.ts` keeps `stream: true` on the inline path because the job facade has no channel for progress events).","type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"Provider-hosted download URL for this image. Ephemeral — roughly an hour — so copy the bytes rather than storing the URL.","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"}},"uniqueKey":"data.items.[INDEX]","typeLabel":"object"},"uniqueKey":"data","typeLabel":"object[]"},"error":{"type":"string","description":"Failure message. Present only on a `failed` frame.","example":"Provider error: 503","uniqueKey":"error","typeLabel":"string"}},"required":["status","progress"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"status":"processing","progress":25,"data":[{"url":"https://example.com/image.png","b64_json":"\u003cstring>","revised_prompt":"\u003cstring>"}],"error":"Provider error: 503"}}},"exampleType":"generated"}},"exampleType":"generated"},"b00156de-fd6b-46a9-a232-c8877eb60a3f":{"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"},"fbc12839-aba5-4e39-a44e-1a9602a6e5ca":{"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"},"2697c5a4-42b4-430e-baee-2f2f40e2e17d":{"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":{"fe1f0b48-2b9b-4642-ac49-d70c8fa50e62":{"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":"Generate an image - Infery.ai","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-19T11:36:41.704Z","originalFileLocation":"api-reference/images/generations.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/generations — text-to-image generation.\">\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=\"Generate an image - Infery.ai\">\u003cmeta data-mint-head property=\"og:description\" content=\"POST /v1/images/generations — text-to-image generation.\">\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/generations\">\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=\"Generate an image - Infery.ai\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"POST /v1/images/generations — text-to-image generation.\">\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/generations\">\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/generations.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/generations#webpage\",\"url\":\"https://docs.infery.ai/api-reference/images/generations\",\"name\":\"Generate an image\",\"description\":\"POST /v1/images/generations — text-to-image generation.\",\"dateModified\":\"2026-08-19T11:36:41.704Z\",\"isPartOf\":{\"@id\":\"https://docs.infery.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.infery.ai/api-reference/images/generations#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.infery.ai/api-reference/images/generations#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Infery.ai\",\"item\":\"https://docs.infery.ai\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Generate an image\",\"item\":\"https://docs.infery.ai/api-reference/images/generations\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.infery.ai/api-reference/images/generations#apireference\",\"headline\":\"Generate an image\",\"name\":\"Generate an image\",\"description\":\"POST /v1/images/generations — text-to-image generation.\",\"url\":\"https://docs.infery.ai/api-reference/images/generations\",\"mainEntityOfPage\":{\"@id\":\"https://docs.infery.ai/api-reference/images/generations#webpage\"},\"image\":\"https://docs.infery.ai/brand/og.jpg\",\"dateModified\":\"2026-08-19T11:36:41.704Z\",\"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","description":"POST /v1/embeddings — dense vector embeddings for text.","openapi":"openapi.json POST /v1/embeddings","href":"/api-reference/embeddings"}]},{"group":"Images","pages":[{"title":"Generate an image","openapi":"openapi.json POST /v1/images/generations","href":"/api-reference/images/generations"},{"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"},{"title":"Upscale an image","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":"Generate an image - Infery.ai","buildId":"dpl_cadrRc5H9XQiJQbDFN5mcYRs2PAj","deploymentId":"dpl_cadrRc5H9XQiJQbDFN5mcYRs2PAj","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","07c022d89b","a74be98ba7","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-DKJwRUt2.js","utils-CWD_VS3u.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-oFjciODD.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-C76WsxC3.js","snippetPresets-DvPMxpX_.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-CuNQfndH.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BVFpVUoF.js","shallow-t59Jg5Kr.js","getApiPlaygroundDisplay-C_JZ4amX.js","CodeSnippet-CLRDnx_h.js","CodeSnippets-C2myU4kc.js","Page-7TwLLapg.js","getPastedJson-B-JaVXw7.js","icon-BA-iDhH3.js","MethodPill-D4qZABFp.js","DuplicateIcon-THIDKO1O.js","createIcon-CYYJwgFd.js","DynamicMarkdown-UGQuxDKp.js","SectionHeading-jYELb23h.js","axios-vUo_bRtp.js","Frame-B0bJ23PC.js","zoom-image-lightbox-B0E5HDf_.js","lightbox-handle-r17bVUz3.js","Markdown-DKsLa3wy.js","clsx-CefdjKz2.js","lib--scc4DXi.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-BaREnp3o.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-sgx_0XzF.js"]}