curl --request POST \
--url https://api.apimart.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "z-image-turbo",
"prompt": "Ink painting style landscape scenery"
}'
import requests
url = "https://api.apimart.ai/v1/images/generations"
payload = {
"model": "z-image-turbo",
"prompt": "Ink painting style landscape scenery"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/images/generations";
const payload = {
model: "z-image-turbo",
prompt: "Ink painting style landscape scenery",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01JGXYZ1234567890ABCDEF"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Authentication failed, please check your API key",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient balance, please top up",
"type": "payment_required"
}
}
Z-Image-Turbo
Z-Image-Turbo Bildgenerierung
- Asynchroner Verarbeitungsmodus, gibt eine Aufgaben-ID für nachfolgende Abfragen zurück
- Leichte und schnelle Bildgenerierung, unterstützt Chinesisch und Englisch
- Unterstützt Auflösungsstufen 1K/2K, unterstützt intelligente Prompt-Umschreibung
POST
/
v1
/
images
/
generations
curl --request POST \
--url https://api.apimart.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "z-image-turbo",
"prompt": "Ink painting style landscape scenery"
}'
import requests
url = "https://api.apimart.ai/v1/images/generations"
payload = {
"model": "z-image-turbo",
"prompt": "Ink painting style landscape scenery"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/images/generations";
const payload = {
model: "z-image-turbo",
prompt: "Ink painting style landscape scenery",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01JGXYZ1234567890ABCDEF"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Authentication failed, please check your API key",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient balance, please top up",
"type": "payment_required"
}
}
curl --request POST \
--url https://api.apimart.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "z-image-turbo",
"prompt": "Ink painting style landscape scenery"
}'
import requests
url = "https://api.apimart.ai/v1/images/generations"
payload = {
"model": "z-image-turbo",
"prompt": "Ink painting style landscape scenery"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/images/generations";
const payload = {
model: "z-image-turbo",
prompt: "Ink painting style landscape scenery",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01JGXYZ1234567890ABCDEF"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Authentication failed, please check your API key",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient balance, please top up",
"type": "payment_required"
}
}
Unterstützte Modelle
| Modell | Beschreibung | Bilder pro Anfrage | Preis |
|---|---|---|---|
z-image-turbo | Leichte und schnelle Bildgenerierung, unterstützt Chinesisch und Englisch | Fest 1 Bild | Festpreis |
Autorisierung
string
erforderlich
Alle Endpunkte erfordern eine Bearer-Token-AuthentifizierungAPI-Key abrufen:Besuchen Sie die API-Key-Verwaltung, um Ihren API-Key zu erhaltenZum Request-Header hinzufügen:
Authorization: Bearer YOUR_API_KEY
Body
string
erforderlich
Modellname
z-image-turbo– Leichte und schnelle Bildgenerierung, unterstützt Chinesisch und Englisch
boolean
Standard:"false"
Legt fest, ob der Inhalt vor dem Absenden des Bildauftrags moderiert wird.
true: Prompts und Eingabebilder mitomni-moderation-latestprüfenfalseoder nicht angegeben: keine Moderationsanfrage und damit keine zusätzlichen Moderationskosten oder Verzögerung (Standard)
string
erforderlich
Textbeschreibung für die Bildgenerierung, bis zu 800 Zeichen
string
Standard:"1:1"
Seitenverhältnis des BildesUnterstützte Seitenverhältnisse:
1:1– Quadrat (Standard)4:3– Querformat 4:33:4– Hochformat 3:416:9– Querformat Breitbild9:16– Hochformat vertikal3:2– Querformat 3:22:3– Hochformat 2:3
string
Standard:"1K"
Auflösungsstufe
1K– Standardauflösung (Standard)2K– Hochauflösend
boolean
Standard:"false"
Intelligente Prompt-UmschreibungWenn aktiviert, optimiert die KI den Prompt automatisch für bessere Ergebnisse, wobei die Kosten steigen.
false– Deaktiviert (Standard)true– Aktiviert
Auflösungs-Referenztabelle
Die Ausgabegröße wird durch die Kombination vonsize (Verhältnis) + resolution (Auflösungsstufe) gesteuert.
| Verhältnis | Stufe 1K | Stufe 2K |
|---|---|---|
1:1 | 1024×1024 | 2048×2048 |
4:3 | 1152×864 | 2048×1536 |
3:4 | 864×1152 | 1536×2048 |
16:9 | 1280×720 | 2048×1152 |
9:16 | 720×1280 | 1152×2048 |
3:2 | 1248×832 | 2048×1360 |
2:3 | 832×1248 | 1360×2048 |
Anwendungsbeispiele
Einfaches Text-zu-Bild (minimale Anfrage){
"model": "z-image-turbo",
"prompt": "Ink painting style landscape scenery"
}
{
"model": "z-image-turbo",
"prompt": "Minimalist style cafe interior design",
"size": "16:9",
"resolution": "2K"
}
{
"model": "z-image-turbo",
"prompt": "A cat",
"prompt_extend": true
}
Response
integer
Antwort-Statuscode
array
Hinweise
- Asynchrone Verarbeitung: Nach dem Senden wird eine
task_idzurückgegeben. Fragen Sie/v1/tasks/{task_id}ab, um die Ergebnisse zu erhalten - Bildspeicherung: Generierte Bilder werden auf das Plattform-CDN gespiegelt und sind langfristig gültig
- Abrechnungsregeln: Abrechnung pro erfolgreich generiertem Bild, keine Gebühr bei Fehlern
- Feste Anzahl: Z-Image-Turbo generiert genau 1 Bild pro Anfrage, der Parameter
nwird nicht unterstützt