curl --request POST \
--url https://api.apimart.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "flux-kontext-pro",
"prompt": "Change hair color to blue",
"image_urls": ["https://upload.apimart.ai/f/models/9998230420418352-159728fe-5ae8-4330-857a-a84c034d8d21-flux-kontext-pro.webp"],
"size": "16:9"
}'
import requests
url = "https://api.apimart.ai/v1/images/generations"
payload = {
"model": "flux-kontext-pro",
"prompt": "Change hair color to blue",
"image_urls": ["https://upload.apimart.ai/f/models/9998230420418352-159728fe-5ae8-4330-857a-a84c034d8d21-flux-kontext-pro.webp"],
"size": "16:9"
}
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: "flux-kontext-pro",
prompt: "Change hair color to blue",
image_urls: ["https://upload.apimart.ai/f/models/9998230420418352-159728fe-5ae8-4330-857a-a84c034d8d21-flux-kontext-pro.webp"],
size: "16:9"
};
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_01KFG5BBFNK1YQDTJDZY0P0QT2"
}
]
}
{
"error": {
"code": 401,
"message": "Authentifizierung fehlgeschlagen. Überprüfen Sie Ihren API-Key.",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Unzureichendes Guthaben. Bitte laden Sie Ihr Konto auf.",
"type": "payment_required"
}
}
Flux Kontext
Flux Kontext Bildgenerierung
-
Asynchrone Verarbeitung; nach dem Absenden wird eine Aufgaben-ID zur späteren Abfrage zurückgegeben
-
Pro und Max unterstützen sowohl Text-zu-Bild als auch die Bearbeitung mit Referenzbildern
-
expires_atim Generierungsergebnis gibt den Ablaufzeitpunkt des Bildlinks an
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": "flux-kontext-pro",
"prompt": "Change hair color to blue",
"image_urls": ["https://upload.apimart.ai/f/models/9998230420418352-159728fe-5ae8-4330-857a-a84c034d8d21-flux-kontext-pro.webp"],
"size": "16:9"
}'
import requests
url = "https://api.apimart.ai/v1/images/generations"
payload = {
"model": "flux-kontext-pro",
"prompt": "Change hair color to blue",
"image_urls": ["https://upload.apimart.ai/f/models/9998230420418352-159728fe-5ae8-4330-857a-a84c034d8d21-flux-kontext-pro.webp"],
"size": "16:9"
}
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: "flux-kontext-pro",
prompt: "Change hair color to blue",
image_urls: ["https://upload.apimart.ai/f/models/9998230420418352-159728fe-5ae8-4330-857a-a84c034d8d21-flux-kontext-pro.webp"],
size: "16:9"
};
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_01KFG5BBFNK1YQDTJDZY0P0QT2"
}
]
}
{
"error": {
"code": 401,
"message": "Authentifizierung fehlgeschlagen. Überprüfen Sie Ihren API-Key.",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Unzureichendes Guthaben. Bitte laden Sie Ihr Konto auf.",
"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": "flux-kontext-pro",
"prompt": "Change hair color to blue",
"image_urls": ["https://upload.apimart.ai/f/models/9998230420418352-159728fe-5ae8-4330-857a-a84c034d8d21-flux-kontext-pro.webp"],
"size": "16:9"
}'