GPT Image
GPT Image-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
| Modell | Task | model slug |
|---|---|---|
| GPT Image 1.5 | Text to Image | gpt-image/1-5-text-to-image |
| GPT Image 1.5 | Image to Image | gpt-image/1-5-image-to-image |
| GPT Image 2 | Text to Image | gpt/gpt-image-2-text-to-image |
| GPT Image 2 | Image to Image | gpt/gpt-image-2-image-to-image |
GPT Image 1.5 · Text to Image
gpt-image/1-5-text-to-imagepromptstringerforderlichText description of the image to generate
aspect_ratioenum<string>erforderlichWidth-height ratio determining visual form
qualityenum<string>erforderlichMedium for balanced output; high for detailed
curl -X POST https://api.lithovas.com/api/generate \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image/1-5-text-to-image",
"input": {
"prompt": "A cinematic red panda surfing through neon rain at dusk.",
"aspect_ratio": "1:1",
"quality": "medium"
}
}'GPT Image 1.5 · Image to Image
gpt-image/1-5-image-to-imageinput_urlsarray<string>erforderlichInput image file URLs (max 16 URLs)
promptstringerforderlichText description of desired image generation or edit
aspect_ratioenum<string>erforderlichWidth-height ratio of the image
qualityenum<string>erforderlichQuality: medium for balanced, high for detailed
curl -X POST https://api.lithovas.com/api/generate \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image/1-5-image-to-image",
"input": {
"input_urls": [
"https://example.com/file"
],
"prompt": "A cinematic red panda surfing through neon rain at dusk.",
"aspect_ratio": "3:2",
"quality": "medium"
}
}'GPT Image 2 · Text to Image
gpt/gpt-image-2-text-to-imagepromptstringerforderlichText prompt for image generation (max 20000 chars)
aspect_ratioenum<string>optionalImage aspect ratio (some ratios unavailable for 2K/4K)
resolutionenum<string>optionalOutput image resolution
curl -X POST https://api.lithovas.com/api/generate \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt/gpt-image-2-text-to-image",
"input": {
"prompt": "A cinematic red panda surfing through neon rain at dusk.",
"aspect_ratio": "auto",
"resolution": "1K"
}
}'GPT Image 2 · Image to Image
gpt/gpt-image-2-image-to-imagepromptstringerforderlichText prompt for image generation, up to 20000 characters
input_urlsarray<string>erforderlichArray of input image URLs (max 16 images)
aspect_ratioenum<string>optionalOutput aspect ratio (5:4 and 4:5 limited to 1K)
resolutionenum<string>optionalImage resolution (1:1 cannot use 4K; auto limited to 1K)
curl -X POST https://api.lithovas.com/api/generate \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt/gpt-image-2-image-to-image",
"input": {
"prompt": "A cinematic red panda surfing through neon rain at dusk.",
"input_urls": [
"https://example.com/file"
],
"aspect_ratio": "auto",
"resolution": "1K"
}
}'