Verwenden Sie für neue Integrationen Bildgenerierung mit dem einheitlichen Protokoll
/ai/v1/images/generations. Die kompatiblen Schnittstellen auf dieser Seite bleiben verfügbar. Fragen Sie die Modell-Schema-API ab, wählen Sie den Endpunkt anhand von path und lesen Sie dessen request.schema; verlassen Sie sich nicht auf die Array-Reihenfolge.Aktuelle Modellübersicht
| Anbieter | Modell-IDs |
|---|---|
| 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 |
Diese Übersicht zeigt aktuell verfügbare Modelle. Sie bedeutet nicht, dass alle Modelle dieselben Felder akzeptieren. Wählen Sie den Endpunkt über
path im Modell-Schema und lesen Sie dessen request.schema.API-Schnittstelle
Request-URL
POST https://aihubmix.com/v1/models/<model_path>/predictions
<model_path> hat die Form <provider/model_id>, z. B. <openai/gpt-image-1.5>, <qianfan/qwen-image>.
Request-Header
Authorization: Bearer $AIHUBMIX_API_KEY
Content-Type: application/json
Request-Parameter
Allgemeine Parameter
| Parameter | Typ | Pflicht | Beschreibung |
|---|---|---|---|
| prompt | string | Ja | Prompt-Text |
| size | string | Nein | Bildgröße; unterstützt 1K (nicht in Doubao-4-5-Serie), 2K, 4K, auto (Standard). Qwen-Serie unterstützt: 512*1024, 768*512, 768*1024, 1024*576, 576*1024, 1024*1024 (Standard) |
| image | string | Nein | Pfad zum Referenzbild |
| n | integer | Nein | Anzahl der zu generierenden Bilder, 1–10, Standard 1 |
| quality | string | Nein | Rendering-Qualität: low, medium, high; höhere Qualität dauert länger |
OpenAI-Modell-Parameter
| Parameter | Typ | Pflicht | Beschreibung |
|---|---|---|---|
| input_fidelity | string | Nein | Treue, unterstützt high und low (Standard) |
| moderation | string | Nein | Strenge der Inhaltsmoderation, unterstützt auto (Standard, normale Filterung) und low (weniger Filterung); im Bild-zu-Bild-Modus nicht unterstützt |
| output_format | string | Nein | Ausgabe-Bildformat: png, jpeg (Standard), webp |
Flux-Modell-Parameter
| Parameter | Typ | Pflicht | Beschreibung |
|---|---|---|---|
| safety_tolerance | integer | Nein | Toleranz der Prüfung; höhere Werte = nachsichtiger. Bereich 0<=x<=5, Standard 2 |
| aspect_ratio | string | Nein | Gewünschtes Seitenverhältnis: 16:9 (Standard), 1:1, 4:3 |
| seed | integer | Nein | Zufalls-Seed |
| raw | boolean | Nein | Aktiviert den Raw-Modus für eine natürlichere Bildwirkung, Standard false |
Qwen-Modell-Parameter
| Parameter | Typ | Pflicht | Beschreibung |
|---|---|---|---|
| watermark | boolean | Nein | Ob ein Wasserzeichen hinzugefügt wird; unterstützt true (Standard) und false |
| seed | integer | Nein | Zufalls-Seed, Bereich [0,2147483647] |
Doubao-Modell-Parameter
| Parameter | Typ | Pflicht | Beschreibung |
|---|---|---|---|
| sequential_image_generation | string | Nein | Steuert, ob die Composite-Image-Funktion deaktiviert wird |
| sequential_image_generation_options | object | Nein | Composite-Image-Konfiguration, nur wirksam, wenn sequential_image_generation auf auto steht. Unterstützt derzeit max_images, Bereich [1, 15], Standard 15 |
| watermark | boolean | Nein | Wasserzeichen hinzufügen; true (Standard) und false |
| seed | integer | Nein | Zufalls-Seed, Bereich [-1, 2147483647], Standard -1 |
| response_format | string | Nein | Rückgabeformat des generierten Bildes: url (Link 24 Stunden nach Generierung gültig, bitte zeitnah herunterladen) oder base64_json |
Die tatsächlich erzeugbare Anzahl an Bildern wird nicht nur von
max_images, sondern auch von der Anzahl der bereitgestellten Referenzbilder beeinflusst. Eingabe-Referenzbilder + finale Bildanzahl ≤ 15.Anwendungsbeispiele
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
Dies ist ein OpenAI-Modell für Bildbearbeitung. Verwenden Sie den vollständigen Modellnamengpt-image-2; image2 ist keine gültige Modell-ID. Wenn der Endpunkt b64_json zurückgibt, speichern die folgenden Beispiele das Ergebnis als 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=Ändere den Hintergrund in blauen Himmel und weiße Wolken." `
-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", "Ändere den Hintergrund in blauen Himmel und weiße Wolken.");
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-flexundflux-2-prosind asynchrone Endpoints, die einen zweistufigen Request erfordern. Diese Serie ist extrem schnell, nahezu sofortig.
FLUX – Einstufiges Zeichnen
Flux – Asynchrones Zeichnen
Schritt 1: Zeichnungsanfrage senden Beispiel-Ausgabe:{
"output": [
{
"taskId": "api.us1.***",
"polling_url": "https://api.us1.bfl.ai/v1/get_result?id=f9821dbf-f134-41c2-aaa8-5405fb665c76"
}
]
}
Get Image
curl https://api.aihubmix.com/v1/tasks/<taskId> \
-H "Authorization: Bearer sk-***" \
-X GET
Ideogram V3
- Versionen unterhalb V3 (V_2, V_1 usw.) sind alte Schnittstellen und werden nicht unterstützt.
- Die zurückgegebenen Links erfordern einen Proxy-Zugriff.
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"
}
}'