Flux-2
Flux-2-Modelle werden über eine einheitliche, asynchrone Job-API aufgerufen. Starte einen Task mit POST /api/generate und frage dann GET /api/generate/{taskId} ab, bis er fertig ist. Diese Familie stellt 4 Endpunkte bereit.
Überblick
Jeder Endpunkt teilt sich dieselbe Hülle — nur model und die input-Felder ändern sich. Führe einen beliebigen im Playground des Modell-Markts aus.
Authentifizierung
Erstelle einen API-Schlüssel unter /api-keys und sende ihn als Bearer-Token. Anfragen aus dem Browser bei angemeldeter Sitzung funktionieren auch über das Session-Cookie.
Authorization: Bearer <YOUR_API_KEY>Task erstellen
POST https://api.lithovas.com/api/generateBody: { "model": "<slug>", "input": { … } }
Antwort: { "taskId": "<id>", "state": "waiting" }
Ergebnis abfragen
GET https://api.lithovas.com/api/generate/<taskId>Antwort: { "taskId", "state": "waiting" | "success" | "fail", "resultUrls": [ … ], "creditsConsumed", "failMsg", "balance" }
state zu success oder fail wird. Fehlgeschlagene Tasks werden nicht berechnet.Endpunkte
Pro · Image to Image
flux2/pro-image-to-imageinput_urlsarray<string>erforderlichReference images (1-8), max 10MB each, JPEG/PNG/WebP formats
promptstringerforderlichText description (3-5000 characters) guiding the generation
aspect_ratiostringerforderlichOutput image proportions; 'auto' matches first input image
resolutionstringerforderlichOutput image resolution level
nsfw_checkerbooleanoptionalContent filtering toggle; false disables safety filtering
curl -X POST https://api.lithovas.com/api/generate \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux2/pro-image-to-image",
"input": {
"input_urls": [
"https://example.com/file"
],
"prompt": "A cinematic red panda surfing through neon rain at dusk.",
"aspect_ratio": "1:1",
"resolution": "1K",
"nsfw_checker": false
}
}'Pro · Text to Image
flux2/pro-text-to-imagepromptstringerforderlichGeneration prompt, must be between 3 and 5000 characters
aspect_ratioenum<string>erforderlichAspect ratio for generated image
resolutionenum<string>erforderlichOutput image resolution
nsfw_checkerbooleanoptionalDisable content filtering when set to false
curl -X POST https://api.lithovas.com/api/generate \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux2/pro-text-to-image",
"input": {
"prompt": "A cinematic red panda surfing through neon rain at dusk.",
"aspect_ratio": "1:1",
"resolution": "1K",
"nsfw_checker": false
}
}'Flex · Image to Image
flux2/flex-image-to-imageinput_urlsarray<string>erforderlichInput reference images (1-8), file URLs after upload
promptstringerforderlichText description of desired modifications; 3-5000 characters
aspect_ratioenum<string>erforderlichOutput image aspect ratio; auto matches first input
resolutionenum<string>erforderlichOutput image resolution
curl -X POST https://api.lithovas.com/api/generate \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux2/flex-image-to-image",
"input": {
"input_urls": [
"https://example.com/file"
],
"prompt": "A cinematic red panda surfing through neon rain at dusk.",
"aspect_ratio": "1:1",
"resolution": "1K"
}
}'Flex · Text to Image
flux2/flex-text-to-imagepromptstringerforderlichGeneration prompt, length must be between 3-5000 characters
aspect_ratioenum<string>erforderlichAspect ratio of the generated image
resolutionenum<string>erforderlichOutput image resolution
nsfw_checkerbooleanoptionalDisable content filtering when set to false
curl -X POST https://api.lithovas.com/api/generate \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux2/flex-text-to-image",
"input": {
"prompt": "A cinematic red panda surfing through neon rain at dusk.",
"aspect_ratio": "1:1",
"resolution": "1K",
"nsfw_checker": false
}
}'