Para uma nova integração, use Geração de imagens com o protocolo unificado
/ai/v1/images/generations. As interfaces compatíveis desta página continuam disponíveis. Consulte a API Schema do modelo, selecione o endpoint por path e leia seu request.schema sem depender da ordem do array.Inventário atual de modelos
| Provedor | IDs de modelo |
|---|---|
| OpenAI | gpt-image-2, gpt-image-2-free, gpt-image-1.5, gpt-image-1, gpt-image-1-mini, dall-e-3, dall-e-2 |
| Google Gemini | gemini-3.1-flash-lite-image, gemini-3.1-flash-image, gemini-3-pro-image, gemini-3.1-flash-image-preview, gemini-3.1-flash-image-preview-free, gemini-3-pro-image-preview, gemini-2.5-flash-image, gemini-2.5-flash-image-preview |
| Google Imagen | imagen-4.0, imagen-4.0-fast-generate-001, imagen-4.0-generate-001, imagen-4.0-ultra-generate-001, imagen-4.0-ultra |
| Qwen / Wan | qwen-image-3.0, qwen-image-3.0-pro, qwen-image-2.0, qwen-image-2.0-pro, wan2.7-image, wan2.7-image-pro, qwen-image, qwen-image-edit, qwen-image-max, wan2.6-t2i |
| GLM | glm-image |
| ByteDance | doubao-seedream-5.0-pro, doubao-seedream-5.0-lite, doubao-seedream-4-5, doubao-seedream-4-0 |
| Microsoft | mai-image-2.5-pro, mai-image-2.5, mai-image-2.5-flash |
| Ideogram | V3, V_2, V_2_TURBO, V_2A, V_2A_TURBO, V_1, V_1_TURBO, DESCRIBE, UPSCALE |
| Stable Diffusion | Stable-Diffusion-3-5-Large |
| Baidu | ernie-image-turbo, musesteamer-air-image |
| Flux | flux-2-flex, flux-2-pro, FLUX-1.1-pro |
| Agnes | agnes-image-2.1-flash |
Este inventário mostra os modelos disponíveis atualmente. Isso não significa que todos aceitem os mesmos campos. Selecione o endpoint por
path no Schema do modelo e leia seu request.schema.API Interface
Request URL
POST https://aihubmix.com/v1/models/<model_path>/predictions
<model_path> is <provider/model_id>, por exemplo, <openai/gpt-image-1.5>, <qianfan/qwen-image>.
Headers da Requisição
Authorization: Bearer $AIHUBMIX_API_KEY
Content-Type: application/json
Parâmetros da Requisição
General Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| prompt | string | Sim | Prompt words |
| size | string | Não | Image size, suporta 1K (not supported in Doubao-4-5 series), 2K, 4K, auto (default). Qwen series supports: 512*1024, 768*512, 768*1024, 1024*576, 576*1024, 1024*1024 (default) |
| image | string | Não | Reference image path |
| n | integer | Não | Number of images to generate, suporta 1-10, default is 1 |
| quality | string | Não | Rendering quality, suporta low, medium, and high; higher quality takes longer time |
OpenAI Model Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| input_fidelity | string | Não | Fidelity, suporta high and low (default) |
| moderation | string | Não | Content moderation strictness, suporta auto (default, standard filtering) and low (less filtering), not supported in image-to-image mode |
| output_format | string | Não | Output image format, suporta png, jpeg (default) , webp |
Flux Model Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| safety_tolerance | integer | Não | Audit leniency, higher values indicate more leniency. Range 0<=x<=5, default value is 2 |
| aspect_ratio | string | Não | Desired aspect ratio for the image, suporta 16:9 (default), 1:1, 4:3 |
| seed | integer | Não | Random number seed |
| raw | boolean | Não | Whether to enable raw mode for a more natural visual effect, default false |
Qwen Model Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| watermark | boolean | Não | Whether to add a watermark to the generated image, suporta true (default) and false |
| seed | integer | Não | Random number seed, range [0,2147483647] |
Doubao Model Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| sequential_image_generation | string | Não | Control whether to disable composite image functionality |
| sequential_image_generation_options | object | Não | Composite image configuration, effective only when sequential_image_generation is auto. Currently suporta max_images, range [1, 15], default value is 15 |
| watermark | boolean | Não | Whether to add a watermark to the generated image, suporta true (default) and false |
| seed | integer | Não | Random number seed, range [-1, 2147483647], default value is -1 |
| response_format | string | Não | Return format for the generated image, suporta url (link valid for 24 hours after image generation, please download promptly) or base64_json |
The actual number of images that can be generated is influenced not only by
max_images but also by the number of reference images provided. The number of input reference images + the final number of generated images ≤ 15.Usage Examples
OpenAI
curl https://aihubmix.com/v1/models/openai/gpt-image-1.5/predictions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-***" \
-d '{
"input": {
"prompt": "A deer drinking in the lake, Sakura petals falling, green and clean water, japanese temple, dappled sunlight, cinematic lighting, expansive view, peace",
"size": "1024x1024",
"n": 1,
"quality": "high",
"moderation": "low",
"background": "auto"
}
}'
curl https://aihubmix.com/v1/images/edits \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "model=gpt-image-1.5" \
-F "prompt=Change the background to blue sky and white clouds." \
-F "image=@test.png" \
-F "size=1024x1024"
gpt-image-2
Este é um modelo de edição de imagens da OpenAI. Use o nome completogpt-image-2; image2 não é um ID de modelo válido. Quando o endpoint retorna b64_json, os exemplos abaixo salvam o resultado como edited.png.
curl.exe -sS -X POST "https://aihubmix.com/v1/images/edits" `
-H "Authorization: Bearer YOUR_API_KEY" `
-F "model=gpt-image-2" `
-F "prompt=Altere o fundo para céu azul e nuvens brancas." `
-F "image=@test.png" `
-F "size=1024x1024" `
-D headers.txt `
-o response.json `
-w "HTTP_CODE:%{http_code}`nTOTAL:%{time_total}`n"
$b64 = (Get-Content .\response.json -Raw | ConvertFrom-Json).data[0].b64_json
[IO.File]::WriteAllBytes(".\edited.png", [Convert]::FromBase64String($b64))
import { readFile, writeFile } from "node:fs/promises";
const apiKey = process.env.AIHUBMIX_API_KEY;
if (!apiKey) {
throw new Error("Set AIHUBMIX_API_KEY first.");
}
const form = new FormData();
form.append("model", "gpt-image-2");
form.append("prompt", "Altere o fundo para céu azul e nuvens brancas.");
form.append("image", new Blob([await readFile("test.png")], { type: "image/png" }), "test.png");
form.append("size", "1024x1024");
const response = await fetch("https://aihubmix.com/v1/images/edits", {
method: "POST",
headers: {
Authorization: `Bearer ${apiKey}`,
},
body: form,
});
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`);
}
const result = (await response.json()) as {
data: Array<{ b64_json: string }>;
};
await writeFile("edited.png", Buffer.from(result.data[0].b64_json, "base64"));
Google Imagen
curl https://aihubmix.com/v1/models/google/imagen-4.0-fast-generate-001/predictions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-***" \
-d '{
"input": {
"prompt": "A deer drinking in the lake, Sakura petals falling, green and clean water, japanese temple, dappled sunlight, cinematic lighting, expansive view, peace",
"numberOfImages": 1
}
}'
Qwen
curl https://aihubmix.com/v1/models/qianfan/qwen-image/predictions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-***" \
-d '{
"input": {
"prompt": "A beautiful sunset over a calm ocean",
"refer_image": "",
"n": 1,
"size": "1024x1024",
"watermark": false
}
}'
curl https://aihubmix.com/v1/models/qianfan/qwen-image-edit/predictions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-***" \
-d '{
"input": {
"prompt": "Put this bear sitting under the moon (represented by a light gray crescent outline on a white background), holding a guitar, with small stars and speech bubbles like 'Be Kind' floating around.",
"image": "https://help-static-aliyun-doc.aliyuncs.com/assets/img/zh-CN/4766809571/p999719.png",
"n": 1,
"size": "1024x1024",
"watermark": false,
"seed": 0
}
}'
Doubao
curl https://aihubmix.com/v1/models/doubao/doubao-seedream-4-0/predictions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-***" \
-d '{
"input": {
"prompt": "Interstellar, black hole, a vintage train bursting out of a black hole, vying for visual impact, cinematic blockbuster, apocalyptic feel, dynamic, contrasting colors, oc rendering, ray tracing, motion blur, depth of field, surrealism, deep blue, the scene is shaped by delicate rich color layers creating the subject and scene, realistic texture, the lighting effects of a dark background create an atmosphere, combining artistic fantasy, exaggerated wide-angle perspective, glare, reflection, extreme light and shadow, strong gravity, devouring",
"size": "2K",
"sequential_image_generation": "disabled",
"stream": false,
"response_format": "url",
"watermark": true
}
}'
curl https://aihubmix.com/v1/models/doubao/doubao-seedream-4-5/predictions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-***" \
-d '{
"input": {
"model": "doubao-seedream-4-5",
"prompt": "Keep the model's pose and the flowing shape of the liquid clothing unchanged. Change the clothing material from silver metal to completely transparent clear water (or glass). Through the liquid flow, the model's skin details can be seen. The light and shadow change from reflection to refraction.",
"image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_5_imageToimage.png",
"size": "2K",
"watermark": false
}
}'
curl https://aihubmix.com/v1/models/doubao/doubao-seedream-4-5/predictions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-***" \
-d '{
"input": {
"model": "doubao-seedream-4-5",
"prompt": "Change the clothing in image 1 to the clothing in image 2",
"image": ["https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imagesToimage_1.png", "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_5_imagesToimage_2.png"],
"sequential_image_generation": "disabled",
"size": "2K",
"watermark": false
}
}'
curl https://aihubmix.com/v1/models/doubao/doubao-seedream-4-5/predictions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-***" \
-d '{
"input": {
"model": "doubao-seedream-4-5",
"prompt": "Generate 3 images of a girl and a cow toy happily riding a roller coaster in an amusement park, covering morning, noon, and evening",
"image": ["https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imagesToimages_1.png", "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imagesToimages_2.png"],
"sequential_image_generation": "auto",
"sequential_image_generation_options": {
"max_images": 3
},
"size": "2K",
"watermark": false
}
}'
Flux
flux-2-flexandflux-2-proare asynchronous endpoints, requiring a two-step request. This series is extremely fast, almost instantaneous.
FLUX One-Step Drawing
Ideogram V3
- Versions below V3 (V_2, V_1, etc.) are old interfaces and are not supported.
- The returned links require a proxy network to access.
curl https://aihubmix.com/v1/models/ideogram/V3/predictions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-***" \
-d '{
"input": {
"prompt": "A deer drinking in the lake, Sakura petals falling, green and clean water, japanese temple, dappled sunlight, cinematic lighting, expansive view, peace, in the style of Pixar 3D",
"rendering_speed": "QUALITY",
"aspect_ratio": "2x1"
}
}'