Copy gpt-image-2-vip examples for quality-aware generation, idempotent tasks, one or multiple reference images, native result parsing, and invalid values.
POST
/
v1
/
images
/
generations
Billable request: generate an image with gpt-image-2-vip
curl --request POST \
--url https://api.yingtu.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-image-2-vip",
"prompt": "A silver watch on dark stone, controlled studio light, no text."
}
'
import requests
url = "https://api.yingtu.ai/v1/images/generations"
payload = {
"model": "gpt-image-2-vip",
"prompt": "A silver watch on dark stone, controlled studio light, no text."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'gpt-image-2-vip',
prompt: 'A silver watch on dark stone, controlled studio light, no text.'
})
};
fetch('https://api.yingtu.ai/v1/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
import fs from "node:fs";const product = fs.readFileSync("product.png").toString("base64");const scene = fs.readFileSync("scene.jpg").toString("base64");const submitted = await fetch("https://api.yingtu.ai/v1/images/tasks", { method: "POST", headers: { Authorization: `Bearer ${process.env.YINGTU_API_KEY}`, "Content-Type": "application/json", "Idempotency-Key": crypto.randomUUID(), }, body: JSON.stringify({ model: "gpt-image-2-vip", action: "edit", prompt: "Keep the product and replace the background with pale blue", input_images: [ { mime_type: "image/png", data: product }, { mime_type: "image/jpeg", data: scene }, ], size: "2048x2048", quality: "high", n: 1, }),});if (submitted.status !== 202) throw new Error(`Submit failed: ${submitted.status}`);const { task_id } = await submitted.json();console.log(task_id);
Each decoded source must not exceed 20 MiB, and all sources together must remain within 64 MiB. Poll with the same terminal-state loop; the successful result expires after 24 hours.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"YingTu API Docs","description":"Developer documentation for YingTu Nano Banana and GPT Image generation, editing, and asynchronous APIs.","colors":{"primary":"#5146B8","light":"#A69FFF","dark":"#7467E0"},"logo":{"light":"https://mintcdn.com/yingtu-api/9WnnPQFwUqwYH3MC/assets/logo-light.svg?fit=max\u0026auto=format\u0026n=9WnnPQFwUqwYH3MC\u0026q=85\u0026s=ae9318f86792619920b950ae5ce70a02","dark":"https://mintcdn.com/yingtu-api/9WnnPQFwUqwYH3MC/assets/logo-dark.svg?fit=max\u0026auto=format\u0026n=9WnnPQFwUqwYH3MC\u0026q=85\u0026s=95f2780e0b4b386c826b1ba0580580eb","href":"https://docs.yingtu.ai"},"favicon":"https://mintcdn.com/yingtu-api/9WnnPQFwUqwYH3MC/assets/favicon.svg?fit=max\u0026auto=format\u0026n=9WnnPQFwUqwYH3MC\u0026q=85\u0026s=1361eb53f2f5c095055e3fbd8a04317f","api":{"openapi":["openapi.json","openapi-models/gemini-2.5-flash-image.json","openapi-models/gemini-3.1-flash-lite-image.json","openapi-models/gemini-3.1-flash-image.json","openapi-models/gemini-3-pro-image.json","openapi-models/gpt-image-2-web.json","openapi-models/gpt-image-2-vip.json","openapi-locales/zh-CN/openapi.json","openapi-locales/zh-CN/models/gemini-2.5-flash-image.json","openapi-locales/zh-CN/models/gemini-3.1-flash-lite-image.json","openapi-locales/zh-CN/models/gemini-3.1-flash-image.json","openapi-locales/zh-CN/models/gemini-3-pro-image.json","openapi-locales/zh-CN/models/gpt-image-2-web.json","openapi-locales/zh-CN/models/gpt-image-2-vip.json"],"params":{"expanded":"closed"},"playground":{"display":"interactive","proxy":false},"examples":{"defaults":"required","languages":["curl","python","javascript"],"prefill":true,"autogenerate":true}},"appearance":{"default":"system","strict":false},"background":{"color":{"light":"#FFFFFF","dark":"#09090B"}},"seo":{"organization":{"name":"YingTu","url":"https://docs.yingtu.ai","logo":"https://docs.yingtu.ai/assets/logo-light.svg"},"indexing":"navigable"},"fonts":{"family":"Inter"},"icons":{"library":"lucide"},"styling":{"eyebrows":"section","codeblocks":"system","latex":false},"metadata":{"timestamp":true},"navigation":{"languages":[{"language":"en","footer":{"links":[{"header":"API resources","items":[{"label":"Model marketplace","href":"https://api.yingtu.ai/pricing"},{"label":"Data handling","href":"/en/resources/data-handling-and-privacy"}]},{"header":"Support","items":[{"label":"API technical support","href":"/en/resources/technical-support"},{"label":"hi@yingtu.ai","href":"mailto:hi@yingtu.ai"}]}]},"navbar":{"links":[{"href":"https://api.yingtu.ai/pricing","label":"Model marketplace"},{"href":"/en/resources/technical-support","label":"Support"}],"primary":{"type":"button","label":"Open console","href":"https://api.yingtu.ai"}},"href":"en/models/image/nano-banana/overview"},{"language":"zh-CN","footer":{"links":[{"header":"API 资源","items":[{"label":"模型广场","href":"https://api.yingtu.ai/pricing"},{"label":"数据处理与隐私","href":"/cn/resources/data-handling-and-privacy"}]},{"header":"联系支持","items":[{"label":"API 技术支持","href":"/cn/resources/technical-support"},{"label":"hi@yingtu.ai","href":"mailto:hi@yingtu.ai"}]}]},"navbar":{"links":[{"href":"https://api.yingtu.ai/pricing","label":"模型广场"},{"href":"/cn/resources/technical-support","label":"技术支持"}],"primary":{"type":"button","label":"打开控制台","href":"https://api.yingtu.ai"}},"href":"cn/models/image/nano-banana/overview"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"yingtu-api","hasAudioNarration":false,"actualSubdomain":"yingtu-api","customDomains":["docs.yingtu.ai"],"gitSource":{"type":"github","owner":"threezhang","repo":"yingtu-api-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"latestBuiltDeploymentHistoryId":"6aca354930925e44ebb42138","collectionId":"e3b57f62-2e3d-4541-9d1b-17a2b49b9d94","liveDeploymentHistoryId":"6aca354930925e44ebb42138","schemaVersion":"v3"},"entitlements":{},"buildId":"6aca354930925e44ebb42138","clientVersion":"0.0.4043","searchFilterCounts":[{"language":"zh-CN","tag":"Nano Banana","count":28},{"language":"en","tag":"Nano Banana","count":28},{"language":"zh-CN","tag":"GPT Image","count":7},{"language":"en","tag":"GPT Image","count":7},{"language":"zh-CN","tag":"账户与计费","count":6},{"language":"en","tag":"Account and billing","count":6},{"language":"zh-CN","tag":"API 参考","count":5},{"language":"en","tag":"API Reference","count":5},{"language":"zh-CN","tag":"资源","count":4},{"language":"en","tag":"Resources","count":4},{"language":"zh-CN","tag":"GPT Image 2 VIP","count":3},{"language":"zh-CN","tag":"GPT Image 2 Web","count":3},{"language":"zh-CN","tag":"Gemini 2.5 Flash Image","count":3},{"language":"zh-CN","tag":"Gemini 3 Pro Image","count":3},{"language":"zh-CN","tag":"Gemini 3.1 Flash Image","count":3},{"language":"en","tag":"GPT Image 2 VIP","count":3},{"language":"en","tag":"GPT Image 2 Web","count":3},{"language":"en","tag":"Gemini 2.5 Flash Image","count":3},{"language":"en","tag":"Gemini 3 Pro Image","count":3},{"language":"en","tag":"Gemini 3.1 Flash Image","count":3}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","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":"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":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"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":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"en/models/image/gpt-image/gpt-image-2-vip/examples","slug":"/en/models/image/gpt-image/gpt-image-2-vip/examples","pageMetadata":{"title":"GPT Image 2 VIP API examples","sidebarTitle":"Examples","description":"Copy gpt-image-2-vip examples for quality-aware generation, idempotent tasks, one or multiple reference images, native result parsing, and invalid values.","icon":"braces","openapi":"openapi-models/gpt-image-2-vip.json POST /v1/images/generations","playground":"interactive","href":"/en/models/image/gpt-image/gpt-image-2-vip/examples"},"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: \"Copy gpt-image-2-vip examples for quality-aware generation, idempotent tasks, one or multiple reference images, native result parsing, and invalid values.\"\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={code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`generate-with-a-quality-tier`,children:`Generate with a quality tier`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,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:`10`,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.yingtu.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 YOUR_YINGTU_API_KEY'`}),_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\": \"gpt-image-2-vip\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"prompt\": \"A silver watch on dark stone, controlled studio light, no text\",`})}),`\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:` \"quality\": \"medium\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"n\": 1`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` jq`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -er`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '.data[0].b64_json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` base64`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --decode`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` >`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` watch.png`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`low`}),` for a smaller output budget, `,_jsx(_components.code,{children:`high`}),` for the largest documented budget, or `,_jsx(_components.code,{children:`auto`}),` to delegate the choice.`]}),`\n`,_jsx(Heading,{level:`2`,id:`queue-a-4k-landscape-result`,children:`Queue a 4K landscape result`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`48`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`48`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` base64`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` time`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` pathlib `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Path`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`headers `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'YINGTU_API_KEY'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Idempotency-Key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"vip-landscape-001\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`submitted `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.yingtu.ai/v1/images/tasks\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`headers,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` json`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-image-2-vip\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"action\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"generate\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"prompt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"A glass greenhouse in a snowy forest at dusk, no text\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"size\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"3840x2160\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"quality\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"high\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"n\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` timeout`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`30`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`submitted.raise_for_status()`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` submitted.status_code `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 202`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` raise`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` RuntimeError`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Expected HTTP 202, received `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`submitted.status_code`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`task_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` submitted.json()[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"task_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`deadline `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` time.monotonic() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`+`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 300`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`while`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` time.monotonic() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` deadline:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` polled `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.get(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.yingtu.ai/v1/tasks/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`task_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`headers, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`timeout`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`30`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` polled.raise_for_status()`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` task `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` polled.json()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` task[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"completed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` items `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` task.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"result\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {}).get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`or`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` []`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` encoded `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` items[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"b64_json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` items `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`else`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` None`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` not`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` encoded:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` raise`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` RuntimeError`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Completed task did not include image data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Path(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"greenhouse.png\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).write_bytes(base64.b64decode(encoded))`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` task[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"failed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"expired\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` raise`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` RuntimeError`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(task.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {}).get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Task failed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`))`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` time.sleep(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`3`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`else`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` raise`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` TimeoutError`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Task deadline exceeded\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`edit-a-source-image`,children:`Edit a source image`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,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:`10`,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.yingtu.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 YOUR_YINGTU_API_KEY'`}),_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:` -F`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'model=gpt-image-2-vip'`}),_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:` -F`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'image=@product.png;type=image/png'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -F`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'prompt=Keep the product and replace the background with pale blue'`}),_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:` -F`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'size=2048x2048'`}),_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:` -F`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'quality=high'`}),_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:` -F`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'n=1'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` >`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` edited-response.json`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`jq`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -er`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '.data[0].b64_json'`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` edited-response.json`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` base64`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --decode`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` >`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` edited.png`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`queue-a-multi-image-edit`,children:`Queue a multi-image edit`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`27`,language:`javascript`,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:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`27`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` fs`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"node:fs\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` product`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` fs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`readFileSync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"product.png\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`toString`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"base64\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` scene`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` fs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`readFileSync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"scene.jpg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`toString`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"base64\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` submitted`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.yingtu.ai/v1/images/tasks\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"POST\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Authorization:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `Bearer \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`process`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`YINGTU_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Idempotency-Key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` crypto`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`randomUUID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(),`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` model:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"gpt-image-2-vip\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` action:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"edit\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` prompt:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Keep the product and replace the background with pale blue\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` input_images:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`mime_type:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"image/png\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` product`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`mime_type:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"image/jpeg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` scene`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` size:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"2048x2048\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` quality:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"high\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` n:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`submitted`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !==`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 202`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`throw`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`Submit failed: \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`submitted`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`task_id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` submitted`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`task_id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Each decoded source must not exceed 20 MiB, and all sources together must remain within 64 MiB. Poll with the same terminal-state loop; the successful result expires after 24 hours.`}),`\n`,_jsx(Heading,{level:`2`,id:`reject-unknown-quality-values-before-sending`,children:`Reject unknown quality values before sending`}),`\n`,_jsx(_components.p,{children:`Keep a local enum and fail before creating a billable request:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`javascript`,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:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` qualities`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Set`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`([`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"low\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"medium\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"high\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"auto\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`qualities`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`has`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`input`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`quality`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`throw`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` TypeError`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Unsupported quality\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`test-this-model-online`,children:`Test this model online`}),`\n`,_jsxs(_components.p,{children:[`The embedded operation fixes `,_jsx(_components.code,{children:`gpt-image-2-vip`}),`. It defaults to 1K and `,_jsx(_components.code,{children:`low`}),`; select a larger size or quality only when the real request needs it.`]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Try it sends a real USD 0.05 request at the current price. Use a funded development key and keep the generated cURL private.`})})]})}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":{"codeStyling":"system","config":{},"pageMetadata":{"title":"GPT Image 2 VIP API examples","sidebarTitle":"Examples","description":"Copy gpt-image-2-vip examples for quality-aware generation, idempotent tasks, one or multiple reference images, native result parsing, and invalid values.","icon":"braces","openapi":"openapi-models/gpt-image-2-vip.json POST /v1/images/generations","playground":"interactive","href":"/en/models/image/gpt-image/gpt-image-2-vip/examples"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Generate with a quality tier","slug":"generate-with-a-quality-tier","depth":2,"children":[]},{"title":"Queue a 4K landscape result","slug":"queue-a-4k-landscape-result","depth":2,"children":[]},{"title":"Edit a source image","slug":"edit-a-source-image","depth":2,"children":[]},{"title":"Queue a multi-image edit","slug":"queue-a-multi-image-edit","depth":2,"children":[]},{"title":"Reject unknown quality values before sending","slug":"reject-unknown-quality-values-before-sending","depth":2,"children":[]},{"title":"Test this model online","slug":"test-this-model-online","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/yingtu-api/79b6c49b62bd9e19/locale-metadata.js"],"openApiReferenceData":{"operation":{"tags":["GPT Image generation"],"summary":"Billable request: generate an image with gpt-image-2-vip","description":"Copy gpt-image-2-vip examples for quality-aware generation, idempotent tasks, one or multiple reference images, native result parsing, and invalid values.","operationId":"generateGptImage_gpt_image_2_vip","security":["8ab6375f-62d5-4c97-97b2-ec022a4f3d84"],"requestBody":"8446d424-b208-4ba9-8ff4-778ada6bbe83","responses":{"200":"18d865e1-13e1-496a-ac64-819707878034","400":"f5760627-e078-47d7-8775-88ec89c45152","401":"bfdfb312-7955-4167-bf4f-d432acc0fe27","403":"303925fe-0277-4bc9-b84a-4f23f87f4d7a","429":"d0836968-e774-447c-8a64-ce2df6ada449","500":"3fdfb116-7ee4-4b26-bae4-aadeec7afea5"},"method":"post","type":"path","servers":["5bf13df1-f17a-4b23-ba56-806150046b80"],"path":"/v1/images/generations","baseUrlOptions":["https://api.yingtu.ai"],"title":"Billable request: generate an image with gpt-image-2-vip","codeSamples":[],"requestExampleLanguages":["bash","python","javascript"],"requiredOnlyExamples":true,"requestExampleType":"generated","responseExampleType":"generated","prefillPlaygroundWithExample":true,"prefillPlaygroundExamples":[{"body.model":"gpt-image-2-vip","body.prompt":"A silver watch on dark stone, controlled studio light, no text.","body.size":"1024x1024","body.quality":"low","body.n":1}],"disableProxy":true},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"title":"GPT Image generation request","type":"object","required":["model","prompt"],"properties":{"model":{"title":"GPT Image model ID","type":"string","enum":["gpt-image-2-vip"],"example":"gpt-image-2-vip","isRequired":true,"uniqueKey":"model","typeLabel":"enum\u003cstring>"},"prompt":{"title":"Prompt","type":"string","minLength":1,"example":"A blue ceramic teapot on a pale table, no text","isRequired":true,"uniqueKey":"prompt","typeLabel":"string"},"size":{"title":"Output size","type":"string","enum":["1024x1024","2048x2048","3840x2160"],"example":"1024x1024","description":"Current public presets. Set size explicitly for predictable dimensions; the 4K landscape value is 3840x2160.","x-default":"1024x1024","uniqueKey":"size","typeLabel":"enum\u003cstring>"},"quality":{"title":"Image quality","type":"string","enum":["low","medium","high","auto"],"example":"low","description":"Forwarded for both GPT Image routes. The selected upstream determines how the requested value affects the result.","x-default":"low","uniqueKey":"quality","typeLabel":"enum\u003cstring>"},"n":{"title":"Number of images","type":"integer","enum":[1],"default":1,"description":"The documented subset returns one image.","uniqueKey":"n","typeLabel":"enum\u003cinteger>"}},"uniqueKey":"","typeLabel":"GPT Image generation request · object"},"examples":{"fixedModel":{"title":"fixedModel","value":{"model":"gpt-image-2-vip","prompt":"A silver watch on dark stone, controlled studio light, no text.","size":"1024x1024","quality":"low","n":1}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"18d865e1-13e1-496a-ac64-819707878034":{"description":"Complete GPT Image response","content":{"application/json":{"schema":{"title":"GPT Image response","type":"object","required":["created","data"],"properties":{"created":{"type":"integer","format":"int64","description":"Unix timestamp in seconds.","isRequired":true,"uniqueKey":"created","typeLabel":"integer\u003cint64>"},"data":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"object","required":["b64_json"],"properties":{"b64_json":{"type":"string","format":"byte","description":"Base64-encoded image bytes without a data URL prefix.","example":"iVBORw0KGgo=","isRequired":true,"uniqueKey":"data.items.[INDEX].b64_json","typeLabel":"string\u003cbyte>"}},"uniqueKey":"data.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"data","typeLabel":"object[]"},"size":{"type":"string","description":"Output size when returned by the selected GPT Image route.","uniqueKey":"size","typeLabel":"string"},"quality":{"type":"string","description":"Quality value reported by the selected GPT Image route.","uniqueKey":"quality","typeLabel":"string"},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer","minimum":0,"uniqueKey":"usage.input_tokens","typeLabel":"integer"},"output_tokens":{"type":"integer","minimum":0,"uniqueKey":"usage.output_tokens","typeLabel":"integer"},"total_tokens":{"type":"integer","minimum":0,"uniqueKey":"usage.total_tokens","typeLabel":"integer"},"input_tokens_details":{"type":"object","properties":{"text_tokens":{"type":"integer","minimum":0,"uniqueKey":"usage.input_tokens_details.text_tokens","typeLabel":"integer"},"image_tokens":{"type":"integer","minimum":0,"uniqueKey":"usage.input_tokens_details.image_tokens","typeLabel":"integer"}},"uniqueKey":"usage.input_tokens_details","typeLabel":"object"},"output_tokens_details":{"type":"object","properties":{"text_tokens":{"type":"integer","minimum":0,"uniqueKey":"usage.output_tokens_details.text_tokens","typeLabel":"integer"},"image_tokens":{"type":"integer","minimum":0,"uniqueKey":"usage.output_tokens_details.image_tokens","typeLabel":"integer"}},"uniqueKey":"usage.output_tokens_details","typeLabel":"object"}},"uniqueKey":"usage","typeLabel":"object"}},"uniqueKey":"","typeLabel":"GPT Image response · object"},"example":{"created":1788307200,"data":[{"b64_json":"iVBORw0KGgo="}],"usage":{"input_tokens":24,"output_tokens":1756,"total_tokens":1780,"input_tokens_details":{"text_tokens":24,"image_tokens":0},"output_tokens_details":{"text_tokens":0,"image_tokens":1756}}},"examples":{"Example":{"title":"Example","value":{"created":1788307200,"data":[{"b64_json":"iVBORw0KGgo="}],"usage":{"input_tokens":24,"output_tokens":1756,"total_tokens":1780,"input_tokens_details":{"text_tokens":24,"image_tokens":0},"output_tokens_details":{"text_tokens":0,"image_tokens":1756}}}}},"exampleType":"examples"}},"exampleType":"examples"},"f5760627-e078-47d7-8775-88ec89c45152":{"description":"Invalid model, field, or parameter value","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","example":"invalid_request_error","isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","example":"insufficient_user_quota","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","example":"insufficient_user_quota","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"invalid_request_error","param":"\u003cstring>","code":"insufficient_user_quota"}}}},"exampleType":"generated"}},"exampleType":"generated"},"bfdfb312-7955-4167-bf4f-d432acc0fe27":{"description":"Missing or invalid YingTu API key","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","example":"invalid_request_error","isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","example":"insufficient_user_quota","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","example":"insufficient_user_quota","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"invalid_request_error","param":"\u003cstring>","code":"insufficient_user_quota"}}}},"exampleType":"generated"}},"exampleType":"generated"},"303925fe-0277-4bc9-b84a-4f23f87f4d7a":{"description":"The key is valid but the account lacks balance or access for this request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","example":"invalid_request_error","isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","example":"insufficient_user_quota","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","example":"insufficient_user_quota","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"message":"Insufficient balance for this request","type":"new_api_error","param":"","code":"insufficient_user_quota"}},"examples":{"Example":{"title":"Example","value":{"error":{"message":"Insufficient balance for this request","type":"new_api_error","param":"","code":"insufficient_user_quota"}}}},"exampleType":"examples"}},"exampleType":"examples"},"d0836968-e774-447c-8a64-ce2df6ada449":{"description":"The selected upstream provider returned a rate, quota, spend, or model-capacity limit. For the documented Nano Banana routes, this is the official upstream provider and the gateway does not apply a fixed platform-side RPM cap. No separate GPT Image gateway RPM or availability objective is currently published.","headers":{"Retry-After":{"description":"Seconds to wait before retrying when supplied.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","example":"invalid_request_error","isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","example":"insufficient_user_quota","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","example":"insufficient_user_quota","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"invalid_request_error","param":"\u003cstring>","code":"insufficient_user_quota"}}}},"exampleType":"generated"}},"exampleType":"generated"},"3fdfb116-7ee4-4b26-bae4-aadeec7afea5":{"description":"The request could not be completed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","example":"invalid_request_error","isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","example":"insufficient_user_quota","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","example":"insufficient_user_quota","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"invalid_request_error","param":"\u003cstring>","code":"insufficient_user_quota"}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"8ab6375f-62d5-4c97-97b2-ec022a4f3d84":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"YingTu API key.","scopes":[]}}},"servers":{"5bf13df1-f17a-4b23-ba56-806150046b80":{"url":"https://api.yingtu.ai","description":"YingTu API"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"YingTu API key.","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"YingTu API key.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"BearerAuth","name":"Authorization"}],"title":"BearerAuth"}]},"originalFileLocation":"openapi-models/gpt-image-2-vip.json"},"subdomain":"yingtu-api","siteName":"YingTu API Docs","title":"GPT Image 2 VIP API examples - YingTu API Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/en/models/image/gpt-image/gpt-image-2-vip/examples","matchLevel":0},"zh-CN":{"href":"/cn/models/image/gpt-image/gpt-image-2-vip/examples","matchLevel":1}}},"lastModified":"2026-09-03T08:08:33.663Z","gitLastModified":"2026-09-03T08:06:43.000Z","originalFileLocation":"en/models/image/gpt-image/gpt-image-2-vip/examples.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Copy gpt-image-2-vip examples for quality-aware generation, idempotent tasks, one or multiple reference images, native result parsing, and invalid values.\">\u003cmeta data-mint-head name=\"application-name\" content=\"YingTu API Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/yingtu-api/3QSLI9NAOxRYBRNN/_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/yingtu-api/3QSLI9NAOxRYBRNN/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/yingtu-api/3QSLI9NAOxRYBRNN/_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/yingtu-api/3QSLI9NAOxRYBRNN/_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/yingtu-api/3QSLI9NAOxRYBRNN/_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/yingtu-api/3QSLI9NAOxRYBRNN/_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/yingtu-api/3QSLI9NAOxRYBRNN/_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/yingtu-api/3QSLI9NAOxRYBRNN/_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/yingtu-api/3QSLI9NAOxRYBRNN/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"GPT Image 2 VIP API examples - YingTu API Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Copy gpt-image-2-vip examples for quality-aware generation, idempotent tasks, one or multiple reference images, native result parsing, and invalid values.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"YingTu API Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.yingtu.ai/en/models/image/gpt-image/gpt-image-2-vip/examples\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://yingtu-api.mintlify.app/_mintlify/api/og/v2?division=GPT+Image+2+VIP\u0026amp;title=GPT+Image+2+VIP+API+examples\u0026amp;description=Copy+gpt-image-2-vip+examples+for+quality-aware+generation%2C+idempotent+tasks%2C+one+or+multiple+reference+images%2C+native+result+parsing%2C+and+invalid+values.\u0026amp;theme=0a912d2ab3269acf063cb40c\u0026amp;signature=e74c92a945a5b49254226cdd13569a4464f55bc519f723cad68b3a99c0cf1c56\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"GPT Image 2 VIP API examples - YingTu API Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Copy gpt-image-2-vip examples for quality-aware generation, idempotent tasks, one or multiple reference images, native result parsing, and invalid values.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://yingtu-api.mintlify.app/_mintlify/api/og/v2?division=GPT+Image+2+VIP\u0026amp;title=GPT+Image+2+VIP+API+examples\u0026amp;description=Copy+gpt-image-2-vip+examples+for+quality-aware+generation%2C+idempotent+tasks%2C+one+or+multiple+reference+images%2C+native+result+parsing%2C+and+invalid+values.\u0026amp;theme=0a912d2ab3269acf063cb40c\u0026amp;signature=e74c92a945a5b49254226cdd13569a4464f55bc519f723cad68b3a99c0cf1c56\">\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/yingtu-api/3QSLI9NAOxRYBRNN/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"YingTu API Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#5146B8\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.yingtu.ai/en/models/image/gpt-image/gpt-image-2-vip/examples\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/en/models/image/gpt-image/gpt-image-2-vip/examples.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.yingtu.ai/en/models/image/gpt-image/gpt-image-2-vip/examples\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-CN\" href=\"https://docs.yingtu.ai/cn/models/image/gpt-image/gpt-image-2-vip/examples\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.yingtu.ai/en/models/image/gpt-image/gpt-image-2-vip/examples\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.yingtu.ai/#organization\",\"name\":\"YingTu\",\"url\":\"https://docs.yingtu.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://docs.yingtu.ai/assets/logo-light.svg\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.yingtu.ai#website\",\"name\":\"YingTu API Docs\",\"url\":\"https://docs.yingtu.ai\",\"publisher\":{\"@id\":\"https://docs.yingtu.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.yingtu.ai/en/models/image/gpt-image/gpt-image-2-vip/examples#webpage\",\"url\":\"https://docs.yingtu.ai/en/models/image/gpt-image/gpt-image-2-vip/examples\",\"name\":\"GPT Image 2 VIP API examples\",\"description\":\"Copy gpt-image-2-vip examples for quality-aware generation, idempotent tasks, one or multiple reference images, native result parsing, and invalid values.\",\"dateModified\":\"2026-09-03T08:06:43.000Z\",\"isPartOf\":{\"@id\":\"https://docs.yingtu.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.yingtu.ai/en/models/image/gpt-image/gpt-image-2-vip/examples#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.yingtu.ai/en/models/image/gpt-image/gpt-image-2-vip/examples#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"GPT Image\",\"item\":\"https://docs.yingtu.ai/en/models/image/gpt-image/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"GPT Image 2 VIP\",\"item\":\"https://docs.yingtu.ai/en/models/image/gpt-image/gpt-image-2-vip/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"GPT Image 2 VIP API examples\",\"item\":\"https://docs.yingtu.ai/en/models/image/gpt-image/gpt-image-2-vip/examples\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.yingtu.ai/en/models/image/gpt-image/gpt-image-2-vip/examples#apireference\",\"headline\":\"GPT Image 2 VIP API examples\",\"name\":\"GPT Image 2 VIP API examples\",\"description\":\"Copy gpt-image-2-vip examples for quality-aware generation, idempotent tasks, one or multiple reference images, native result parsing, and invalid values.\",\"url\":\"https://docs.yingtu.ai/en/models/image/gpt-image/gpt-image-2-vip/examples\",\"mainEntityOfPage\":{\"@id\":\"https://docs.yingtu.ai/en/models/image/gpt-image/gpt-image-2-vip/examples#webpage\"},\"dateModified\":\"2026-09-03T08:06:43.000Z\",\"publisher\":{\"@id\":\"https://docs.yingtu.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.yingtu.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"YingTu API Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"YingTu API Docs","nav":{"global":null,"languages":[{"language":"en","footer":{"links":[{"header":"API resources","items":[{"label":"Model marketplace","href":"https://api.yingtu.ai/pricing"},{"label":"Data handling","href":"/en/resources/data-handling-and-privacy"}]},{"header":"Support","items":[{"label":"API technical support","href":"/en/resources/technical-support"},{"label":"hi@yingtu.ai","href":"mailto:hi@yingtu.ai"}]}]},"navbar":{"links":[{"href":"https://api.yingtu.ai/pricing","label":"Model marketplace"},{"href":"/en/resources/technical-support","label":"Support"}],"primary":{"type":"button","label":"Open console","href":"https://api.yingtu.ai"}},"groups":[{"group":"Nano Banana","icon":"banana","root":{"title":"Nano Banana model overview","sidebarTitle":"Family overview","icon":"banana","href":"/en/models/image/nano-banana/overview"},"expanded":true,"directory":"none","pages":[{"title":"Nano Banana API developer documentation","icon":"banana","href":"/en/introduction"},{"title":"Generate your first image","icon":"rocket","href":"/en/getting-started/quickstart"},{"title":"Compare Nano Banana image models","sidebarTitle":"Model comparison","icon":"columns-3","href":"/en/models/image/nano-banana/comparison"},{"group":"Gemini 2.5 Flash Image","pages":[{"title":"Gemini 2.5 Flash Image API","sidebarTitle":"Overview","icon":"history","href":"/en/models/image/nano-banana/gemini-2.5-flash-image/overview"},{"title":"Gemini 2.5 Flash Image parameters","sidebarTitle":"Parameters","icon":"sliders-horizontal","href":"/en/models/image/nano-banana/gemini-2.5-flash-image/parameters"},{"title":"Gemini 2.5 Flash Image API examples","sidebarTitle":"Examples","icon":"braces","openapi":"openapi-models/gemini-2.5-flash-image.json POST /v1beta/models/gemini-2.5-flash-image:generateContent","playground":"interactive","href":"/en/models/image/nano-banana/gemini-2.5-flash-image/examples"}]},{"group":"Gemini 3.1 Flash Lite Image","pages":[{"title":"Gemini 3.1 Flash Lite Image API","sidebarTitle":"Overview","icon":"gauge","href":"/en/models/image/nano-banana/gemini-3.1-flash-lite-image/overview"},{"title":"Gemini 3.1 Flash Lite Image parameters","sidebarTitle":"Parameters","icon":"sliders-horizontal","href":"/en/models/image/nano-banana/gemini-3.1-flash-lite-image/parameters"},{"title":"Gemini 3.1 Flash Lite Image API examples","sidebarTitle":"Examples","icon":"braces","openapi":"openapi-models/gemini-3.1-flash-lite-image.json POST /v1beta/models/gemini-3.1-flash-lite-image:generateContent","playground":"interactive","href":"/en/models/image/nano-banana/gemini-3.1-flash-lite-image/examples"}]},{"group":"Gemini 3.1 Flash Image","pages":[{"title":"Gemini 3.1 Flash Image API","sidebarTitle":"Overview","icon":"sparkles","href":"/en/models/image/nano-banana/gemini-3.1-flash-image/overview"},{"title":"Gemini 3.1 Flash Image parameters","sidebarTitle":"Parameters","icon":"sliders-horizontal","href":"/en/models/image/nano-banana/gemini-3.1-flash-image/parameters"},{"title":"Gemini 3.1 Flash Image API examples","sidebarTitle":"Examples","icon":"braces","openapi":"openapi-models/gemini-3.1-flash-image.json POST /v1beta/models/gemini-3.1-flash-image:generateContent","playground":"interactive","href":"/en/models/image/nano-banana/gemini-3.1-flash-image/examples"}]},{"group":"Gemini 3 Pro Image","pages":[{"title":"Gemini 3 Pro Image API","sidebarTitle":"Overview","icon":"gem","href":"/en/models/image/nano-banana/gemini-3-pro-image/overview"},{"title":"Gemini 3 Pro Image parameters","sidebarTitle":"Parameters","icon":"sliders-horizontal","href":"/en/models/image/nano-banana/gemini-3-pro-image/parameters"},{"title":"Gemini 3 Pro Image API examples","sidebarTitle":"Examples","icon":"braces","openapi":"openapi-models/gemini-3-pro-image.json POST /v1beta/models/gemini-3-pro-image:generateContent","playground":"interactive","href":"/en/models/image/nano-banana/gemini-3-pro-image/examples"}]},{"group":"Workflows","pages":[{"title":"Use synchronous image generation","icon":"zap","href":"/en/unified-api/synchronous-generation"},{"title":"Run image work as an asynchronous task","icon":"clock-3","href":"/en/unified-api/async-tasks"},{"title":"Poll an asynchronous image task safely","icon":"refresh-cw","href":"/en/unified-api/polling"}]},{"group":"Account and billing","pages":[{"title":"API key authentication","icon":"key-round","href":"/en/getting-started/authentication"},{"title":"API errors and safe retries","icon":"rotate-cw","href":"/en/getting-started/errors-and-retries"},{"title":"API traffic capacity and availability","sidebarTitle":"Limits and availability","icon":"gauge","href":"/en/getting-started/traffic-capacity-and-availability"},{"title":"Image generation billing","icon":"receipt-text","href":"/en/getting-started/billing"},{"title":"API technical support","icon":"life-buoy","href":"/en/resources/technical-support"},{"title":"API data handling and privacy","icon":"shield-check","href":"/en/resources/data-handling-and-privacy"}]},{"group":"Resources","pages":[{"title":"Nano Banana model IDs","icon":"list","href":"/en/resources/model-ids"},{"title":"Nano Banana API pricing","icon":"badge-dollar-sign","href":"/en/resources/pricing"},{"title":"SDK and protocol compatibility","icon":"blocks","href":"/en/resources/sdk-and-protocol-compatibility"},{"title":"API documentation changelog","icon":"history","href":"/en/resources/changelog"}]}]},{"group":"GPT Image","icon":"image","root":{"title":"GPT Image 2 API routes","sidebarTitle":"Overview","icon":"image","href":"/en/models/image/gpt-image/overview"},"expanded":true,"directory":"none","pages":[{"title":"GPT Image 2 Web vs VIP","sidebarTitle":"Compare routes","icon":"columns-3","href":"/en/models/image/gpt-image/comparison"},{"group":"GPT Image 2 Web","pages":[{"title":"GPT Image 2 Web API","sidebarTitle":"Overview","icon":"globe-2","href":"/en/models/image/gpt-image/gpt-image-2-web/overview"},{"title":"GPT Image 2 Web parameters","sidebarTitle":"Parameters","icon":"sliders-horizontal","href":"/en/models/image/gpt-image/gpt-image-2-web/parameters"},{"title":"GPT Image 2 Web API examples","sidebarTitle":"Examples","icon":"braces","openapi":"openapi-models/gpt-image-2-web.json POST /v1/images/generations","playground":"interactive","href":"/en/models/image/gpt-image/gpt-image-2-web/examples"}]},{"group":"GPT Image 2 VIP","pages":[{"title":"GPT Image 2 VIP API","sidebarTitle":"Overview","icon":"gem","href":"/en/models/image/gpt-image/gpt-image-2-vip/overview"},{"title":"GPT Image 2 VIP parameters","sidebarTitle":"Parameters","description":"Reference gpt-image-2-vip size and quality, single or multi-image input, idempotent tasks, native ImagesResponse output, and errors.","icon":"sliders-horizontal","href":"/en/models/image/gpt-image/gpt-image-2-vip/parameters"},{"title":"GPT Image 2 VIP API examples","sidebarTitle":"Examples","icon":"braces","openapi":"openapi-models/gpt-image-2-vip.json POST /v1/images/generations","playground":"interactive","href":"/en/models/image/gpt-image/gpt-image-2-vip/examples"}]}]},{"group":"API Reference","icon":"braces","pages":[{"group":"Unified image tasks","pages":[{"title":"Submit an asynchronous image task","description":"Submit idempotent Nano Banana or GPT Image generation and multi-image editing, then poll the provider-native result.","openapi":"openapi.json POST /v1/images/tasks","href":"/en/api-reference/image-tasks"},{"title":"Retrieve an asynchronous image task","openapi":"openapi.json GET /v1/tasks/{task_id}","href":"/en/api-reference/get-task"}]},{"group":"GPT Image API","pages":[{"title":"Generate a GPT Image image","openapi":"openapi.json POST /v1/images/generations","href":"/en/api-reference/images-generate"},{"title":"Edit an image with GPT Image","openapi":"openapi.json POST /v1/images/edits","href":"/en/api-reference/images-edit"}]},{"group":"Gemini API","pages":[{"title":"Generate an image synchronously","openapi":"openapi.json POST /v1beta/models/{model}:generateContent","href":"/en/api-reference/generate-content"}]}]}]},{"language":"zh-CN","footer":{"links":[{"header":"API 资源","items":[{"label":"模型广场","href":"https://api.yingtu.ai/pricing"},{"label":"数据处理与隐私","href":"/cn/resources/data-handling-and-privacy"}]},{"header":"联系支持","items":[{"label":"API 技术支持","href":"/cn/resources/technical-support"},{"label":"hi@yingtu.ai","href":"mailto:hi@yingtu.ai"}]}]},"navbar":{"links":[{"href":"https://api.yingtu.ai/pricing","label":"模型广场"},{"href":"/cn/resources/technical-support","label":"技术支持"}],"primary":{"type":"button","label":"打开控制台","href":"https://api.yingtu.ai"}},"pages":[{"title":"zh-CN","href":"/cn/models/image/gpt-image/gpt-image-2-vip/examples"}]}]},"basePath":"","title":"GPT Image 2 VIP API examples - YingTu API Docs","buildId":"dpl_G9nrg4qeJSZtah1Ziwbc2n6WkLch","deploymentId":"dpl_G9nrg4qeJSZtah1Ziwbc2n6WkLch","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-B7XKH4J3.js","utils-lOYzL7z-.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DF6jUUIM.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-Dpsj5f7C.js","snippetPresets-CYeiDe8v.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-CUFz1YZ_.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-D8H_iLS4.js","shallow-DdluZBHX.js","getApiPlaygroundDisplay-B9922vev.js","CodeSnippet-CMoRNGYs.js","CodeSnippets-DwyrPHuw.js","Page-DSVu9Ucl.js","getPastedJson-G-zIvlHh.js","icon-B03fnEy0.js","MethodPill-CW7teklc.js","DuplicateIcon-CtO8eekd.js","createIcon-DZTKdM_A.js","DynamicMarkdown-D5M2At0B.js","SectionHeading-C_2NaA2U.js","axios-vUo_bRtp.js","Markdown-D7QRHV3m.js","clsx-D1Z-ELXV.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-lvhuD9Du.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-CKfC4ywL.js"]}