FLUX image editing API reference and live debugger — upload up to 8 reference images + instructions for single-image edits, multi-reference fusion. Works for FLUX.2 and FLUX.1 Kontext.
POST
/
v1
/
images
/
generations
Edit or fuse one or more reference images by instruction
curl --request POST \ --url https://api.apiyi.com/v1/images/generations \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "model": "flux-2-pro", "prompt": "Naturally blend these two images", "input_image": "https://static.apiyi.com/apiyi-logo.png"}'
Playground usage: enter your API Key in Authorization (format Bearer sk-xxx). Paste the public URL of reference image 1 into input_image; for multi-reference, fill the URLs of additional images into input_image_2 … input_image_8. Then fill prompt / model and send. The Playground only accepts URLs; for base64 data URL inputs, copy the code samples below and run them locally.
Use this page for “edit or fuse one or more reference images”. FLUX image editing supports two options:
Option A (this page’s Playground, recommended): JSON + input_image to /v1/images/generations (shared with text-to-image — sending input_image triggers edit mode). Works for all FLUX models (including Kontext, verified), and supports multi-reference fusion (input_image_2 ~ input_image_8).
Option B: the OpenAI-compatible multipart endpoint /v1/images/edits (see the “Option B” section below) — single-image editing, directly compatible with the OpenAI SDK’s client.images.edit().
Endpoint path: /v1/images/generations (shared with text-to-image; an OpenAI-compatible single-image /v1/images/edits endpoint also exists — see Option B)
Every reference image field is a string: input_image / input_image_2 … input_image_8 accept a public URL (recommended) or data:image/...;base64,xxx data URL
Reference image cap varies by model: FLUX.2 [pro/max/flex] up to 8, FLUX.2 [klein] up to 4, FLUX.1 Kontext supports 1 natively
Each image ≤ 20MB or 20MP, formats png / jpg / webp
Input resolution: min 64×64, max 4MP; dimensions must be multiples of 16
Result URL is valid for only 10 minutes — data[0].url must be downloaded immediately
If aspect_ratio is omitted, output dimensions match the first input image
📎 Multi-reference order mattersThe numbering of input_image / input_image_2 / input_image_3 … is exactly the index used by “image 1 / image 2 / image 3” in your prompt:
Place the person from image 1 into the scene from image 2, applying the color palette of image 3.
Each value must be a publicly reachable URL (≤ 20MB recommended) or a data:image/png;base64,xxx data URL.
curl -X POST "https://api.apiyi.com/v1/images/generations" \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "model": "flux-2-pro", "prompt": "The person from image 1 is petting the cat from image 2, the bird from image 3 is next to them", "input_image": "https://example.com/person.jpg", "input_image_2": "https://example.com/cat.jpg", "input_image_3": "https://example.com/bird.jpg", "seed": 42, "output_format": "jpeg" }'
Besides the JSON option above, FLUX image editing also supports the standard OpenAI Images API edit endpoint, directly compatible with client.images.edit() (verified 2026-07-04 with flux-kontext-max, successful generation):
Endpoint: POST https://api.apiyi.com/v1/images/edits
Content-Type: multipart/form-data (set automatically by SDKs and curl -F — do not set it manually, or the boundary gets lost and parsing fails)
The FLUX.1 Kontext series accepts a single input image only; for multi-reference fusion use Option A (input_image ~ input_image_8). Option B is currently verified on the Kontext series.
from openai import OpenAIclient = OpenAI( api_key="sk-your-api-key", base_url="https://api.apiyi.com/v1",)result = client.images.edit( model="flux-kontext-max", image=open("input.jpg", "rb"), prompt="Change the outfit to a fashion look", extra_body={"aspect_ratio": "16:9"}, # FLUX-specific params go through extra_body)print(result.data[0].url)
const form = new FormData();form.append('model', 'flux-kontext-max');form.append('prompt', 'Change the outfit to a fashion look');form.append('aspect_ratio', '16:9');form.append('image', imageBlob, 'input.jpg'); // browser Blob or Node's fs.openAsBlob()const resp = await fetch('https://api.apiyi.com/v1/images/edits', { method: 'POST', headers: { 'Authorization': 'Bearer sk-your-api-key' }, // Note: do NOT set Content-Type manually — let the runtime generate the multipart boundary body: form,});const data = await resp.json();console.log(data.data[0].url);
The response format is identical to Option A (data[0].url, a BFL signed URL valid for 10 minutes — server-side download to your own storage in production).
Upload multiple shots of the same character as references — the model preserves identity features automatically. Great for ad campaigns, comic panels, fashion editorials.
Eight consistent characters from the reference images,in a fashion editorial set on a Tokyo rooftop at golden hour
Style Transfer
One content image + one style image, with explicit reference in the prompt:
Using the style of image 2, render the subject from image 1
Object Composition
Combine objects from multiple images into one new scene:
The person from image 1 is petting the cat from image 2,the bird from image 3 is next to them
Outfit / Product Swap
Swap an outfit from one image to another subject:
Replace the top of the person in image 1 with the one from image 2,keep the pose and background unchanged
Iterative editing: download data[0].url, feed it back as input_image in the next call with a new instruction, and refine progressively. Each round bills as one image.
URL hosted on delivery-eu.bfl.ai / delivery-us.bfl.ai, signature expires after 10 min
CORS is disabled — browser fetch is blocked
Production must server-side download to your own OSS / CDN
The FLUX edit endpoint does not return b64_json — only url
Edit requests cost the same as text-to-image (per image, not per token). Multi-reference does not charge extra for additional images (unlike OpenAI gpt-image-2 editing).
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"API易文档中心","description":"企业级专业稳定的AI大模型API中转站,一个令牌、无限模型。支持OpenAI、Claude、Gemini、DeepSeek、Qwen等400+热门AI模型。","colors":{"primary":"#2563eb","light":"#3b82f6","dark":"#1d4ed8"},"logo":{"light":"https://mintcdn.com/apiyillc/LjCT1O0GrSur6F2v/logo/light.svg?fit=max\u0026auto=format\u0026n=LjCT1O0GrSur6F2v\u0026q=85\u0026s=4119ef17a74cc54be127f34578d8b5fa","dark":"https://mintcdn.com/apiyillc/LjCT1O0GrSur6F2v/logo/dark.svg?fit=max\u0026auto=format\u0026n=LjCT1O0GrSur6F2v\u0026q=85\u0026s=1f046ae9580247d96549ade642b5ecc4"},"favicon":"https://mintcdn.com/apiyillc/OMY6ItCc2mC1yzgA/logo/logo.webp?fit=max\u0026auto=format\u0026n=OMY6ItCc2mC1yzgA\u0026q=85\u0026s=62a7977ef801070e689df2d0291b9d13","api":{"openapi":["api-reference/nano-banana-2-generate-openapi.yaml","api-reference/nano-banana-2-edit-openapi.yaml","api-reference/nano-banana-2-generate-openapi-en.yaml","api-reference/nano-banana-2-edit-openapi-en.yaml","api-reference/nano-banana-pro-generate-openapi.yaml","api-reference/nano-banana-pro-edit-openapi.yaml","api-reference/nano-banana-pro-generate-openapi-en.yaml","api-reference/nano-banana-pro-edit-openapi-en.yaml","api-reference/gpt-image-2-all-generate-openapi.yaml","api-reference/gpt-image-2-all-edit-openapi.yaml","api-reference/gpt-image-2-all-generate-openapi-en.yaml","api-reference/gpt-image-2-all-edit-openapi-en.yaml","api-reference/gpt-image-2-all-chat-openapi.yaml","api-reference/gpt-image-2-all-chat-openapi-en.yaml","api-reference/gpt-image-2-vip-generate-openapi.yaml","api-reference/gpt-image-2-vip-edit-openapi.yaml","api-reference/gpt-image-2-vip-chat-openapi.yaml","api-reference/gpt-image-2-vip-generate-openapi-en.yaml","api-reference/gpt-image-2-vip-edit-openapi-en.yaml","api-reference/gpt-image-2-vip-chat-openapi-en.yaml"],"playground":{"display":"interactive","proxy":true},"examples":{"defaults":"required"}},"navbar":{"links":[{"href":"https://api.apiyi.com","label":"首页"},{"href":"https://imagen.apiyi.com","label":"AI出图"},{"href":"https://icover.ai","label":"AI视频"}],"primary":{"type":"button","label":"控制台","href":"https://api.apiyi.com/account/profile"}},"footer":{"socials":{"website":"https://api.apiyi.com"},"links":[{"header":"AI 集成","items":[{"label":"skill.md","href":"https://docs.apiyi.com/skill.md"},{"label":"llms.txt","href":"https://docs.apiyi.com/llms.txt"},{"label":"llms-full.txt","href":"https://docs.apiyi.com/llms-full.txt"},{"label":"model-registry.json","href":"https://docs.apiyi.com/model-registry.json"},{"label":"AI 开发者套件(中文)","href":"/developer-kit"},{"label":"AI Developer Kit (EN)","href":"/en/developer-kit"}]},{"header":"用户口碑 / Wall of Love","items":[{"label":"用户口碑(中文)","href":"/wall-of-love"},{"label":"Wall of Love (EN)","href":"/en/wall-of-love"}]}]},"seo":{"indexing":"all"},"icons":{"library":"lucide"},"banner":{"content":"🚀 **gemini-4-argon 和 Nano Banana 2.1 均已上线 | Now Live**:[详情 Details](https://docs.apiyi.com/changelog)","dismissible":true},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","aistudio"],"display":"header"},"metadata":{"timestamp":false},"styling":{"latex":true},"navigation":{"global":{"anchors":[]},"languages":[{"language":"zh","href":""},{"language":"en","navbar":{"links":[{"href":"https://api.apiyi.com","label":"Home"},{"href":"https://imagen.apiyi.com","label":"AI Image"},{"href":"https://icover.ai","label":"AI Video"}],"primary":{"type":"button","label":"Console","href":"https://api.apiyi.com/account/profile"}},"href":"en"},{"language":"zh-Hant","banner":{"content":"本頁由程式自動轉換為繁體中文,用詞以台灣正體為準;如有歧義請以[簡體中文版](/)為準。","dismissible":true},"footer":{"socials":{"website":"https://api.apiyi.com"},"links":[{"header":"AI 整合","items":[{"label":"skill.md","href":"https://docs.apiyi.com/skill.md"},{"label":"llms.txt","href":"https://docs.apiyi.com/llms.txt"},{"label":"llms-full.txt","href":"https://docs.apiyi.com/llms-full.txt"},{"label":"model-registry.json","href":"https://docs.apiyi.com/model-registry.json"},{"label":"AI 開發者套件(中文)","href":"/developer-kit"},{"label":"AI Developer Kit (EN)","href":"/en/developer-kit"}]},{"header":"使用者口碑 / Wall of Love","items":[{"label":"使用者口碑(中文)","href":"/wall-of-love"},{"label":"Wall of Love (EN)","href":"/en/wall-of-love"}]}]},"navbar":{"links":[{"href":"https://api.apiyi.com","label":"首頁"},{"href":"https://imagen.apiyi.com","label":"AI出圖"},{"href":"https://icover.ai","label":"AI影片"}],"primary":{"type":"button","label":"控制台","href":"https://api.apiyi.com/account/profile"}},"href":"zh-Hant"},{"language":"ja","banner":{"content":"このページは AI により翻訳されています。内容に相違がある場合は[English 版](/en)を正としてください。","dismissible":true},"footer":{"socials":{"website":"https://api.apiyi.com"},"links":[{"header":"AI統合","items":[{"label":"skill.md","href":"https://docs.apiyi.com/skill.md"},{"label":"llms.txt","href":"https://docs.apiyi.com/llms.txt"},{"label":"llms-full.txt","href":"https://docs.apiyi.com/llms-full.txt"},{"label":"model-registry.json","href":"https://docs.apiyi.com/model-registry.json"},{"label":"AI開発者キット(中国語)","href":"/developer-kit"},{"label":"AI Developer Kit (EN)","href":"/en/developer-kit"}]},{"header":"ユーザーの声 / Wall of Love","items":[{"label":"ユーザーの声(中国語)","href":"/wall-of-love"},{"label":"Wall of Love(英語)","href":"/en/wall-of-love"}]}]},"navbar":{"links":[{"href":"https://api.apiyi.com","label":"ホーム"},{"href":"https://imagen.apiyi.com","label":"AI画像生成"},{"href":"https://icover.ai","label":"AI動画生成"}],"primary":{"type":"button","label":"コンソール","href":"https://api.apiyi.com/account/profile"}},"href":"ja"},{"language":"ko","banner":{"content":"이 페이지는 AI로 번역되었습니다. 내용이 다를 경우 [English 버전](/en)을 기준으로 하십시오.","dismissible":true},"footer":{"socials":{"website":"https://api.apiyi.com"},"links":[{"header":"AI 통합","items":[{"label":"skill.md","href":"https://docs.apiyi.com/skill.md"},{"label":"llms.txt","href":"https://docs.apiyi.com/llms.txt"},{"label":"llms-full.txt","href":"https://docs.apiyi.com/llms-full.txt"},{"label":"model-registry.json","href":"https://docs.apiyi.com/model-registry.json"},{"label":"AI 개발자 키트(중국어)","href":"/developer-kit"},{"label":"AI Developer Kit (EN)","href":"/en/developer-kit"}]},{"header":"사용자 후기 / Wall of Love","items":[{"label":"사용자 후기(중국어)","href":"/wall-of-love"},{"label":"Wall of Love (영문)","href":"/en/wall-of-love"}]}]},"navbar":{"links":[{"href":"https://api.apiyi.com","label":"홈"},{"href":"https://imagen.apiyi.com","label":"AI 이미지 생성"},{"href":"https://icover.ai","label":"AI 동영상 생성"}],"primary":{"type":"button","label":"콘솔","href":"https://api.apiyi.com/account/profile"}},"href":"ko"},{"language":"ru","banner":{"content":"Эта страница переведена с помощью ИИ. При расхождениях ориентируйтесь на [английскую версию](/en).","dismissible":true},"footer":{"socials":{"website":"https://api.apiyi.com"},"links":[{"header":"AI-интеграция","items":[{"label":"skill.md","href":"https://docs.apiyi.com/skill.md"},{"label":"llms.txt","href":"https://docs.apiyi.com/llms.txt"},{"label":"llms-full.txt","href":"https://docs.apiyi.com/llms-full.txt"},{"label":"model-registry.json","href":"https://docs.apiyi.com/model-registry.json"},{"label":"Набор AI-разработчика (кит.)","href":"/developer-kit"},{"label":"AI Developer Kit (EN)","href":"/en/developer-kit"}]},{"header":"Отзывы пользователей / Wall of Love","items":[{"label":"Отзывы пользователей (на китайском)","href":"/wall-of-love"},{"label":"Wall of Love (EN)","href":"/en/wall-of-love"}]}]},"navbar":{"links":[{"href":"https://api.apiyi.com","label":"Главная"},{"href":"https://imagen.apiyi.com","label":"Генерация изображений"},{"href":"https://icover.ai","label":"Генерация видео"}],"primary":{"type":"button","label":"Консоль","href":"https://api.apiyi.com/account/profile"}},"href":"ru"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"apiyillc","hasAudioNarration":false,"actualSubdomain":"apiyillc","customDomains":["docs.apiyi.com"],"gitSource":{"type":"github","owner":"pdmaker","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6adae0f0c0652c49d5a885d8","collectionId":"c8493418-7b92-44ca-9a5d-35147762c803","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6adae0f0c0652c49d5a885d8"},"feedback":{"thumbs":true,"agentFeedback":true},"entitlements":{},"buildId":"6adae0f0c0652c49d5a885d8","clientVersion":"0.0.3964","searchFilterCounts":[{"language":"zh","tag":"首页","count":170},{"language":"en","tag":"Home","count":170},{"language":"ja","tag":"ホーム","count":170},{"language":"ko","tag":"홈","count":170},{"language":"ru","tag":"Главная","count":170},{"language":"zh-Hant","tag":"首頁","count":170},{"language":"zh","tag":"常见问题","count":107},{"language":"en","tag":"FAQ","count":107},{"language":"ru","tag":"FAQ","count":107},{"language":"zh-Hant","tag":"常見問題","count":107},{"language":"ja","tag":"FAQ","count":106},{"language":"ko","tag":"FAQ","count":106},{"language":"zh","tag":"公告","count":75},{"language":"en","tag":"Announcements","count":75},{"language":"zh","tag":"AI风向标","count":72},{"language":"en","tag":"AI Radar","count":72},{"language":"zh","tag":"图片 API(官转)","count":64},{"language":"en","tag":"Image API (Official)","count":64},{"language":"ja","tag":"画像API(公式)","count":64},{"language":"ko","tag":"이미지 API (공식)","count":64},{"language":"ru","tag":"Image API (официальный)","count":64},{"language":"zh-Hant","tag":"圖片 API(官轉)","count":64},{"language":"zh","tag":"模型与调用","count":48},{"language":"en","tag":"Models \u0026 API","count":48},{"language":"ru","tag":"Модели и API","count":48},{"language":"zh-Hant","tag":"模型與呼叫","count":48},{"language":"zh","tag":"使用场景","count":47},{"language":"en","tag":"Use Cases","count":47},{"language":"ja","tag":"モデルとAPI","count":47},{"language":"ja","tag":"活用例","count":47},{"language":"ko","tag":"모델 및 API","count":47},{"language":"ko","tag":"활용 사례","count":47},{"language":"ru","tag":"Сценарии использования","count":47},{"language":"zh-Hant","tag":"使用場景","count":47},{"language":"zh","tag":"模型价格","count":35},{"language":"en","tag":"Model Pricing","count":35},{"language":"ja","tag":"モデル料金","count":35},{"language":"ko","tag":"모델 요금","count":35},{"language":"ru","tag":"Цены на модели","count":35},{"language":"zh-Hant","tag":"模型價格","count":35},{"language":"zh","tag":"基础 API","count":34},{"language":"en","tag":"Basic API","count":34},{"language":"ja","tag":"基本API","count":34},{"language":"ko","tag":"기본 API","count":34},{"language":"ru","tag":"Базовый API","count":34},{"language":"zh-Hant","tag":"基礎 API","count":34},{"language":"zh","tag":"视频 API(官转)","count":31},{"language":"en","tag":"Video API (Official)","count":31},{"language":"ja","tag":"動画API(公式)","count":31},{"language":"ko","tag":"동영상 API (공식)","count":31},{"language":"ru","tag":"Video API (официальный)","count":31},{"language":"zh-Hant","tag":"影片 API(官轉)","count":31},{"language":"ja","tag":"テキスト生成","count":26},{"language":"ko","tag":"텍스트 생성","count":26},{"language":"ru","tag":"Генерация текста","count":26},{"language":"zh-Hant","tag":"文本生成","count":26},{"language":"ja","tag":"課金とセキュリティ","count":16},{"language":"ko","tag":"결제 및 보안","count":16},{"language":"ru","tag":"Оплата и безопасность","count":16},{"language":"zh-Hant","tag":"充值與安全","count":16}]},"assistantConfig":{},"hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"models/models.css","content":".mp-layout{display:flex;gap:2.5rem;max-width:1400px;margin:0 auto;padding:2.5rem 1.5rem 4rem;font-size:15px;line-height:1.7;color:rgb(var(--gray-500, 113 115 119))}html.dark .mp-layout{color:rgb(var(--gray-400, 159 161 165))}.mp-rail{display:none}@media (min-width:1024px){.mp-rail{display:block;width:13rem;flex-shrink:0}}.mp-rail-nav{position:sticky;top:9.25rem;font-size:.875rem}.mp-rail-head{font-weight:600;margin:0 0 .375rem;color:rgb(var(--gray-900, 23 25 29))}html.dark .mp-rail-head{color:rgb(var(--gray-200, 223 225 229))}.mp-rail-link{display:block;padding:.22rem 0;color:rgb(var(--gray-500, 113 115 119));text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mp-content a,.mp-content code.mp-ep-rec,.mp-rail-link:hover{color:rgb(var(--primary, 37 99 235))}html.dark .mp-rail-link{color:rgb(var(--gray-400, 159 161 165))}html.dark .mp-content a,html.dark .mp-content code.mp-ep-rec,html.dark .mp-rail-link:hover{color:rgb(var(--primary-light, 59 130 246))}.mp-rail-vendors{max-height:45vh;overflow-y:auto}.mp-mt{margin-top:1rem}.mp-content{min-width:0;flex:1}.mp-content h2,.mp-title{color:rgb(var(--gray-900, 23 25 29))}.mp-title{font-size:2rem;font-weight:700;letter-spacing:-.02em;margin:0 0 .5rem}html.dark .mp-content strong,html.dark .mp-title{color:#fff}.mp-desc{color:rgb(var(--gray-500, 113 115 119));margin:0 0 1.5rem}html.dark .mp-content th,html.dark .mp-desc{color:rgb(var(--gray-400, 159 161 165))}.mp-content h2{font-size:1.375rem;font-weight:600;margin:2.75rem 0 1rem;padding-bottom:.45rem;border-bottom:1px solid rgb(var(--gray-200, 223 225 229)/.7);scroll-margin-top:12rem}@media (min-width:1024px){.mp-content h2{scroll-margin-top:16.5rem}}html.dark .mp-content h2{border-color:rgb(255 255 255/.1);color:#fff}.mp-content p,.mp-content ul{margin:.75rem 0}.mp-content ul{padding-left:1.4rem}.mp-content li{margin:.4rem 0}.mp-content strong{color:rgb(var(--gray-900, 23 25 29))}.mp-content a{text-decoration:none}.mp-content a:hover{text-decoration:underline}.mp-content code{font-size:.85em;background:rgb(var(--gray-100, 239 241 245)/.8);border:1px solid rgb(var(--gray-200, 223 225 229)/.7);padding:.1em .35em;border-radius:.375rem}html.dark .mp-content code{background:rgb(255 255 255/.06);border-color:rgb(255 255 255/.1)}.mp-content code.mp-ep-rec{background:rgb(var(--primary, 37 99 235)/.08);border-color:rgb(var(--primary, 37 99 235)/.45);font-weight:600}html.dark .mp-content code.mp-ep-rec{background:rgb(var(--primary-light, 59 130 246)/.14);border-color:rgb(var(--primary-light, 59 130 246)/.5)}.mp-content table{display:block;max-width:100%;overflow-x:auto;border-collapse:collapse;font-size:.875rem;margin:1rem 0 1.5rem}.mp-content td,.mp-content th{padding:.55rem 1.25rem .55rem 0;white-space:nowrap}.mp-content th{text-align:left;font-weight:500;color:rgb(var(--gray-500, 113 115 119));border-bottom:1px solid rgb(var(--gray-200, 223 225 229)/.7)}.mp-content td{border-bottom:1px solid rgb(var(--gray-200, 223 225 229)/.45)}html.dark .mp-content th{border-color:rgb(255 255 255/.1)}html.dark .mp-content td{border-color:rgb(255 255 255/.07)}.mp-search{display:contents}.mp-search-bar{position:sticky;top:5rem;z-index:20;margin:0 0 1.75rem;background:rgb(var(--background-light, 255 255 255));padding:.75rem 0 .85rem;box-shadow:0 10px 14px -10px rgb(var(--gray-950, 11 13 17)/.28)}@media (min-width:1024px){.mp-search-bar{top:9.25rem}}html.dark .mp-search-bar{background:rgb(var(--background-dark, 10 11 16));box-shadow:0 8px 12px -10px rgb(0 0 0/.7)}.mp-search-label{margin:0 0 .5rem;padding-left:.6rem;border-left:3px solid rgb(var(--primary, 37 99 235));font-size:.9rem;font-weight:600;line-height:1.4;color:rgb(var(--primary, 37 99 235))}html.dark .mp-search-label{border-left-color:rgb(var(--primary-light, 59 130 246));color:rgb(var(--primary-light, 59 130 246))}.mp-search-input{width:100%;box-sizing:border-box;border:1px solid rgb(var(--gray-400, 159 161 165)/.3);border-radius:.75rem;padding:.7rem 1rem .7rem 2.65rem;font-size:.9rem;background-color:rgb(var(--background-light, 255 255 255));background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23717377' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E\");background-repeat:no-repeat;background-position:.9rem center;color:rgb(var(--gray-900, 23 25 29));outline:0;transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease}.mp-search-input::placeholder{color:rgb(var(--gray-500, 113 115 119))}.mp-search-input:hover{border-color:rgb(var(--gray-600, 81 83 87)/.3)}.mp-search-input:focus{border-color:rgb(var(--primary, 37 99 235));box-shadow:0 0 0 3px rgb(var(--primary, 37 99 235)/.16)}html.dark .mp-search-input{background-color:rgb(var(--background-dark, 10 11 16));background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239fa1a5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E\");border-color:rgb(var(--gray-600, 81 83 87)/.3);color:rgb(var(--gray-100, 239 241 245))}html.dark .mp-search-input::placeholder{color:rgb(255 255 255/.5)}html.dark .mp-search-input:hover{border-color:rgb(var(--gray-500, 113 115 119)/.35)}html.dark .mp-search-input:focus{border-color:rgb(var(--primary-light, 59 130 246));box-shadow:0 0 0 3px rgb(var(--primary-light, 59 130 246)/.22)}.mp-search-empty,.mp-search-meta{color:rgb(var(--gray-500, 113 115 119))}.mp-search-meta{font-size:.75rem;margin:.75rem 0 .25rem}.mp-search-empty{font-size:.875rem;margin-top:.75rem}html.dark .mp-search-empty,html.dark .mp-search-meta{color:rgb(var(--gray-400, 159 161 165))}.mp-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.8125rem}@media (min-width:1024px){.mp-jump{display:none}}"},{"filePath":"styles/agent-prompt.css","content":"div.prompt{border:1.5px solid rgb(var(--primary, 37 99 235)/.35);background:rgb(var(--primary, 37 99 235)/.035);padding:1.25rem 1.25rem 1rem;row-gap:.75rem}html.dark div.prompt{border-color:rgb(var(--primary-light, 59 130 246)/.4);background:rgb(var(--primary-light, 59 130 246)/.06)}div.prompt [data-component-part=prompt-content-wrapper]{width:100%}div.prompt [data-component-part=prompt-actions-wrapper]{width:100%;justify-content:flex-end}div.prompt [data-component-part=prompt-description]{flex:1;font-size:14px;line-height:1.65}div.prompt [data-component-part=prompt-description]>div>*{margin:0}div.prompt [data-component-part=prompt-description]>div>*+*{margin-top:.6rem}div.prompt [data-component-part=prompt-description] strong{font-size:15px;font-weight:650;color:rgb(var(--gray-900, 23 25 29))}html.dark div.prompt [data-component-part=prompt-description] strong{color:#fff}div.prompt [data-component-part=prompt-description]>div>*+p{color:rgb(var(--gray-600, 80 82 86))}html.dark div.prompt [data-component-part=prompt-description]>div>*+p{color:rgb(var(--gray-400, 159 161 165))}div.prompt [data-component-part=prompt-description] code{font-size:.85em;background:rgb(var(--gray-100, 239 241 245)/.9);border:1px solid rgb(var(--gray-200, 223 225 229)/.7);padding:.05em .35em;border-radius:.375rem}html.dark div.prompt [data-component-part=prompt-description] code{background:rgb(255 255 255/.06);border-color:rgb(255 255 255/.1)}div.prompt [data-component-part=prompt-description] blockquote{margin:0;padding:.75rem .9rem;font-style:normal;border:1px dashed rgb(var(--gray-300, 191 193 197));border-radius:.6rem;background:rgb(var(--background-light, 255 255 255));font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12.5px;line-height:1.6;color:rgb(var(--gray-600, 80 82 86));overflow-wrap:anywhere;-webkit-mask-image:linear-gradient(to bottom,#000 70%,transparent 100%);mask-image:linear-gradient(to bottom,#000 70%,transparent 100%)}div.prompt [data-component-part=prompt-description] blockquote ol,div.prompt [data-component-part=prompt-description] blockquote p{margin:0}div.prompt [data-component-part=prompt-description] blockquote li{padding:0}div.prompt [data-component-part=prompt-description] blockquote>*+*{margin-top:.5rem}div.prompt [data-component-part=prompt-description] blockquote code{background:0 0;border:0;padding:0;font-size:1em}div.prompt [data-component-part=prompt-description] blockquote a{color:inherit;text-decoration:none;pointer-events:none}html.dark div.prompt [data-component-part=prompt-description] blockquote{border-color:rgb(255 255 255/.15);background:rgb(var(--background-dark, 13 13 13));color:rgb(var(--gray-400, 159 161 165))}div.prompt [data-component-part=prompt-action-copy-button]{padding:.6rem 1.25rem;font-size:14px;line-height:20px;font-weight:600;border-radius:.65rem;gap:.45rem;box-shadow:0 1px 2px rgb(0 0 0/.08),0 4px 12px rgb(var(--primary, 37 99 235)/.25)}div.prompt [data-component-part=prompt-action-copy-button]::before{content:\"\";width:16px;height:16px;flex-shrink:0;background:currentColor;-webkit-mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='14' x='8' y='8' rx='2' ry='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E\") center/contain no-repeat;mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='14' x='8' y='8' rx='2' ry='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E\") center/contain no-repeat}div.prompt [data-component-part=prompt-action-copy-button] svg{width:12px;height:12px}@media (max-width:640px){div.prompt [data-component-part=prompt-actions-wrapper]>*{flex:1}}"}],"page":{"pagePath":"en/api-capabilities/flux/image-edit","slug":"/en/api-capabilities/flux/image-edit","pageMetadata":{"title":"Image Editing API Reference","description":"FLUX image editing API reference and live debugger — upload up to 8 reference images + instructions for single-image edits, multi-reference fusion. Works for FLUX.2 and FLUX.1 Kontext.","openapi":"api-reference/flux-edit-openapi-en.yaml POST /v1/images/generations","icon":"image","href":"/en/api-capabilities/flux/image-edit"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"FLUX image editing API reference and live debugger — upload up to 8 reference images + instructions for single-image edits, multi-reference fusion. Works for FLUX.2 and FLUX.1 Kontext.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,blockquote:`blockquote`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Accordion,AccordionGroup,CodeBlock,Heading,Info,Note,Table,Tip,Warning}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!AccordionGroup)_missingMdxReference(`AccordionGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Info,{children:_jsxs(_components.p,{children:[`Playground usage: enter your API Key in `,_jsx(_components.strong,{children:`Authorization`}),` (format `,_jsx(_components.code,{children:`Bearer sk-xxx`}),`). Paste the `,_jsx(_components.strong,{children:`public URL`}),` of reference image 1 into `,_jsx(_components.code,{children:`input_image`}),`; for multi-reference, fill the URLs of additional images into `,_jsx(_components.code,{children:`input_image_2`}),` … `,_jsx(_components.code,{children:`input_image_8`}),`. Then fill `,_jsx(_components.code,{children:`prompt`}),` / `,_jsx(_components.code,{children:`model`}),` and send. The Playground only accepts URLs; for base64 data URL inputs, copy the code samples below and run them locally.`]})}),`\n`,_jsxs(Tip,{children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Use this page for`}),` “edit or fuse one or more reference images”. FLUX image editing supports two options:`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Option A (this page’s Playground, recommended)`}),`: JSON + `,_jsx(_components.code,{children:`input_image`}),` to `,_jsx(_components.code,{children:`/v1/images/generations`}),` (shared with text-to-image — sending `,_jsx(_components.code,{children:`input_image`}),` triggers edit mode). Works for all FLUX models (including Kontext, verified), and supports multi-reference fusion (`,_jsx(_components.code,{children:`input_image_2`}),` ~ `,_jsx(_components.code,{children:`input_image_8`}),`).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Option B`}),`: the OpenAI-compatible multipart endpoint `,_jsx(_components.code,{children:`/v1/images/edits`}),` (see the “Option B” section below) — single-image editing, directly compatible with the OpenAI SDK’s `,_jsx(_components.code,{children:`client.images.edit()`}),`.`]}),`\n`]}),_jsxs(_components.p,{children:[`For pure text-to-image, see the `,_jsx(_components.a,{href:`/en/api-capabilities/flux/text-to-image`,children:`Text-to-Image endpoint`}),`.`]})]}),`\n`,_jsxs(Warning,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`⚠️ Key differences / notes (Option A)`})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Endpoint path`}),`: `,_jsx(_components.code,{children:`/v1/images/generations`}),` (shared with text-to-image; an OpenAI-compatible single-image `,_jsx(_components.code,{children:`/v1/images/edits`}),` endpoint also exists — see Option B)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Content-Type`}),`: `,_jsx(_components.code,{children:`application/json`}),` (Option B’s `,_jsx(_components.code,{children:`/edits`}),` endpoint uses `,_jsx(_components.code,{children:`multipart/form-data`}),` instead)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Every reference image field is a string`}),`: `,_jsx(_components.code,{children:`input_image`}),` / `,_jsx(_components.code,{children:`input_image_2`}),` … `,_jsx(_components.code,{children:`input_image_8`}),` accept a public URL (recommended) or `,_jsx(_components.code,{children:`data:image/...;base64,xxx`}),` data URL`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Reference image cap varies by model`}),`: FLUX.2 [pro/max/flex] up to `,_jsx(_components.strong,{children:`8`}),`, FLUX.2 [klein] up to `,_jsx(_components.strong,{children:`4`}),`, FLUX.1 Kontext supports `,_jsx(_components.strong,{children:`1`}),` natively`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Each image ≤ 20MB or 20MP`}),`, formats `,_jsx(_components.code,{children:`png`}),` / `,_jsx(_components.code,{children:`jpg`}),` / `,_jsx(_components.code,{children:`webp`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Input resolution`}),`: min 64×64, max 4MP; dimensions must be multiples of 16`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Result URL is valid for only 10 minutes`}),` — `,_jsx(_components.code,{children:`data[0].url`}),` must be downloaded immediately`]}),`\n`,_jsx(_components.li,{children:_jsxs(_components.strong,{children:[`If `,_jsx(_components.code,{children:`aspect_ratio`}),` is omitted, output dimensions match the first input image`]})}),`\n`]})]}),`\n`,_jsxs(Warning,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`📎 Multi-reference order matters`})}),_jsxs(_components.p,{children:[`The numbering of `,_jsx(_components.code,{children:`input_image`}),` / `,_jsx(_components.code,{children:`input_image_2`}),` / `,_jsx(_components.code,{children:`input_image_3`}),` … `,_jsx(_components.strong,{children:`is exactly the index used by “image 1 / image 2 / image 3”`}),` in your prompt:`]}),_jsxs(_components.blockquote,{children:[`\n`,_jsx(_components.p,{children:`Place the person from image 1 into the scene from image 2, applying the color palette of image 3.`}),`\n`]}),_jsxs(_components.p,{children:[`Each value must be a publicly reachable URL (≤ 20MB recommended) or a `,_jsx(_components.code,{children:`data:image/png;base64,xxx`}),` data URL.`]})]}),`\n`,_jsx(Heading,{level:`2`,id:`code-examples`,children:`Code Examples`}),`\n`,_jsx(Heading,{level:`3`,id:`curl-two-image-fusion-·-url`,children:`cURL (two-image fusion · URL)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,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:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.apiyi.com/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 sk-your-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\": \"flux-2-pro\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"prompt\": \"Naturally blend these two images\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"input_image\": \"https://static.apiyi.com/apiyi-logo.png\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"input_image_2\": \"https://images.unsplash.com/photo-1762138012600-2ab523f8b35a\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"seed\": 42,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"output_format\": \"jpeg\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`curl-three-image-fusion-·-url`,children:`cURL (three-image fusion · URL)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,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:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.apiyi.com/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 sk-your-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\": \"flux-2-pro\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"prompt\": \"The person from image 1 is petting the cat from image 2, the bird from image 3 is next to them\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"input_image\": \"https://example.com/person.jpg\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"input_image_2\": \"https://example.com/cat.jpg\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"input_image_3\": \"https://example.com/bird.jpg\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"seed\": 42,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"output_format\": \"jpeg\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`curl-single-image-edit-·-kontext`,children:`cURL (single-image edit · Kontext)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.apiyi.com/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 sk-your-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\": \"flux-kontext-pro\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"prompt\": \"Convert this architectural photo into a pencil sketch style, preserve all structural details\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"input_image\": \"https://your-oss.example.com/architecture.jpg\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`curl-local-file-·-base64-data-url`,children:`cURL (local file · base64 data URL)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,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:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Encode local image as base64 data URL (macOS / Linux)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`B64`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--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:` -w0`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` person.png`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` 2>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/dev/null`}),_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:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` person.png`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` tr`}),_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,{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:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.apiyi.com/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 sk-your-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:` \"$(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`jq`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -nc`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --arg`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` img \"data:image/png;base64,`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$B64`}),_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: \"flux-2-pro\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` prompt: \"Stylize image 1 as an oil painting\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` input_image: $img`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }')\"`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`python-requests-·-two-image-fusion`,children:`Python (requests · two-image fusion)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`23`,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:`23`,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:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`resp `}),_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.apiyi.com/v1/images/generations\"`}),_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:`{`})]}),`\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:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer sk-your-api-key\"`}),_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\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"application/json\"`}),_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:` 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:`\"flux-2-pro\"`}),_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:`\"Naturally blend these two images\"`}),_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:` \"input_image\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://static.apiyi.com/apiyi-logo.png\"`}),_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:` \"input_image_2\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://images.unsplash.com/photo-1762138012600-2ab523f8b35a\"`}),_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:` \"seed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`42`}),_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:` \"output_format\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"jpeg\"`}),_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:`120`}),_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:`image_url `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` resp.json()[`}),_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:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# data[0].url is valid for only 10 minutes — download immediately`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`with`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` open`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"fused.jpg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"wb\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` f:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` f.write(requests.get(image_url, `}),_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:`).content)`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`python-requests-·-local-file-as-base64`,children:`Python (requests · local file as base64)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`23`,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:`23`,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, requests, mimetypes`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` to_data_url`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`path`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) -> `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_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:` mime `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` mimetypes.guess_type(path)[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_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:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"image/png\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` with`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` open`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(path, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"rb\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` f:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` b64 `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` base64.b64encode(f.read()).decode()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"data:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`mime`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`;base64,`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`b64`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`resp `}),_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.apiyi.com/v1/images/generations\"`}),_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:`{`})]}),`\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:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer sk-your-api-key\"`}),_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\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"application/json\"`}),_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:` 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:`\"flux-2-pro\"`}),_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:`\"Place the person from image 1 into the scene from image 2\"`}),_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:` \"input_image\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: to_data_url(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"person.png\"`}),_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:` \"input_image_2\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://your-oss.example.com/scene.jpg\"`}),_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:`120`}),_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:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(resp.json()[`}),_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:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`python-openai-sdk-·-pass-input_image-via-extra_body`,children:`Python (OpenAI SDK · pass input_image via extra_body)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`23`,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:`23`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` openai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI`})]}),`\n`,_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:`client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"sk-your-api-key\"`}),_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:` base_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.apiyi.com/v1\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# OpenAI SDK images.generate() targets /v1/images/generations with JSON;`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# BFL-native fields are added straight into the body via extra_body.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`resp `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.images.generate(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"flux-2-pro\"`}),_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:` prompt`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Naturally blend these two images\"`}),_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:` extra_body`}),_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:` \"input_image\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://static.apiyi.com/apiyi-logo.png\"`}),_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:` \"input_image_2\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://images.unsplash.com/photo-1762138012600-2ab523f8b35a\"`}),_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:` \"seed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`42`}),_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:` \"output_format\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"jpeg\"`}),_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:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`image_url `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` resp.data[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].url`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`with`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` open`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"fused.jpg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"wb\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` f:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` f.write(requests.get(image_url, `}),_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:`).content)`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`node-js-fetch-·-multi-reference-fusion`,children:`Node.js (fetch · multi-reference fusion)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`20`,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:`20`,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:` resp`}),_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.apiyi.com/v1/images/generations'`}),_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:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Bearer sk-your-api-key'`}),_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`,_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:` 'flux-2-pro'`}),_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:` 'Naturally blend these two 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\":`#9CDCFE`},children:` input_image:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://static.apiyi.com/apiyi-logo.png'`}),_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_image_2:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://images.unsplash.com/photo-1762138012600-2ab523f8b35a'`}),_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:` seed:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 42`}),_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:` output_format:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'jpeg'`}),_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`,_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:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`data`}),_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:` resp`}),_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:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` img`}),_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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`url`}),_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:` fs`}),_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:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'node:fs'`}),_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:`fs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`writeFileSync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'fused.jpg'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Buffer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--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:` img`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`arrayBuffer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()));`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`option-b-openai-compatible-edit-endpoint-multipart`,children:`Option B: OpenAI-Compatible Edit Endpoint (multipart)`}),`\n`,_jsxs(_components.p,{children:[`Besides the JSON option above, FLUX image editing also supports the standard OpenAI Images API edit endpoint, directly compatible with `,_jsx(_components.code,{children:`client.images.edit()`}),` (verified 2026-07-04 with `,_jsx(_components.code,{children:`flux-kontext-max`}),`, successful generation):`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Endpoint`}),`: `,_jsx(_components.code,{children:`POST https://api.apiyi.com/v1/images/edits`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Content-Type`}),`: `,_jsx(_components.code,{children:`multipart/form-data`}),` (set automatically by SDKs and curl `,_jsx(_components.code,{children:`-F`}),` — `,_jsx(_components.strong,{children:`do not set it manually`}),`, or the boundary gets lost and parsing fails)`]}),`\n`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`The FLUX.1 Kontext series accepts a single input image only; for multi-reference fusion use Option A (`,_jsx(_components.code,{children:`input_image`}),` ~ `,_jsx(_components.code,{children:`input_image_8`}),`). Option B is currently verified on the Kontext series.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`request-parameters-form-fields`,children:`Request Parameters (form fields)`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Required`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`model`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`✓`}),_jsxs(_components.td,{children:[`E.g. `,_jsx(_components.code,{children:`flux-kontext-max`}),` / `,_jsx(_components.code,{children:`flux-kontext-pro`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`prompt`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`✓`}),_jsx(_components.td,{children:`Edit instruction`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`image`})}),_jsx(_components.td,{children:`file`}),_jsx(_components.td,{children:`✓`}),_jsxs(_components.td,{children:[`Source image binary (png/jpg/webp, ≤ 20MB). `,_jsxs(_components.strong,{children:[`The field name must be `,_jsx(_components.code,{children:`image`})]}),` — omitting it returns `,_jsx(_components.code,{children:`image is required`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`aspect_ratio`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`✗`}),_jsxs(_components.td,{children:[`E.g. `,_jsx(_components.code,{children:`1:1`}),` / `,_jsx(_components.code,{children:`16:9`}),`, passed as a top-level form field; OpenAI SDK users pass it via `,_jsx(_components.code,{children:`extra_body`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`safety_tolerance`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`✗`}),_jsx(_components.td,{children:`0 (strictest) – 6 (most permissive)`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`curl-example`,children:`cURL Example`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,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:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.apiyi.com/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 sk-your-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=flux-kontext-max\"`}),_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=Change the outfit to a fashion look\"`}),_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:` \"aspect_ratio=16:9\"`}),_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:` \"[email protected]\"`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`python-openai-sdk-example`,children:`Python (OpenAI SDK) Example`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,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:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` openai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"sk-your-api-key\"`}),_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:` base_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.apiyi.com/v1\"`}),_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`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`result `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.images.edit(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"flux-kontext-max\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` image`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`open`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"input.jpg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"rb\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` prompt`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Change the outfit to a fashion look\"`}),_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:` extra_body`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"aspect_ratio\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"16:9\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# FLUX-specific params go through extra_body`})]}),`\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:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(result.data[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].url)`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`node-js-fetch-+-formdata-example`,children:`Node.js (fetch + FormData) Example`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,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:`14`,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:` form`}),_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:` FormData`}),_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:`form`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`append`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},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:`'flux-kontext-max'`}),_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:`form`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`append`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},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:`'Change the outfit to a fashion look'`}),_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:`form`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`append`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'aspect_ratio'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'16:9'`}),_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:`form`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`append`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'image'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`imageBlob`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'input.jpg'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// browser Blob or Node's fs.openAsBlob()`})]}),`\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:` resp`}),_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.apiyi.com/v1/images/edits'`}),_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:` { `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Authorization'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Bearer sk-your-api-key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Note: do NOT set Content-Type manually — let the runtime generate the multipart boundary`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` form`}),_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\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` data`}),_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:` resp`}),_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:`data`}),_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\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`url`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The response format is identical to Option A (`,_jsx(_components.code,{children:`data[0].url`}),`, a BFL signed URL valid for 10 minutes — server-side download to your own storage in production).`]}),`\n`,_jsx(Heading,{level:`3`,id:`which-option-should-i-use`,children:`Which Option Should I Use?`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{}),_jsxs(_components.th,{children:[`Option A (JSON `,_jsx(_components.code,{children:`input_image`}),`)`]}),_jsxs(_components.th,{children:[`Option B (multipart `,_jsx(_components.code,{children:`/edits`}),`)`]})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Best for`}),_jsx(_components.td,{children:`Direct HTTP / frontend apps / multi-reference fusion`}),_jsxs(_components.td,{children:[`Existing OpenAI SDK code, `,_jsx(_components.code,{children:`client.images.edit()`}),` migration`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Multi-image`}),_jsx(_components.td,{children:`Yes (flux-2 up to 8)`}),_jsx(_components.td,{children:`Single image only`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Image input`}),_jsx(_components.td,{children:`Public URL or base64 data URL`}),_jsx(_components.td,{children:`Binary file`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`parameter-reference`,children:`Parameter Reference`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Required`}),_jsx(_components.th,{children:`Default`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`model`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Yes`}),_jsx(_components.td,{children:`—`}),_jsxs(_components.td,{children:[`FLUX model ID. For multi-reference fusion prefer `,_jsx(_components.code,{children:`flux-2-pro`}),` / `,_jsx(_components.code,{children:`flux-2-max`}),`; for single-image edits also `,_jsx(_components.code,{children:`flux-kontext-max`}),` / `,_jsx(_components.code,{children:`flux-kontext-pro`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`prompt`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Yes`}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:`Edit / fusion instruction, up to 32K tokens. Use “image 1 / image 2 / image 3” to reference image / input_image_2 / input_image_3 ordering`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`input_image`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Yes`}),_jsx(_components.td,{children:`—`}),_jsxs(_components.td,{children:[`Reference image 1. Public URL (recommended) or `,_jsx(_components.code,{children:`data:image/...;base64,xxx`}),` data URL`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`input_image_2`}),` … `,_jsx(_components.code,{children:`input_image_8`})]}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:`Reference images 2–8 — URL or data URL. FLUX.2 [pro/max/flex] up to 8, [klein] 4, Kontext does not support extras`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`aspect_ratio`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`matches first input`}),_jsxs(_components.td,{\"data-numeric\":`true`,children:[`E.g. `,_jsx(_components.code,{children:`1:1`}),` / `,_jsx(_components.code,{children:`16:9`}),` / `,_jsx(_components.code,{children:`9:16`}),` / `,_jsx(_components.code,{children:`4:3`}),` / `,_jsx(_components.code,{children:`3:2`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`seed`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`random`}),_jsx(_components.td,{children:`Fix for reproducibility`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`safety_tolerance`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`2`})}),_jsx(_components.td,{children:`0 (strictest) – 6 (most permissive)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`output_format`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`jpeg`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`jpeg`}),` / `,_jsx(_components.code,{children:`png`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`prompt_upsampling`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`false`})}),_jsx(_components.td,{children:`Auto-upsample the prompt`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`steps`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`50`})}),_jsxs(_components.td,{children:[_jsxs(_components.strong,{children:[`Only `,_jsx(_components.code,{children:`flux-2-flex`})]}),`, max 50`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`guidance`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`4.5`})}),_jsxs(_components.td,{children:[_jsxs(_components.strong,{children:[`Only `,_jsx(_components.code,{children:`flux-2-flex`})]}),`, 1.5–10`]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`multi-reference-strategies`,children:`Multi-Reference Strategies`}),`\n`,_jsxs(AccordionGroup,{children:[_jsxs(Accordion,{icon:`user`,title:`Character Consistency (up to 8 images)`,id:`character-consistency-up-to-8-images`,children:[_jsx(_components.p,{children:`Upload multiple shots of the same character as references — the model preserves identity features automatically. Great for ad campaigns, comic panels, fashion editorials.`}),_jsx(CodeBlock,{numberOfLines:`3`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Eight consistent characters from the reference images,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`in a fashion editorial set on a Tokyo rooftop at golden hour`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]}),_jsxs(Accordion,{icon:`palette`,title:`Style Transfer`,id:`style-transfer`,children:[_jsx(_components.p,{children:`One content image + one style image, with explicit reference in the prompt:`}),_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Using the style of image 2, render the subject from image 1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]}),_jsxs(Accordion,{icon:`layers`,title:`Object Composition`,id:`object-composition`,children:[_jsx(_components.p,{children:`Combine objects from multiple images into one new scene:`}),_jsx(CodeBlock,{numberOfLines:`3`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`The person from image 1 is petting the cat from image 2,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`the bird from image 3 is next to them`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]}),_jsxs(Accordion,{icon:`shirt`,title:`Outfit / Product Swap`,id:`outfit-product-swap`,children:[_jsx(_components.p,{children:`Swap an outfit from one image to another subject:`}),_jsx(CodeBlock,{numberOfLines:`3`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Replace the top of the person in image 1 with the one from image 2,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`keep the pose and background unchanged`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]})]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Iterative editing`}),`: download `,_jsx(_components.code,{children:`data[0].url`}),`, feed it back as `,_jsx(_components.code,{children:`input_image`}),` in the next call with a new instruction, and refine progressively. Each round bills as one image.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`response-format`,children:`Response Format`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`8`,children:[_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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"created\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1776832476`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data\"`}),_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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://delivery-eu.bfl.ai/results/xxx/sample.jpeg?signature=...\"`})]}),`\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`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(Warning,{children:[_jsx(_components.p,{children:_jsxs(_components.strong,{children:[`⚠️ `,_jsx(_components.code,{children:`data[0].url`}),` is valid for only 10 minutes`]})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`URL hosted on `,_jsx(_components.code,{children:`delivery-eu.bfl.ai`}),` / `,_jsx(_components.code,{children:`delivery-us.bfl.ai`}),`, signature expires after 10 min`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`CORS is disabled`}),` — browser `,_jsx(_components.code,{children:`fetch`}),` is blocked`]}),`\n`,_jsx(_components.li,{children:`Production must server-side download to your own OSS / CDN`}),`\n`,_jsxs(_components.li,{children:[`The FLUX edit endpoint does `,_jsx(_components.strong,{children:`not`}),` return `,_jsx(_components.code,{children:`b64_json`}),` — only url`]}),`\n`]})]}),`\n`,_jsx(Info,{children:_jsx(_components.p,{children:`Edit requests cost the same as text-to-image (per image, not per token). Multi-reference does not charge extra for additional images (unlike OpenAI gpt-image-2 editing).`})}),`\n`,_jsx(Heading,{level:`2`,id:`faq`,children:`FAQ`}),`\n`,_jsx(AccordionGroup,{children:_jsxs(Accordion,{title:`What causes the error image is required (shell_api_error)?`,id:`what-causes-the-error-image-is-required-shell-api-error`,children:[_jsxs(_components.p,{children:[`The request reached the `,_jsx(_components.code,{children:`/v1/images/edits`}),` endpoint (Option B), but the gateway couldn’t find an image in the request body. Common causes:`]}),_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`The multipart form has no `,_jsx(_components.code,{children:`image`}),` file field, or the field name is wrong (e.g. `,_jsx(_components.code,{children:`image[]`}),`, `,_jsx(_components.code,{children:`file`}),`)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`Content-Type: multipart/form-data`}),` was set manually without a boundary (don’t set this header yourself when using an SDK / fetch / curl)`]}),`\n`,_jsxs(_components.li,{children:[`The client’s image conversion failed but the request was sent anyway (check that the `,_jsx(_components.code,{children:`image`}),` field actually contains more than 0 bytes)`]}),`\n`,_jsxs(_components.li,{children:[`You meant to send an image via JSON but hit `,_jsx(_components.code,{children:`/edits`}),` — JSON + `,_jsx(_components.code,{children:`input_image`}),` goes to `,_jsx(_components.code,{children:`/v1/images/generations`}),` (Option A)`]}),`\n`]})]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Image Editing API Reference","description":"FLUX image editing API reference and live debugger — upload up to 8 reference images + instructions for single-image edits, multi-reference fusion. Works for FLUX.2 and FLUX.1 Kontext.","openapi":"api-reference/flux-edit-openapi-en.yaml POST /v1/images/generations","icon":"image","href":"/en/api-capabilities/flux/image-edit"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Code Examples","slug":"code-examples","depth":2,"children":[{"title":"cURL (two-image fusion · URL)","slug":"curl-two-image-fusion-·-url","depth":3,"children":[]},{"title":"cURL (three-image fusion · URL)","slug":"curl-three-image-fusion-·-url","depth":3,"children":[]},{"title":"cURL (single-image edit · Kontext)","slug":"curl-single-image-edit-·-kontext","depth":3,"children":[]},{"title":"cURL (local file · base64 data URL)","slug":"curl-local-file-·-base64-data-url","depth":3,"children":[]},{"title":"Python (requests · two-image fusion)","slug":"python-requests-·-two-image-fusion","depth":3,"children":[]},{"title":"Python (requests · local file as base64)","slug":"python-requests-·-local-file-as-base64","depth":3,"children":[]},{"title":"Python (OpenAI SDK · pass input_image via extra_body)","slug":"python-openai-sdk-·-pass-input_image-via-extra_body","depth":3,"children":[]},{"title":"Node.js (fetch · multi-reference fusion)","slug":"node-js-fetch-·-multi-reference-fusion","depth":3,"children":[]}]},{"title":"Option B: OpenAI-Compatible Edit Endpoint (multipart)","slug":"option-b-openai-compatible-edit-endpoint-multipart","depth":2,"children":[{"title":"Request Parameters (form fields)","slug":"request-parameters-form-fields","depth":3,"children":[]},{"title":"cURL Example","slug":"curl-example","depth":3,"children":[]},{"title":"Python (OpenAI SDK) Example","slug":"python-openai-sdk-example","depth":3,"children":[]},{"title":"Node.js (fetch + FormData) Example","slug":"node-js-fetch-+-formdata-example","depth":3,"children":[]},{"title":"Which Option Should I Use?","slug":"which-option-should-i-use","depth":3,"children":[]}]},{"title":"Parameter Reference","slug":"parameter-reference","depth":2,"children":[]},{"title":"Multi-Reference Strategies","slug":"multi-reference-strategies","depth":2,"children":[]},{"title":"Response Format","slug":"response-format","depth":2,"children":[]},{"title":"FAQ","slug":"faq","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"editFluxImage","summary":"Edit or fuse one or more reference images by instruction","description":"FLUX image editing API reference and live debugger — upload up to 8 reference images + instructions for single-image edits, multi-reference fusion. Works for FLUX.2 and FLUX.1 Kontext.","tags":["Image Editing"],"security":["9290bf9e-f5f9-4396-a6c2-ce554b06de81"],"requestBody":"004dcc37-1fda-4372-9a85-f46d5e35b70d","responses":{"200":"b86bcf43-cabb-4031-8fea-e2f1e1c21a62","400":"7ca755fd-cf77-4a2a-a40e-1fe904034da8","401":"c6f4f0b3-06b3-4ec3-902b-d5e183eda49f","403":"c2479539-26c3-44d6-b84e-063a36339266","413":"32226438-964d-4fe3-9e1a-2f68ec4175e4","429":"b1b10669-b1ca-4ddd-9736-bde654909219","500":"3597f49f-d94c-445e-9d6d-4fa8f320abf2"},"method":"post","type":"path","servers":["407b7123-c78c-44e6-b016-9bf71efd8e7a"],"path":"/v1/images/generations","baseUrlOptions":["https://api.apiyi.com"],"title":"Edit or fuse one or more reference images by instruction","codeSamples":[],"requiredOnlyExamples":true,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","prompt","input_image"],"properties":{"model":{"type":"string","description":"FLUX model ID. For multi-reference fusion prefer flux-2-pro / flux-2-max; for single-image edits also flux-kontext-max / flux-kontext-pro.","enum":["flux-2-pro","flux-2-max","flux-2-flex","flux-2-klein-9b","flux-2-klein-4b","flux-kontext-max","flux-kontext-pro"],"default":"flux-2-pro","isRequired":true,"uniqueKey":"model","typeLabel":"enum\u003cstring>"},"prompt":{"type":"string","description":"Edit / fusion instruction. In multi-reference scenarios, refer to images by index: 'image 1' / 'image 2' / 'image 3' map to input_image / input_image_2 / input_image_3.","example":"Naturally blend these two images","isRequired":true,"uniqueKey":"prompt","typeLabel":"string"},"input_image":{"type":"string","description":"Public URL for reference image 1 (required). **Use plain URLs in the Playground**; for local code you can also pass a `data:image/png;base64,xxx` data URL.","example":"https://static.apiyi.com/apiyi-logo.png","isRequired":true,"uniqueKey":"input_image","typeLabel":"string"},"input_image_2":{"type":"string","description":"Public URL for reference image 2 (optional)","uniqueKey":"input_image_2","typeLabel":"string"},"input_image_3":{"type":"string","description":"Public URL for reference image 3 (optional)","uniqueKey":"input_image_3","typeLabel":"string"},"input_image_4":{"type":"string","description":"Public URL for reference image 4 (optional)","uniqueKey":"input_image_4","typeLabel":"string"},"input_image_5":{"type":"string","description":"Public URL for reference image 5 (optional)","uniqueKey":"input_image_5","typeLabel":"string"},"input_image_6":{"type":"string","description":"Public URL for reference image 6 (optional)","uniqueKey":"input_image_6","typeLabel":"string"},"input_image_7":{"type":"string","description":"Public URL for reference image 7 (optional)","uniqueKey":"input_image_7","typeLabel":"string"},"input_image_8":{"type":"string","description":"Public URL for reference image 8 (optional, only FLUX.2 [pro/max/flex] supports up to 8)","uniqueKey":"input_image_8","typeLabel":"string"},"aspect_ratio":{"type":"string","description":"Aspect ratio, e.g. 1:1 / 16:9 / 9:16 / 4:3 / 3:4. Defaults to first input image.","uniqueKey":"aspect_ratio","typeLabel":"string"},"seed":{"type":"integer","description":"Fix for reproducibility.","uniqueKey":"seed","typeLabel":"integer"},"safety_tolerance":{"type":"integer","description":"Moderation level. 0 = strictest, 6 = most permissive. Default 2.","minimum":0,"maximum":6,"uniqueKey":"safety_tolerance","typeLabel":"integer"},"output_format":{"type":"string","description":"Output format. Default jpeg.","enum":["jpeg","png"],"uniqueKey":"output_format","typeLabel":"enum\u003cstring>"},"prompt_upsampling":{"type":"boolean","description":"Auto-upsample the prompt. Default false.","uniqueKey":"prompt_upsampling","typeLabel":"boolean"},"steps":{"type":"integer","description":"**Only flux-2-flex**. Inference steps. Default 50.","minimum":1,"maximum":50,"uniqueKey":"steps","typeLabel":"integer"},"guidance":{"type":"number","description":"**Only flux-2-flex**. Guidance scale. Default 4.5.","minimum":1.5,"maximum":10,"uniqueKey":"guidance","typeLabel":"number"}},"uniqueKey":"","typeLabel":"object"},"example":{"model":"flux-2-pro","prompt":"Naturally blend these two images","input_image":"https://static.apiyi.com/apiyi-logo.png","input_image_2":"https://images.unsplash.com/photo-1762138012600-2ab523f8b35a","seed":42,"output_format":"jpeg"},"examples":{"Example":{"title":"Example","value":{"model":"flux-2-pro","prompt":"Naturally blend these two images","input_image":"https://static.apiyi.com/apiyi-logo.png","input_image_2":"https://images.unsplash.com/photo-1762138012600-2ab523f8b35a","seed":42,"output_format":"jpeg"}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"b86bcf43-cabb-4031-8fea-e2f1e1c21a62":{"description":"Image generated","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"integer","example":1776832476,"uniqueKey":"created","typeLabel":"integer"},"data":{"type":"array","description":"Result array (single image per call)","items":{"type":"object","properties":{"url":{"type":"string","description":"**Signed URL, valid for 10 minutes**. Hosted on delivery-eu.bfl.ai / delivery-us.bfl.ai with CORS disabled.","example":"https://delivery-eu.bfl.ai/results/xxx/sample.jpeg?signature=...","uniqueKey":"data.items.[INDEX].url","typeLabel":"string"}},"uniqueKey":"data.items.[INDEX]","typeLabel":"object"},"uniqueKey":"data","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"created":1776832476,"data":[{"url":"https://delivery-eu.bfl.ai/results/xxx/sample.jpeg?signature=..."}]}}},"exampleType":"generated"}},"exampleType":"generated"},"7ca755fd-cf77-4a2a-a40e-1fe904034da8":{"description":"Invalid params (missing input_image, dimensions not multiple of 16, exceeds 4MP, etc.)","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"c6f4f0b3-06b3-4ec3-902b-d5e183eda49f":{"description":"Unauthorized — invalid API Key","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"c2479539-26c3-44d6-b84e-063a36339266":{"description":"Moderation block","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"32226438-964d-4fe3-9e1a-2f68ec4175e4":{"description":"Uploaded image too large","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"b1b10669-b1ca-4ddd-9736-bde654909219":{"description":"Rate limited or out of credits","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"3597f49f-d94c-445e-9d6d-4fa8f320abf2":{"description":"Internal server error","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}}},"security":{"9290bf9e-f5f9-4396-a6c2-ce554b06de81":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API Key from the APIYI Console","scopes":[]}}},"servers":{"407b7123-c78c-44e6-b016-9bf71efd8e7a":{"url":"https://api.apiyi.com","description":"Primary endpoint"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"API Key from the APIYI Console","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"API Key from the APIYI Console","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"api-reference/flux-edit-openapi-en.yaml"},"subdomain":"apiyillc","siteName":"API易文档中心","title":"Image Editing API Reference - API易文档中心","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"zh":{"href":"/api-capabilities/flux/image-edit","matchLevel":1},"en":{"href":"/en/api-capabilities/flux/image-edit","matchLevel":0},"zh-Hant":{"href":"/zh-Hant/api-capabilities/flux/image-edit","matchLevel":1},"ja":{"href":"/ja/api-capabilities/flux/image-edit","matchLevel":1},"ko":{"href":"/ko/api-capabilities/flux/image-edit","matchLevel":1},"ru":{"href":"/ru/api-capabilities/flux/image-edit","matchLevel":1}}},"lastModified":"2026-07-04T15:41:29.712Z","originalFileLocation":"en/api-capabilities/flux/image-edit.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"FLUX image editing API reference and live debugger — upload up to 8 reference images + instructions for single-image edits, multi-reference fusion. Works for FLUX.2 and FLUX.1 Kontext.\">\u003cmeta data-mint-head name=\"application-name\" content=\"API易文档中心\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/apiyillc/sQlsuRwD6o27XLvg/_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/apiyillc/sQlsuRwD6o27XLvg/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/apiyillc/sQlsuRwD6o27XLvg/_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/apiyillc/sQlsuRwD6o27XLvg/_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/apiyillc/sQlsuRwD6o27XLvg/_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/apiyillc/sQlsuRwD6o27XLvg/_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/apiyillc/sQlsuRwD6o27XLvg/_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/apiyillc/sQlsuRwD6o27XLvg/_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/apiyillc/sQlsuRwD6o27XLvg/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Image Editing API Reference - API易文档中心\">\u003cmeta data-mint-head property=\"og:description\" content=\"FLUX image editing API reference and live debugger — upload up to 8 reference images + instructions for single-image edits, multi-reference fusion. Works for FLUX.2 and FLUX.1 Kontext.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"API易文档中心\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.apiyi.com/en/api-capabilities/flux/image-edit\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://apiyillc.mintlify.app/_mintlify/api/og/v2?division=FLUX+Image+Generation+%26+Editing\u0026amp;title=Image+Editing+API+Reference\u0026amp;description=FLUX+image+editing+API+reference+and+live+debugger+%E2%80%94+upload+up+to+8+reference+images+%2B+instructions+for+single-image+edits%2C+multi-reference+fusion.+Works+for+FL\u0026amp;theme=421dcf1ed22dd4b5d53fa3cb\u0026amp;signature=e8f0497cec85676515468a6faa4fb32b5440288139d4493c594e9bf26330bad4\">\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=\"Image Editing API Reference - API易文档中心\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"FLUX image editing API reference and live debugger — upload up to 8 reference images + instructions for single-image edits, multi-reference fusion. Works for FLUX.2 and FLUX.1 Kontext.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://apiyillc.mintlify.app/_mintlify/api/og/v2?division=FLUX+Image+Generation+%26+Editing\u0026amp;title=Image+Editing+API+Reference\u0026amp;description=FLUX+image+editing+API+reference+and+live+debugger+%E2%80%94+upload+up+to+8+reference+images+%2B+instructions+for+single-image+edits%2C+multi-reference+fusion.+Works+for+FL\u0026amp;theme=421dcf1ed22dd4b5d53fa3cb\u0026amp;signature=e8f0497cec85676515468a6faa4fb32b5440288139d4493c594e9bf26330bad4\">\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/apiyillc/sQlsuRwD6o27XLvg/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"API易文档中心\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2563eb\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.apiyi.com/en/api-capabilities/flux/image-edit\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/en/api-capabilities/flux/image-edit.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.apiyi.com/en/api-capabilities/flux/image-edit\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh\" href=\"https://docs.apiyi.com/api-capabilities/flux/image-edit\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-Hant\" href=\"https://docs.apiyi.com/zh-Hant/api-capabilities/flux/image-edit\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ja\" href=\"https://docs.apiyi.com/ja/api-capabilities/flux/image-edit\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ko\" href=\"https://docs.apiyi.com/ko/api-capabilities/flux/image-edit\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ru\" href=\"https://docs.apiyi.com/ru/api-capabilities/flux/image-edit\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.apiyi.com/api-capabilities/flux/image-edit\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.apiyi.com/#organization\",\"name\":\"API易文档中心\",\"url\":\"https://docs.apiyi.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/apiyillc/LjCT1O0GrSur6F2v/logo/light.svg?fit=max\u0026auto=format\u0026n=LjCT1O0GrSur6F2v\u0026q=85\u0026s=4119ef17a74cc54be127f34578d8b5fa\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.apiyi.com#website\",\"name\":\"API易文档中心\",\"url\":\"https://docs.apiyi.com\",\"publisher\":{\"@id\":\"https://docs.apiyi.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.apiyi.com/en/api-capabilities/flux/image-edit#webpage\",\"url\":\"https://docs.apiyi.com/en/api-capabilities/flux/image-edit\",\"name\":\"Image Editing API Reference\",\"description\":\"FLUX image editing API reference and live debugger — upload up to 8 reference images + instructions for single-image edits, multi-reference fusion. Works for FLUX.2 and FLUX.1 Kontext.\",\"dateModified\":\"2026-07-04T15:41:29.712Z\",\"isPartOf\":{\"@id\":\"https://docs.apiyi.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.apiyi.com/en/api-capabilities/flux/image-edit#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.apiyi.com/en/api-capabilities/flux/image-edit#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Image API (Official)\",\"item\":\"https://docs.apiyi.com/en/api-capabilities/image-api-best-practices\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FLUX Image Generation \u0026 Editing\",\"item\":\"https://docs.apiyi.com/en/api-capabilities/flux/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Image Editing API Reference\",\"item\":\"https://docs.apiyi.com/en/api-capabilities/flux/image-edit\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.apiyi.com/en/api-capabilities/flux/image-edit#apireference\",\"headline\":\"Image Editing API Reference\",\"name\":\"Image Editing API Reference\",\"description\":\"FLUX image editing API reference and live debugger — upload up to 8 reference images + instructions for single-image edits, multi-reference fusion. Works for FLUX.2 and FLUX.1 Kontext.\",\"url\":\"https://docs.apiyi.com/en/api-capabilities/flux/image-edit\",\"mainEntityOfPage\":{\"@id\":\"https://docs.apiyi.com/en/api-capabilities/flux/image-edit#webpage\"},\"dateModified\":\"2026-07-04T15:41:29.712Z\",\"publisher\":{\"@id\":\"https://docs.apiyi.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.apiyi.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"API易文档中心\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"API易文档中心","nav":{"global":{"anchors":[]},"languages":[{"language":"zh","pages":[{"title":"zh","href":"/api-capabilities/flux/image-edit"}]},{"language":"en","navbar":{"links":[{"href":"https://api.apiyi.com","label":"Home"},{"href":"https://imagen.apiyi.com","label":"AI Image"},{"href":"https://icover.ai","label":"AI Video"}],"primary":{"type":"button","label":"Console","href":"https://api.apiyi.com/account/profile"}},"tabs":[{"tab":"Home","icon":"house","groups":[{"group":"Basics","pages":[{"title":"APIYI - AI Model API Hub","sidebarTitle":"Introduction","icon":"house","href":"/en"},{"title":"Quick Start","icon":"rocket","href":"/en/getting-started"},{"title":"AI Developer Kit","sidebarTitle":"AI Developer Kit","icon":"bot","href":"/en/developer-kit"},{"group":"API Manual","icon":"book","pages":[{"title":"API Manual","sidebarTitle":"Manual Overview","icon":"book","href":"/en/api-manual"},{"title":"Capturing API Error Details","sidebarTitle":"Error Capture","icon":"clipboard-list","href":"/en/api-manual/error-reporting"}]},{"title":"Pricing","icon":"badge-dollar-sign","href":"/en/pricing"}]},{"group":"Basic API","icon":"box","pages":[{"title":"Popular Models","icon":"database","href":"/en/api-capabilities/model-info"},{"title":"Image \u0026 Video Generation Models","icon":"palette","href":"/en/api-capabilities/image-video-models"},{"group":"OpenAI API Calls","icon":"sparkles","pages":[{"title":"OpenAI Responses API Native Guide","sidebarTitle":"Native Calls","icon":"zap","href":"/en/api-capabilities/openai/native"},{"title":"OpenAI Chat Completions Compatible Mode","sidebarTitle":"Compatible Mode","icon":"plug","href":"/en/api-capabilities/openai/compatible"},{"title":"Choosing an Endpoint: Migrating GPT-5.4+ to Responses","sidebarTitle":"Endpoint \u0026 Migration","icon":"route","href":"/en/api-capabilities/openai/responses-migration"},{"title":"OpenAI Compatible Mode: Handling Responses","sidebarTitle":"Handling Responses","icon":"braces","href":"/en/api-capabilities/openai/response-handling"},{"title":"OpenAI Compatible Mode: Reasoning Model Output","sidebarTitle":"Reasoning Model Output","icon":"brain","href":"/en/api-capabilities/openai/reasoning-models"},{"title":"OpenAI Prompt Caching Billing Guide","sidebarTitle":"Cache Billing","icon":"database","href":"/en/api-capabilities/openai/prompt-caching"},{"title":"OpenAI Function Calling Guide","sidebarTitle":"Function Calling","icon":"wrench","href":"/en/api-capabilities/openai/function-calling"},{"title":"OpenAI API Web Search Guide","sidebarTitle":"Web Search","icon":"globe","href":"/en/api-capabilities/openai/web-search"},{"group":"OpenAI FAQ","icon":"circle-question-mark","pages":[{"title":"Does APIYI Support OpenAI Fast / Ultrafast Mode?","icon":"gauge","href":"/en/faq/openai-service-tier-fast-mode"},{"title":"How Do Streaming and Non-Streaming Requests Differ When Content Is Filtered?","sidebarTitle":"Streaming \u0026 Content Filtering","icon":"shield-half","href":"/en/faq/streaming-content-filter"},{"title":"What Does an OpenAI Model Refusal Look Like?","icon":"message-square-x","href":"/en/faq/openai-content-safety-refusal"}]}]},{"group":"Claude Official","icon":"sparkles","pages":[{"title":"Claude API Calling Basics","sidebarTitle":"Claude API Basics","icon":"sparkles","href":"/en/api-capabilities/claude"},{"title":"Claude Native Format: Streaming \u0026 Non-Streaming Responses","sidebarTitle":"Streaming \u0026 Responses","icon":"braces","href":"/en/api-capabilities/claude-response-handling"},{"title":"Claude Prompt Caching Guide","sidebarTitle":"Prompt Caching","icon":"database","href":"/en/api-capabilities/claude-prompt-caching"},{"title":"Claude Effort \u0026 Thinking Guide","sidebarTitle":"Effort \u0026 Thinking","icon":"gauge","href":"/en/api-capabilities/claude-effort-thinking"},{"title":"Claude API Web Search Guide","sidebarTitle":"Claude Web Search","icon":"globe","href":"/en/api-capabilities/claude-web-search"},{"group":"Claude FAQ","icon":"circle-question-mark","pages":[{"title":"How Do I Fix Claude's Invalid Thinking Signature Error?","icon":"file-signature","href":"/en/faq/claude-thinking-signature-invalid"},{"title":"Why Does a Claude Refusal Return Empty Content?","icon":"message-square-x","href":"/en/faq/claude-content-safety-refusal"}]}]},{"group":"Gemini Native Calls","icon":"sparkles","pages":[{"title":"Gemini Native Format Guide","sidebarTitle":"Native Calls","icon":"zap","href":"/en/api-capabilities/gemini/native"},{"title":"Interactions API vs generateContent","sidebarTitle":"Interactions API Compared","icon":"git-compare","href":"/en/api-capabilities/gemini/interactions-api"},{"title":"Gemini Native Format: Streaming \u0026 Non-Streaming Responses","sidebarTitle":"Streaming \u0026 Responses","icon":"braces","href":"/en/api-capabilities/gemini/response-handling"},{"title":"Gemini Multimodal Input \u0026 Code Execution","sidebarTitle":"Multimodal \u0026 Code Exec","icon":"images","href":"/en/api-capabilities/gemini/multimodal"},{"title":"Gemini Implicit Caching Billing Guide","sidebarTitle":"Cache Billing","icon":"database","href":"/en/api-capabilities/gemini/prompt-caching"},{"title":"Gemini Function Calling Guide","sidebarTitle":"Function Calling","icon":"wrench","href":"/en/api-capabilities/gemini/function-calling"},{"title":"Gemini API Web Search Guide","sidebarTitle":"Web Search","icon":"globe","href":"/en/api-capabilities/gemini/web-search"}]},{"group":"Grok API Calls","icon":"sparkles","pages":[{"title":"Grok Model Series Guide","sidebarTitle":"Grok Overview","icon":"rocket","href":"/en/api-capabilities/grok/overview"},{"title":"Grok Chat \u0026 Reasoning Guide","sidebarTitle":"Chat \u0026 Reasoning","icon":"message-square","href":"/en/api-capabilities/grok/chat"},{"title":"Grok Web Search \u0026 X Search Guide","sidebarTitle":"Web \u0026 X Search","icon":"globe","href":"/en/api-capabilities/grok/web-search"},{"title":"Grok Code Execution \u0026 Remote MCP Guide","sidebarTitle":"Code Execution \u0026 MCP","icon":"terminal","href":"/en/api-capabilities/grok/code-execution-mcp"},{"title":"Grok Multi-Agent Model Guide","sidebarTitle":"Multi-Agent Model","icon":"users","href":"/en/api-capabilities/grok/multi-agent"},{"title":"Grok Prompt Caching Billing Guide","sidebarTitle":"Cache Billing","icon":"database","href":"/en/api-capabilities/grok/prompt-caching"}]},{"group":"Text API Best Practices","icon":"book-check","pages":[{"title":"Long-form Output Practices","sidebarTitle":"Long-form Output","icon":"book-check","href":"/en/api-capabilities/long-form-output-practices"},{"title":"Multi-Turn Conversation Guide","sidebarTitle":"Multi-Turn Conversation","icon":"messages-square","href":"/en/api-capabilities/multi-turn-conversation"}]},{"title":"Balance Query API","icon":"wallet","href":"/en/api-capabilities/balance-query"},{"title":"Log Query API","icon":"file-text","href":"/en/api-capabilities/log-query"},{"title":"Token Management API","icon":"key","href":"/en/api-capabilities/token-management"},{"title":"Deprecated Models","icon":"triangle-alert","href":"/en/api-capabilities/deprecated-models"}]},{"group":"Image API (Official)","icon":"image","pages":[{"group":"Image API Essentials","icon":"book-check","pages":[{"title":"Image API Essentials \u0026 Best Practices","sidebarTitle":"Must-Read \u0026 Best Practices","icon":"book-check","href":"/en/api-capabilities/image-api-best-practices"},{"title":"Troubleshooting Image API Connection Drops","sidebarTitle":"Connection Drops","icon":"unplug","href":"/en/api-capabilities/image-connection-drops"},{"title":"Image Requests That Hang After the Data Has Arrived","sidebarTitle":"Requests Hanging at the End","icon":"hourglass","href":"/en/api-capabilities/image-tail-stall"},{"title":"Image Compression \u0026 Output Resolution","sidebarTitle":"Compression \u0026 Resolution","icon":"scaling","href":"/en/api-capabilities/image-compression-resolution"},{"title":"How to Get Satisfying Images","sidebarTitle":"Getting Satisfying Images","icon":"target","href":"/en/api-capabilities/image-generation-success-tips"},{"title":"Troubleshooting Safety Rejections: Find the Trigger Word by Ablation","sidebarTitle":"Safety Rejections","icon":"shield-alert","href":"/en/api-capabilities/image-safety-troubleshooting"},{"title":"Long Prompts and Two-Stage Generation: Where the 32K Limit Comes From","sidebarTitle":"Long Prompts","icon":"text-quote","href":"/en/api-capabilities/image-long-prompt"},{"title":"Advanced Image Generation: Workflow and Realism","sidebarTitle":"Advanced Workflow","icon":"workflow","href":"/en/api-capabilities/image-advanced-workflow"},{"title":"Image Prompt Doctor Skill","sidebarTitle":"Prompt Doctor Skill","icon":"stethoscope","href":"/en/api-capabilities/image-prompt-doctor"},{"group":"Image FAQ","icon":"circle-question-mark","pages":[{"title":"Image Request Hangs With No Result, but the Log Shows a Write Failure?","icon":"hourglass","href":"/en/faq/image-direct-large-response-stall"},{"title":"Image Calls Drop After About 90 Seconds Behind a Proxy?","icon":"unplug","href":"/en/faq/proxy-idle-timeout-disconnect"},{"title":"Why Does the Generated Image Differ Greatly from the Reference?","icon":"image","href":"/en/faq/image-result-differs-from-reference"},{"title":"How to fix the image content does not match MIME type error?","icon":"image","href":"/en/faq/image-mime-type-mismatch-with-query"},{"title":"Is There an Async Image API? Can I Query Results by Task ID?","icon":"image","href":"/en/faq/image-async-api"}]}]},{"group":"GPT-Image-2.5 / 2 Image Gen","icon":"sparkles","pages":[{"title":"GPT-Image-2.5 / 2 Image Generation/Edit","sidebarTitle":"GPT-Image-2.5 / 2 Overview","icon":"sparkles","href":"/en/api-capabilities/gpt-image-2/overview"},{"title":"Text-to-Image API Reference","openapi":"api-reference/gpt-image-2-generate-openapi-en.yaml POST /v1/images/generations","icon":"wand-sparkles","href":"/en/api-capabilities/gpt-image-2/text-to-image"},{"title":"Image Edit API Reference","openapi":"api-reference/gpt-image-2-edit-openapi-en.yaml POST /v1/images/edits","icon":"image","href":"/en/api-capabilities/gpt-image-2/image-edit"},{"title":"GPT-Image-2.5 / 2 Series Agent Skill","icon":"blocks","href":"/en/api-capabilities/gpt-image-2/skills"},{"title":"Mask Inpainting Guide","sidebarTitle":"Mask Inpainting","icon":"brush","href":"/en/api-capabilities/gpt-image-2/mask-editing"},{"title":"GPT-Image Legacy Versions","sidebarTitle":"GPT-Image Legacy","icon":"rotate-ccw-clock","href":"/en/api-capabilities/gpt-image-2/historical-versions"},{"group":"GPT-Image FAQ","icon":"circle-question-mark","pages":[{"title":"How do I generate images with a transparent background (PNG cutouts)?","icon":"layers","href":"/en/faq/image-transparent-background"},{"title":"Why Are GPT Image Output Tokens So High?","icon":"calculator","href":"/en/faq/gpt-image-output-token-calculation"},{"title":"Codex Integration for GPT-Image Fails with Incorrect API Key","sidebarTitle":"Image Key Rejected by OpenAI","icon":"key-round","href":"/en/faq/gpt-image-incorrect-api-key-openai"}]}]},{"title":"GPT-image-2.5 / 2 Official vs Reverse","sidebarTitle":"GPT-image-2.5 / 2 Official vs Reverse","icon":"scale","href":"/en/api-capabilities/gpt-image-2/vs-gpt-image-2-all"},{"group":"GPT-Image-2.5-All Image Gen","icon":"sparkles","pages":[{"title":"GPT-Image-2.5-All Image Gen/Editing","sidebarTitle":"GPT-Image-2.5-All Overview","icon":"sparkles","href":"/en/api-capabilities/gpt-image-2-all/overview"},{"title":"Text-to-Image API Reference","openapi":"api-reference/gpt-image-2-all-generate-openapi-en.yaml POST /v1/images/generations","icon":"wand-sparkles","href":"/en/api-capabilities/gpt-image-2-all/text-to-image"},{"title":"Image Editing API Reference","openapi":"api-reference/gpt-image-2-all-edit-openapi-en.yaml POST /v1/images/edits","icon":"image","href":"/en/api-capabilities/gpt-image-2-all/image-edit"},{"title":"GPT-Image-2.5-All Agent Skill","icon":"blocks","href":"/en/api-capabilities/gpt-image-2-all/skills"}]},{"group":"GPT-Image-2.5-VIP Image Gen","icon":"expand","pages":[{"title":"GPT-Image-2.5-VIP Image Gen/Editing","sidebarTitle":"GPT-Image-2.5-VIP Overview","icon":"expand","href":"/en/api-capabilities/gpt-image-2-vip/overview"},{"title":"Text-to-Image API Reference","openapi":"api-reference/gpt-image-2-vip-generate-openapi-en.yaml POST /v1/images/generations","icon":"wand-sparkles","href":"/en/api-capabilities/gpt-image-2-vip/text-to-image"},{"title":"Image Editing API Reference","openapi":"api-reference/gpt-image-2-vip-edit-openapi-en.yaml POST /v1/images/edits","icon":"image","href":"/en/api-capabilities/gpt-image-2-vip/image-edit"},{"title":"GPT-Image-2.5-VIP Agent Skill","icon":"blocks","href":"/en/api-capabilities/gpt-image-2-vip/skills"}]},{"title":"Nano Banana Series Pricing","icon":"tag","href":"/en/api-capabilities/nano-banana-pricing"},{"group":"NanoBanana Best Practices","icon":"lightbulb","pages":[{"title":"Nano Banana Series Developer Guide","icon":"compass","href":"/en/api-capabilities/nano-banana-dev-guide"},{"title":"Usage Fields \u0026 Output Explained","sidebarTitle":"Usage Fields \u0026 Output Explained","icon":"receipt-text","href":"/en/api-capabilities/nano-banana-usage-metadata"},{"title":"Gemini Image Generation API Error Handling Guide","icon":"triangle-alert","href":"/en/api-capabilities/gemini-image-error-handling"},{"title":"Multi-Image Fusion Testing Guide","sidebarTitle":"Multi-Image Fusion Testing","icon":"layers","href":"/en/api-capabilities/multi-image-fusion-testing"},{"title":"Nano Banana Pro Failed-Generation Credit Reimbursement Plan","icon":"shield-check","href":"/en/api-capabilities/nano-banana-pro-guarantee"},{"title":"Nano Banana OSS Group","icon":"link","href":"/en/api-capabilities/nano-banana-oss-group"},{"group":"NB FAQ","icon":"circle-question-mark","pages":[{"title":"Image Edit Returns Unable to Process Input Image?","icon":"image-off","href":"/en/faq/gemini-empty-inlinedata"},{"title":"Why Does Gemini Image Return IMAGE_OTHER?","sidebarTitle":"IMAGE_OTHER","icon":"image-minus","href":"/en/faq/gemini-image-other"},{"title":"Why Does Gemini Image Return blockReason: OTHER?","sidebarTitle":"blockReason: OTHER","icon":"shield-alert","href":"/en/faq/gemini-image-input-blocked"},{"title":"Common Reasons for Nano Banana Image Generation Failures","icon":"image-off","href":"/en/faq/nano-banana-image-failure"},{"title":"Why Does the Gemini Image API Return NO_IMAGE?","icon":"image-off","href":"/en/faq/gemini-no-image"},{"title":"Why does my image turn reddish after editing with banana pro?","icon":"image","href":"/en/faq/banana-pro-edit-red-cast"},{"title":"How to fix distorted prints when changing outfits with Nano Banana Pro?","icon":"shirt","href":"/en/faq/nano-banana-pro-print-distortion"},{"title":"Why Does a White-Background Image Show Black Spots, Dirty Patches, or Blurry Color Blocks?","icon":"triangle-alert","href":"/en/faq/white-background-image-artifacts"}]}]},{"group":"Nano Banana 2.1 Image Gen","icon":"banana","pages":[{"title":"Nano Banana 2.1 Image Gen/Editing","icon":"banana","href":"/en/api-capabilities/gemini-nano-banana-2.1/overview"},{"title":"Text-to-Image API Reference","openapi":"api-reference/gemini-nano-banana-2.1-generate-openapi-en.yaml POST /v1beta/models/gemini-nano-banana-2.1:generateContent","icon":"wand-sparkles","href":"/en/api-capabilities/gemini-nano-banana-2.1/text-to-image"},{"title":"Image Editing API Reference","openapi":"api-reference/gemini-nano-banana-2.1-edit-openapi-en.yaml POST /v1beta/models/gemini-nano-banana-2.1:generateContent","icon":"image","href":"/en/api-capabilities/gemini-nano-banana-2.1/image-edit"},{"title":"Nano Banana 2.1 Agent Skill","icon":"blocks","href":"/en/api-capabilities/gemini-nano-banana-2.1/skills"}]},{"group":"Nano Banana Pro Image Gen","icon":"banana","pages":[{"title":"Nano Banana Pro Image Generation","icon":"banana","href":"/en/api-capabilities/nano-banana-image/overview"},{"title":"Text-to-Image API Reference","openapi":"api-reference/nano-banana-pro-generate-openapi-en.yaml POST /v1beta/models/gemini-3-pro-image:generateContent","icon":"wand-sparkles","href":"/en/api-capabilities/nano-banana-image/text-to-image"},{"title":"Image Editing API Reference","openapi":"api-reference/nano-banana-pro-edit-openapi-en.yaml POST /v1beta/models/gemini-3-pro-image:generateContent","icon":"image","href":"/en/api-capabilities/nano-banana-image/image-edit"},{"title":"Nano Banana Pro Agent Skill","icon":"blocks","href":"/en/api-capabilities/nano-banana-image/skills"}]},{"group":"Nano Banana 2 Image Gen","icon":"banana","pages":[{"title":"Nano Banana 2 Image Gen/Editing","icon":"banana","href":"/en/api-capabilities/nano-banana-2-image/overview"},{"title":"Text-to-Image API Reference","openapi":"api-reference/nano-banana-2-generate-openapi-en.yaml POST /v1beta/models/gemini-3.1-flash-image:generateContent","icon":"wand-sparkles","href":"/en/api-capabilities/nano-banana-2-image/text-to-image"},{"title":"Image Editing API Reference","openapi":"api-reference/nano-banana-2-edit-openapi-en.yaml POST /v1beta/models/gemini-3.1-flash-image:generateContent","icon":"image","href":"/en/api-capabilities/nano-banana-2-image/image-edit"},{"title":"Nano Banana 2 Agent Skill","icon":"blocks","href":"/en/api-capabilities/nano-banana-2-image/skills"}]},{"group":"Nano Banana Lite Image Gen","icon":"banana","pages":[{"title":"Nano Banana Lite Image Gen/Editing","icon":"banana","href":"/en/api-capabilities/nano-banana-lite-image/overview"},{"title":"Text-to-Image API Reference","openapi":"api-reference/nano-banana-lite-generate-openapi-en.yaml POST /v1beta/models/gemini-3.1-flash-lite-image:generateContent","icon":"wand-sparkles","href":"/en/api-capabilities/nano-banana-lite-image/text-to-image"},{"title":"Image Editing API Reference","openapi":"api-reference/nano-banana-lite-edit-openapi-en.yaml POST /v1beta/models/gemini-3.1-flash-lite-image:generateContent","icon":"image","href":"/en/api-capabilities/nano-banana-lite-image/image-edit"},{"title":"Nano Banana Lite Agent Skill","icon":"blocks","href":"/en/api-capabilities/nano-banana-lite-image/skills"}]},{"group":"FLUX Image Generation \u0026 Editing","icon":"sparkles","pages":[{"title":"FLUX Image Generation \u0026 Editing","sidebarTitle":"FLUX Overview","icon":"sparkles","href":"/en/api-capabilities/flux/overview"},{"title":"Text-to-Image API Reference","description":"FLUX text-to-image API reference and live debugger — full FLUX.2 [klein/pro/max/flex] family via OpenAI-compatible drop-in, 4MP output and exact hex color control","openapi":"api-reference/flux-generate-openapi-en.yaml POST /v1/images/generations","icon":"wand-sparkles","href":"/en/api-capabilities/flux/text-to-image"},{"title":"Image Editing API Reference","openapi":"api-reference/flux-edit-openapi-en.yaml POST /v1/images/generations","icon":"image","href":"/en/api-capabilities/flux/image-edit"},{"title":"FLUX Historical Versions","sidebarTitle":"Historical Versions","description":"FLUX.1 [pro] / [pro] 1.1 / [pro] 1.1 Ultra / [dev] specs, pricing, and migration guidance to FLUX.2","icon":"rotate-ccw-clock","href":"/en/api-capabilities/flux/historical-versions"}]},{"group":"Seedream 5.0 Series","icon":"sparkles","pages":[{"title":"Seedream Image Generation \u0026 Editing","sidebarTitle":"Seedream Overview","icon":"sparkles","href":"/en/api-capabilities/seedream-image/overview"},{"title":"Text-to-Image API Reference","openapi":"api-reference/seedream-image-generate-openapi-en.yaml POST /v1/images/generations","icon":"wand-sparkles","href":"/en/api-capabilities/seedream-image/text-to-image"},{"title":"Image Editing API Reference","openapi":"api-reference/seedream-image-edit-openapi-en.yaml POST /v1/images/generations","icon":"image","href":"/en/api-capabilities/seedream-image/image-edit"},{"title":"Seedream Historical Versions","sidebarTitle":"Historical Versions","icon":"rotate-ccw-clock","href":"/en/api-capabilities/seedream-image/historical-versions"}]},{"group":"Grok Imagine Official Image Gen","icon":"sparkles","pages":[{"title":"Grok Imagine Official Image Generation","sidebarTitle":"Grok Imagine Official Overview","icon":"sparkles","href":"/en/api-capabilities/grok-imagine-image-official/overview"},{"title":"Grok Imagine Official Text-to-Image API Reference","sidebarTitle":"Text-to-Image","openapi":"api-reference/grok-imagine-image-official-generate-openapi-en.yaml POST /v1/images/generations","icon":"wand-sparkles","href":"/en/api-capabilities/grok-imagine-image-official/text-to-image"}]},{"group":"Grok Imagine Reverse Image Gen \u0026 Editing","icon":"sparkles","pages":[{"title":"Grok Imagine Reverse Image Gen \u0026 Editing","sidebarTitle":"Grok Imagine Reverse Overview","icon":"sparkles","href":"/en/api-capabilities/grok-imagine-image/overview"},{"title":"Text-to-Image API Reference","openapi":"api-reference/grok-imagine-image-generate-openapi-en.yaml POST /v1/images/generations","icon":"wand-sparkles","href":"/en/api-capabilities/grok-imagine-image/text-to-image"},{"title":"Image Editing API Reference","openapi":"api-reference/grok-imagine-image-edit-openapi-en.yaml POST /v1/images/edits","icon":"image","href":"/en/api-capabilities/grok-imagine-image/image-edit"}]},{"group":"MAI-Image 2.6 Image Gen \u0026 Editing","icon":"sparkles","pages":[{"title":"MAI-Image 2.6 Image Gen \u0026 Editing","sidebarTitle":"MAI-Image 2.6 Overview","icon":"sparkles","href":"/en/api-capabilities/mai-image/overview"},{"title":"Text-to-Image API Reference","openapi":"api-reference/mai-image-generate-openapi-en.yaml POST /v1/images/generations","icon":"wand-sparkles","href":"/en/api-capabilities/mai-image/text-to-image"},{"title":"Image Editing API Reference","openapi":"api-reference/mai-image-edit-openapi-en.yaml POST /v1/images/edits","icon":"image","href":"/en/api-capabilities/mai-image/image-edit"}]},{"title":"Image API Integration Practice: Build Your Own Async Queue","sidebarTitle":"Self-Hosted Async Queue","icon":"list-checks","href":"/en/api-capabilities/image-async-queue"}]},{"group":"Video API (Official)","icon":"video","pages":[{"group":"Seedance 2.0 / 2.5 (Volcengine)","icon":"film","pages":[{"title":"Seedance 2.0 / 2.5 Video Generation","sidebarTitle":"Seedance 2.0 / 2.5 Overview","icon":"film","href":"/en/api-capabilities/seedance2/overview"},{"title":"Seedance 2.0 / 2.5 Video Generation API Reference","sidebarTitle":"Video Generation","openapi":"api-reference/seedance2-video-openapi-en.yaml POST /seedance/api/v3/contents/generations/tasks","icon":"video","href":"/en/api-capabilities/seedance2/video-generation"},{"title":"Seedance 2.0 Video Agent Skill","icon":"blocks","href":"/en/api-capabilities/seedance2/skills"},{"title":"Seedance 2.0 Asset Library (Character-Consistent Video)","sidebarTitle":"Asset Library","icon":"images","href":"/en/api-capabilities/seedance2/asset-library"},{"title":"Asset-Referenced Video Generation in Code","sidebarTitle":"Asset Reference Guide","icon":"clapperboard","href":"/en/api-capabilities/seedance2/asset-reference"},{"title":"Asset-First: Faster, More Reliable Image and Video Inputs","sidebarTitle":"Asset-First Workflow","icon":"gauge","href":"/en/api-capabilities/seedance2/asset-first-workflow"},{"group":"SD FAQ","icon":"circle-question-mark","pages":[{"title":"Seedance Says First/Last Frame Cannot Be Mixed with Reference Media","sidebarTitle":"First Frame Mixed with Reference","icon":"layers","href":"/en/faq/seedance-first-frame-mixed-with-reference"},{"title":"Seedance Says invalid image format, but the Link Opens in a Browser","sidebarTitle":"Image Link Opens but Fails","icon":"link","href":"/en/faq/seedance-image-url-invalid-format"},{"title":"Seedance 2.5: Reference-to-Video vs. Video Editing","icon":"split","href":"/en/faq/seedance2-reference-vs-edit"},{"title":"Can I Cancel a Seedance Video Task After Submission?","icon":"video","href":"/en/faq/seedance-video-task-cancel"},{"title":"How do I look up a Seedance video's real cost by task_id?","icon":"receipt","href":"/en/faq/seedance-task-cost-lookup"},{"title":"Does Seedance 2.0 auto-upload face references to the asset library? Does it trigger the deepfake filter?","icon":"banana","href":"/en/faq/seedance2-asset-face-reference"},{"title":"Why Does Seedance 2.0 / 2.5 Block Face Assets?","icon":"scan-face","href":"/en/faq/seedance2-face-asset-whitelist"}]}]},{"group":"Wan3.0 Video Generation (Alibaba)","icon":"video","pages":[{"title":"Wan3.0 Video Generation (Alibaba Tongyi Wanxiang)","sidebarTitle":"Overview","icon":"video","href":"/en/api-capabilities/wan3/overview"},{"title":"Wan3.0 Video Generation API Reference","sidebarTitle":"Video Generation","openapi":"api-reference/wan3-video-openapi-en.yaml POST /wan/api/v1/services/aigc/video-generation/video-synthesis","icon":"wand-sparkles","href":"/en/api-capabilities/wan3/video-generation"}]},{"group":"Wan2.7 Video Generation (Alibaba)","icon":"videotape","pages":[{"title":"Wan Video Generation (Alibaba Cloud Tongyi Wanxiang)","sidebarTitle":"Wan Overview","icon":"video","href":"/en/api-capabilities/wan/overview"},{"title":"Wan2.7 Text-to-Video API Reference","sidebarTitle":"Text-to-Video","openapi":"api-reference/wan-text-to-video-openapi-en.yaml POST /wan/api/v1/services/aigc/video-generation/video-synthesis","icon":"wand-sparkles","href":"/en/api-capabilities/wan/text-to-video"},{"title":"Wan2.7 Image-to-Video API Reference","sidebarTitle":"Image-to-Video","openapi":"api-reference/wan-image-to-video-openapi-en.yaml POST /wan/api/v1/services/aigc/video-generation/video-synthesis","icon":"image","href":"/en/api-capabilities/wan/image-to-video"},{"title":"Wan2.7 Reference-to-Video API Reference","sidebarTitle":"Reference-to-Video","openapi":"api-reference/wan-reference-to-video-openapi-en.yaml POST /wan/api/v1/services/aigc/video-generation/video-synthesis","icon":"users","href":"/en/api-capabilities/wan/reference-to-video"},{"title":"Wan2.7 Video Edit API Reference","sidebarTitle":"Video Edit","openapi":"api-reference/wan-video-edit-openapi-en.yaml POST /wan/api/v1/services/aigc/video-generation/video-synthesis","icon":"scissors","href":"/en/api-capabilities/wan/video-edit"},{"title":"Wan2.7 and HappyHorse Video Agent Skill","icon":"blocks","href":"/en/api-capabilities/wan/skills"},{"title":"Wan Historical Versions (Wan2.6)","sidebarTitle":"Historical Versions","icon":"rotate-ccw-clock","href":"/en/api-capabilities/wan/historical-versions"}]},{"group":"HappyHorse Video Generation (Alibaba)","icon":"monitor-play","pages":[{"title":"HappyHorse Video Generation (Alibaba Cloud)","sidebarTitle":"HappyHorse Overview","icon":"monitor-play","href":"/en/api-capabilities/happyhorse/overview"},{"title":"HappyHorse Text-to-Video API Reference","sidebarTitle":"Text-to-Video","openapi":"api-reference/happyhorse-text-to-video-openapi-en.yaml POST /wan/api/v1/services/aigc/video-generation/video-synthesis","icon":"wand-sparkles","href":"/en/api-capabilities/happyhorse/text-to-video"},{"title":"HappyHorse Image-to-Video API Reference","sidebarTitle":"Image-to-Video","openapi":"api-reference/happyhorse-image-to-video-openapi-en.yaml POST /wan/api/v1/services/aigc/video-generation/video-synthesis","icon":"image","href":"/en/api-capabilities/happyhorse/image-to-video"},{"title":"HappyHorse Reference-to-Video API Reference","sidebarTitle":"Reference-to-Video","openapi":"api-reference/happyhorse-reference-to-video-openapi-en.yaml POST /wan/api/v1/services/aigc/video-generation/video-synthesis","icon":"users","href":"/en/api-capabilities/happyhorse/reference-to-video"},{"title":"HappyHorse Video Edit API Reference","sidebarTitle":"Video Edit","openapi":"api-reference/happyhorse-video-edit-openapi-en.yaml POST /wan/api/v1/services/aigc/video-generation/video-synthesis","icon":"scissors","href":"/en/api-capabilities/happyhorse/video-edit"},{"title":"HappyHorse Video Agent Skill","icon":"blocks","href":"/en/api-capabilities/happyhorse/skills"}]},{"group":"VEO 3.1 (Google)","icon":"clapperboard","pages":[{"title":"VEO 3.1 Official Video Generation","sidebarTitle":"VEO 3.1 Official Overview","icon":"video","href":"/en/api-capabilities/veo-3-1-official/overview"},{"title":"VEO 3.1 Official Text-to-Video API","sidebarTitle":"Text-to-Video","openapi":"api-reference/veo-3-1-official-text-to-video-openapi-en.yaml POST /v1/videos","icon":"wand-sparkles","href":"/en/api-capabilities/veo-3-1-official/text-to-video"},{"title":"VEO 3.1 Official Image-to-Video API","sidebarTitle":"Image-to-Video","openapi":"api-reference/veo-3-1-official-image-to-video-openapi-en.yaml POST /v1/videos","icon":"image","href":"/en/api-capabilities/veo-3-1-official/image-to-video"},{"title":"VEO 3.1 Official vs Reverse Channel Comparison","sidebarTitle":"Official vs Reverse","icon":"scale","href":"/en/api-capabilities/veo-3-1-official/vs-veo-reverse"}]},{"group":"Grok Imagine Video (xAI)","icon":"camera","pages":[{"title":"Grok Imagine Video Generation","sidebarTitle":"Grok Imagine Video Overview","icon":"video","href":"/en/api-capabilities/grok-imagine-video/overview"},{"title":"Grok Imagine Video Generation API Reference","sidebarTitle":"Video Generation","openapi":"api-reference/grok-imagine-video-openapi-en.yaml POST /v1/videos","icon":"wand-sparkles","href":"/en/api-capabilities/grok-imagine-video/video-generation"}]},{"group":"MiniMax H3 Video Generation (Self-hosted)","icon":"film","pages":[{"title":"MiniMax-H3 Video Generation","sidebarTitle":"MiniMax-H3 Overview","icon":"video","href":"/en/api-capabilities/minimax-h3/overview"},{"title":"MiniMax-H3 Video Generation API Reference","sidebarTitle":"Video Generation","openapi":"api-reference/minimax-h3-video-openapi-en.yaml POST /hailuo/v2/video_generation","icon":"video","href":"/en/api-capabilities/minimax-h3/video-generation"}]},{"group":"Oxygen Video Generation (AZ8)","icon":"clapperboard","pages":[{"title":"Oxygen Video Generation","sidebarTitle":"Oxygen Overview","icon":"video","href":"/en/api-capabilities/oxygen/overview"},{"title":"Oxygen Video Generation API Reference","sidebarTitle":"Video Generation","openapi":"api-reference/oxygen-video-openapi-en.yaml POST /videos","icon":"video","href":"/en/api-capabilities/oxygen/video-generation"}]}]},{"group":"Multimodal Understanding API","icon":"eye","pages":[{"title":"Vision Understanding (Image Recognition) API","icon":"eye","href":"/en/api-capabilities/vision-understanding"},{"title":"Video Understanding API","icon":"video","href":"/en/api-capabilities/video-understanding"},{"group":"Vision FAQ","icon":"circle-question-mark","pages":[{"title":"Image Understanding Requests Keep Timing Out — Is the Image Too Large?","icon":"image","href":"/en/faq/vision-image-too-large"}]}]},{"group":"Text Generation","icon":"file-text","pages":[{"title":"Text Generation (Chat Completions)","icon":"message-square","href":"/en/api-capabilities/text-generation"},{"group":"Gemini 4 Argon","icon":"sparkles","pages":[{"title":"Gemini 4 Argon Text Generation","sidebarTitle":"Gemini 4 Argon Overview","icon":"sparkles","href":"/en/api-capabilities/gemini-4-argon/overview"}]},{"group":"GPT-6 Astra","icon":"sparkles","pages":[{"title":"GPT-6 Astra Text Generation","sidebarTitle":"GPT-6 Astra Overview","icon":"sparkles","href":"/en/api-capabilities/gpt-6-astra/overview"}]},{"group":"DeepSeek V4 Flash Vision","icon":"eye","pages":[{"title":"DeepSeek V4 Flash Vision","sidebarTitle":"Overview","icon":"eye","href":"/en/api-capabilities/deepseek-v4-flash-vision/overview"},{"title":"DeepSeek V4 Flash Vision Chat API Reference","sidebarTitle":"Chat Playground","openapi":"api-reference/deepseek-v4-flash-vision-chat-openapi-en.yaml POST /v1/chat/completions","icon":"terminal","href":"/en/api-capabilities/deepseek-v4-flash-vision/chat-completions"},{"title":"DeepSeek V4 Flash Vision Messages API Reference","sidebarTitle":"Messages Playground","openapi":"api-reference/deepseek-v4-flash-vision-messages-openapi-en.yaml POST /v1/messages","icon":"terminal","href":"/en/api-capabilities/deepseek-v4-flash-vision/messages"}]},{"group":"DeepSeek V4 Flash","icon":"zap","pages":[{"title":"DeepSeek V4 Flash Text Generation","sidebarTitle":"Overview","icon":"zap","href":"/en/api-capabilities/deepseek-v4-flash/overview"},{"title":"DeepSeek V4 Flash Chat API Reference","sidebarTitle":"Chat Playground","openapi":"api-reference/deepseek-v4-flash-chat-openapi-en.yaml POST /v1/chat/completions","icon":"terminal","href":"/en/api-capabilities/deepseek-v4-flash/chat-completions"},{"title":"DeepSeek V4 Flash Responses API Reference","sidebarTitle":"Responses Playground","openapi":"api-reference/deepseek-v4-flash-responses-openapi-en.yaml POST /v1/responses","icon":"git-fork","href":"/en/api-capabilities/deepseek-v4-flash/responses"}]},{"group":"DeepSeek Search \u0026 Fetch","icon":"search","pages":[{"title":"DeepSeek Web Search and Fetch API","sidebarTitle":"Overview","icon":"search","href":"/en/api-capabilities/deepseek-search-fetch/overview"},{"title":"DeepSeek Web Search API Reference","sidebarTitle":"Search Playground","openapi":"api-reference/deepseek-search-openapi-en.yaml POST /v1/tools/search","icon":"terminal","href":"/en/api-capabilities/deepseek-search-fetch/search-api"},{"title":"DeepSeek Web Fetch API Reference","sidebarTitle":"Fetch Playground","openapi":"api-reference/deepseek-fetch-openapi-en.yaml POST /v1/tools/fetch","icon":"terminal","href":"/en/api-capabilities/deepseek-search-fetch/fetch-api"}]},{"group":"Seed 2.1 Turbo","icon":"zap","pages":[{"title":"Seed 2.1 Turbo Text Generation","sidebarTitle":"Overview","icon":"message-square","href":"/en/api-capabilities/dola-seed-2-1-turbo/overview"},{"title":"Seed 2.1 Turbo Chat API Reference","sidebarTitle":"Chat Playground","openapi":"api-reference/dola-seed-2-1-turbo-chat-openapi-en.yaml POST /v1/chat/completions","icon":"terminal","href":"/en/api-capabilities/dola-seed-2-1-turbo/chat-completions"},{"title":"Seed 2.1 Turbo Responses API Reference","sidebarTitle":"Responses Playground","openapi":"api-reference/dola-seed-2-1-turbo-responses-openapi-en.yaml POST /v1/responses","icon":"messages-square","href":"/en/api-capabilities/dola-seed-2-1-turbo/responses"}]},{"group":"Gemini Flash Series","icon":"sparkles","pages":[{"title":"Gemini 3.8 Flash Text Generation","sidebarTitle":"Gemini 3.8 Flash Overview","icon":"sparkles","href":"/en/api-capabilities/gemini-3-8-flash/overview"},{"title":"Gemini 3.6 Flash Text Generation","sidebarTitle":"Gemini 3.6 Flash Overview","icon":"sparkles","href":"/en/api-capabilities/gemini-3-6-flash/overview"},{"title":"Gemini 3.6 Flash Native API Reference","sidebarTitle":"3.6 Native Playground","openapi":"api-reference/gemini-3-6-flash-native-openapi-en.yaml POST /v1beta/models/gemini-3.6-flash:generateContent","icon":"terminal","href":"/en/api-capabilities/gemini-3-6-flash/generate-content"},{"title":"Gemini 3.6 Flash Chat API Reference","sidebarTitle":"3.6 Chat Playground","openapi":"api-reference/gemini-3-6-flash-chat-openapi-en.yaml POST /v1/chat/completions","icon":"terminal","href":"/en/api-capabilities/gemini-3-6-flash/chat-completions"}]},{"group":"Gemini 3.5 Flash-Lite","icon":"feather","pages":[{"title":"Gemini 3.5 Flash-Lite Text Generation","sidebarTitle":"Overview","icon":"feather","href":"/en/api-capabilities/gemini-3-5-flash-lite/overview"},{"title":"Gemini 3.5 Flash-Lite Native API Reference","sidebarTitle":"Native Playground","openapi":"api-reference/gemini-3-5-flash-lite-native-openapi-en.yaml POST /v1beta/models/gemini-3.5-flash-lite:generateContent","icon":"terminal","href":"/en/api-capabilities/gemini-3-5-flash-lite/generate-content"},{"title":"Gemini 3.5 Flash-Lite Chat API Reference","sidebarTitle":"Chat Playground","openapi":"api-reference/gemini-3-5-flash-lite-chat-openapi-en.yaml POST /v1/chat/completions","icon":"terminal","href":"/en/api-capabilities/gemini-3-5-flash-lite/chat-completions"}]},{"group":"Qwen3 Series","icon":"puzzle","pages":[{"title":"Qwen3.8-Max Text Generation","sidebarTitle":"Overview","icon":"puzzle","href":"/en/api-capabilities/qwen-3-8/overview"},{"title":"Qwen3.8-Max Chat API Reference","sidebarTitle":"Chat Playground","openapi":"api-reference/qwen-3-8-max-chat-openapi-en.yaml POST /v1/chat/completions","icon":"terminal","href":"/en/api-capabilities/qwen-3-8/chat-completions"},{"title":"Qwen3.6 Text Model Series (Legacy)","sidebarTitle":"Qwen3.6 (Legacy)","icon":"puzzle","href":"/en/api-capabilities/qwen-3-6/overview"}]},{"title":"Kimi K2.5 Text Generation","sidebarTitle":"Kimi K2.5","icon":"bot","href":"/en/api-capabilities/kimi-k2-5"}]},{"group":"Audio API (Official)","icon":"audio-lines","pages":[{"title":"Realtime Voice (WebSocket)","sidebarTitle":"Realtime Voice Overview","icon":"audio-lines","href":"/en/api-capabilities/realtime/overview"}]},{"group":"Retrieval \u0026 Safety","icon":"search","pages":[{"title":"Text Embedding API","icon":"vector-square","href":"/en/api-capabilities/text-embedding"},{"title":"Embedding Tuning in Practice","sidebarTitle":"Embedding Tuning","icon":"sliders-horizontal","href":"/en/api-capabilities/embedding-best-practices"},{"group":"Rerank","icon":"list-ordered","pages":[{"title":"bge-reranker-v2-m3 Text Reranking","sidebarTitle":"Overview","icon":"list-ordered","href":"/en/api-capabilities/rerank/overview"},{"title":"Rerank API Reference","sidebarTitle":"Playground","openapi":"api-reference/bge-reranker-v2-m3-rerank-openapi-en.yaml POST /v1/rerank","icon":"terminal","href":"/en/api-capabilities/rerank/rerank-api"},{"title":"RAG Tuning in Practice","sidebarTitle":"RAG Tuning","icon":"sliders-horizontal","href":"/en/api-capabilities/rerank/rag-best-practices"}]},{"title":"Text Moderation","icon":"shield-check","href":"/en/api-capabilities/text-moderation"}]}]},{"tab":"Use Cases","icon":"layout-grid","pages":[{"title":"Use Cases","href":"/en/scenarios"}]},{"tab":"FAQ","icon":"circle-question-mark","pages":[{"title":"FAQ","href":"/en/faq"}]},{"tab":"Live Updates","icon":"activity","pages":[{"title":"Live Updates","href":"/en/live"}]},{"tab":"Announcements","icon":"megaphone","pages":[{"title":"Announcements","href":"/en/changelog"}]},{"tab":"Promotions","icon":"gift","pages":[{"title":"Promotions","href":"/en/faq/recharge-promotions"}]},{"tab":"Model Pricing","icon":"circle-dollar-sign","pages":[{"title":"Model Pricing","href":"/en/models"}]}]},{"language":"zh-Hant","banner":{"content":"本頁由程式自動轉換為繁體中文,用詞以台灣正體為準;如有歧義請以[簡體中文版](/)為準。","dismissible":true},"footer":{"socials":{"website":"https://api.apiyi.com"},"links":[{"header":"AI 整合","items":[{"label":"skill.md","href":"https://docs.apiyi.com/skill.md"},{"label":"llms.txt","href":"https://docs.apiyi.com/llms.txt"},{"label":"llms-full.txt","href":"https://docs.apiyi.com/llms-full.txt"},{"label":"model-registry.json","href":"https://docs.apiyi.com/model-registry.json"},{"label":"AI 開發者套件(中文)","href":"/developer-kit"},{"label":"AI Developer Kit (EN)","href":"/en/developer-kit"}]},{"header":"使用者口碑 / Wall of Love","items":[{"label":"使用者口碑(中文)","href":"/wall-of-love"},{"label":"Wall of Love (EN)","href":"/en/wall-of-love"}]}]},"navbar":{"links":[{"href":"https://api.apiyi.com","label":"首頁"},{"href":"https://imagen.apiyi.com","label":"AI出圖"},{"href":"https://icover.ai","label":"AI影片"}],"primary":{"type":"button","label":"控制台","href":"https://api.apiyi.com/account/profile"}},"pages":[{"title":"zh-Hant","href":"/zh-Hant/api-capabilities/flux/image-edit"}]},{"language":"ja","banner":{"content":"このページは AI により翻訳されています。内容に相違がある場合は[English 版](/en)を正としてください。","dismissible":true},"footer":{"socials":{"website":"https://api.apiyi.com"},"links":[{"header":"AI統合","items":[{"label":"skill.md","href":"https://docs.apiyi.com/skill.md"},{"label":"llms.txt","href":"https://docs.apiyi.com/llms.txt"},{"label":"llms-full.txt","href":"https://docs.apiyi.com/llms-full.txt"},{"label":"model-registry.json","href":"https://docs.apiyi.com/model-registry.json"},{"label":"AI開発者キット(中国語)","href":"/developer-kit"},{"label":"AI Developer Kit (EN)","href":"/en/developer-kit"}]},{"header":"ユーザーの声 / Wall of Love","items":[{"label":"ユーザーの声(中国語)","href":"/wall-of-love"},{"label":"Wall of Love(英語)","href":"/en/wall-of-love"}]}]},"navbar":{"links":[{"href":"https://api.apiyi.com","label":"ホーム"},{"href":"https://imagen.apiyi.com","label":"AI画像生成"},{"href":"https://icover.ai","label":"AI動画生成"}],"primary":{"type":"button","label":"コンソール","href":"https://api.apiyi.com/account/profile"}},"pages":[{"title":"ja","href":"/ja/api-capabilities/flux/image-edit"}]},{"language":"ko","banner":{"content":"이 페이지는 AI로 번역되었습니다. 내용이 다를 경우 [English 버전](/en)을 기준으로 하십시오.","dismissible":true},"footer":{"socials":{"website":"https://api.apiyi.com"},"links":[{"header":"AI 통합","items":[{"label":"skill.md","href":"https://docs.apiyi.com/skill.md"},{"label":"llms.txt","href":"https://docs.apiyi.com/llms.txt"},{"label":"llms-full.txt","href":"https://docs.apiyi.com/llms-full.txt"},{"label":"model-registry.json","href":"https://docs.apiyi.com/model-registry.json"},{"label":"AI 개발자 키트(중국어)","href":"/developer-kit"},{"label":"AI Developer Kit (EN)","href":"/en/developer-kit"}]},{"header":"사용자 후기 / Wall of Love","items":[{"label":"사용자 후기(중국어)","href":"/wall-of-love"},{"label":"Wall of Love (영문)","href":"/en/wall-of-love"}]}]},"navbar":{"links":[{"href":"https://api.apiyi.com","label":"홈"},{"href":"https://imagen.apiyi.com","label":"AI 이미지 생성"},{"href":"https://icover.ai","label":"AI 동영상 생성"}],"primary":{"type":"button","label":"콘솔","href":"https://api.apiyi.com/account/profile"}},"pages":[{"title":"ko","href":"/ko/api-capabilities/flux/image-edit"}]},{"language":"ru","banner":{"content":"Эта страница переведена с помощью ИИ. При расхождениях ориентируйтесь на [английскую версию](/en).","dismissible":true},"footer":{"socials":{"website":"https://api.apiyi.com"},"links":[{"header":"AI-интеграция","items":[{"label":"skill.md","href":"https://docs.apiyi.com/skill.md"},{"label":"llms.txt","href":"https://docs.apiyi.com/llms.txt"},{"label":"llms-full.txt","href":"https://docs.apiyi.com/llms-full.txt"},{"label":"model-registry.json","href":"https://docs.apiyi.com/model-registry.json"},{"label":"Набор AI-разработчика (кит.)","href":"/developer-kit"},{"label":"AI Developer Kit (EN)","href":"/en/developer-kit"}]},{"header":"Отзывы пользователей / Wall of Love","items":[{"label":"Отзывы пользователей (на китайском)","href":"/wall-of-love"},{"label":"Wall of Love (EN)","href":"/en/wall-of-love"}]}]},"navbar":{"links":[{"href":"https://api.apiyi.com","label":"Главная"},{"href":"https://imagen.apiyi.com","label":"Генерация изображений"},{"href":"https://icover.ai","label":"Генерация видео"}],"primary":{"type":"button","label":"Консоль","href":"https://api.apiyi.com/account/profile"}},"pages":[{"title":"ru","href":"/ru/api-capabilities/flux/image-edit"}]}]},"title":"Image Editing API Reference - API易文档中心","buildId":"dpl_HcHmUS6i3UwswnTHJUEdcTtwfdTQ","deploymentId":"dpl_HcHmUS6i3UwswnTHJUEdcTtwfdTQ","dynamics":["10e4515597","c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["BannerMarkdown-DblVYOPe.js","dist-BnkC_6oA.js","lib--scc4DXi.js","lib-B8HbPgcC.js","clsx-CCOYKgaU.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","OpenApiReferenceProvider-BRm_l__d.js","utils-f1l1Oc-G.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-BlhqDhJO.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-DHCB7rsC.js","snippetPresets-CYXLx6Hv.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-B78P2dEq.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-C4YLPVAh.js","shallow-vlLnTDkQ.js","getApiPlaygroundDisplay-D_98hhvf.js","CodeSnippet-DtnZHGqq.js","CodeSnippets-CLFb8KJt.js","Page-kQh739Uz.js","getPastedJson-Cq-zlbnU.js","icon-sN3t983t.js","MethodPill-P_YQ2s09.js","DuplicateIcon-BVzyNsGJ.js","createIcon-B3jqgqC6.js","DynamicMarkdown-Crwq6WG_.js","SectionHeading-C7pGS2Bb.js","axios-vUo_bRtp.js","Markdown-BuPH8yuW.js","AssistantPageLink-BM4S31-f.js"]}