단일 요청 형식으로 GPT Image 2, GPT Image 2.5 Flare, GPT Image 2.5 Sunburst, Nano Banana, Nano Banana 2, Nano Banana 2 Lite, Nano Banana 2.1, Nano Banana Pro, Seedream 4.0, Seedream 4.5, Seedream 5.0, Seedream 5 Pro을(를) 실행하세요.
프롬프트로 이미지를 생성하려면 /v1/images/generations를 사용하세요. JSON을 지원합니다.
https://api.mlmux.com/v1/images/generations이미지를 편집하거나 합성하려면 /v1/images/edits를 사용하세요. JSON에 이미지 URL을 포함해 전송하거나 image 및 mask 멀티파트 필드로 파일을 업로드할 수 있습니다. 각 최대 50 MB 크기의 이미지를 최대 16장까지 지원합니다.
https://api.mlmux.com/v1/images/editscurl https://api.mlmux.com/v1/images/generations \
-H "Authorization: Bearer $MLMUX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nano-banana-2",
"prompt": "Editorial product photo of a ceramic mug on linen, soft window light",
"aspect_ratio": "4:3",
"resolution": "2K",
"output_format": "png",
"route_mode": "official-cheap"
}'요청은 기본적으로 동기식으로 처리되며 응답에 이미지가 반환됩니다. 대신 작업을 반환받으려면 "async": true를 추가하세요.
| 필드 | 타입 | 필수 여부 | 설명 |
|---|---|---|---|
model | string | 예 | 아래 표의 모델 ID입니다. 고유한 짧은 이름인 경우 제공업체 접두사를 생략할 수 있습니다(예: gpt-image-2). |
prompt | string | 예 | 생성하거나 변경할 내용이며, 최대 20,000자까지 지원합니다. |
image_urls편집 전용 | string[] | 예 | 입력 이미지의 공개 http(s) URL 목록(순서대로)입니다. 단일 이미지의 경우 image_url도 사용할 수 있습니다. |
mask_url편집 전용 | string | 아니요 | 마스크 편집을 지원하는 모델에 사용할 마스크 이미지 URL입니다. |
route_mode | string | 아니요 | official 또는 official-cheap입니다. 기본값은 키의 route mode이며, 그 다음은 official-cheap입니다. |
resolution | string | 아니요 | 해당 기능을 지원하는 Gemini 모델에서의 1K, 2K 또는 4K 설정입니다. Nano Banana 및 Nano Banana 2 Lite에는 해상도 설정이 없습니다. |
size | string | 아니요 | GPT Image 및 Seedream의 출력 크기입니다(예: 1024x1024, 2K, auto). |
aspect_ratio | string | 아니요 | 1:1, 16:9, match_input_image 등입니다. 허용되는 값은 모델에 따라 다릅니다. |
output_format | string | 아니요 | 모델에서 지원하는 경우 png, jpg, jpeg 또는 webp입니다. |
n | integer | 아니요 | 이미지 수(1~4)입니다. 기본값은 1입니다. |
async | boolean | 아니요 | true로 설정하면 이미지를 기다리는 대신 폴링할 수 있는 작업(HTTP 202)을 반환합니다. |
model에 이 값을 사용하세요. GET /v1/models는 계정에서 사용할 수 있는 ID를 반환합니다.
| 모델 | 모델 ID |
|---|---|
| GPT Image 2 | openai/gpt-image-2 |
| GPT Image 2.5 Flare | weavy/gpt-image-2.5-flare |
| GPT Image 2.5 Sunburst | weavy/gpt-image-2.5-sunburst |
| Nano Banana | nano-banana |
| Nano Banana 2 | nano-banana-2 |
| Nano Banana 2 Lite | nano-banana-2-lite |
| Nano Banana 2.1 | google/gemini-nano-banana-2.1 |
| Nano Banana Pro | nano-banana-pro |
| Seedream 4.0 | weavy/doubao-seedream-4-0-250828 |
| Seedream 4.5 | weavy/doubao-seedream-4-5-251128 |
| Seedream 5.0 | weavy/doubao-seedream-5-0-260128 |
| Seedream 5 Pro | weavy/doubao-seedream-5-0-pro-260628 |
GPT Image 2, GPT Image 2.5 Flare 및 GPT Image 2.5 Sunburst는 현재 official에서만 실행됩니다. 이 모델들을 사용할 때는 "route_mode": "official"을 전송하세요. 지정하지 않으면 요청에 기본값인 official-cheap이 적용되어 실패합니다.
동기 요청은 HTTP 200과 함께 data에 이미지별 URL 하나씩, usage에 토큰 수를 반환합니다. 출력 URL은 MLMux에서 호스팅되므로 보관할 파일은 직접 다운로드하세요.
{
"created": 1767225600,
"data": [
{ "url": "https://.../generated/9f2c....png" }
],
"usage": {
"input_tokens": 18,
"output_tokens": 1120,
"total_tokens": 1138,
"input_tokens_details": { "text_tokens": 18, "image_tokens": 0 }
}
}"async": true를 지정하면 요청이 HTTP 202와 작업을 반환합니다. status가 succeeded가 될 때까지 poll_url을 폴링하세요. 완료되면 data에 이미지가 표시됩니다.
https://api.mlmux.com/v1/images/generations/{task_id}{
"id": "task_7c1e...",
"object": "image.generation.task",
"status": "queued",
"created": 1767225600,
"model": "nano-banana-2",
"api_method": "images.generations.create",
"poll_url": "/v1/images/generations/task_7c1e...",
"progress": 0,
"message": "queued",
"estimated_charge_credits": 0.067
}{
"id": "task_7c1e...",
"object": "image.generation.task",
"status": "succeeded",
"progress": 100,
"message": "completed",
"estimated_charge_credits": 0.067,
"data": [
{ "url": "https://.../generated/7c1e....png" }
]
}이미지 편집 작업은 /v1/images/edits/{task_id}에서 폴링합니다. GET /v1/tasks/{task_id}는 모든 작업에 사용할 수 있습니다.