GPT Image
GPT Image models are called through one unified, asynchronous job API. Start a task with POST /api/generate, then poll GET /api/generate/{taskId} until it finishes. This family exposes 4 endpoints.
Overview
Every endpoint shares the same envelope — only model and the input fields change. Run any from the Models Market playground.
Authentication
Create an API key at /api-keys, then send it as a Bearer token. Requests from the browser while logged in also work via the session cookie.
Authorization: Bearer <YOUR_API_KEY>Create Task
POST https://api.lithovas.com/api/generateBody: { "model": "<slug>", "input": { … } }
Response: { "taskId": "<id>", "state": "waiting" }
Query Result
GET https://api.lithovas.com/api/generate/<taskId>Response: { "taskId", "state": "waiting" | "success" | "fail", "resultUrls": [ … ], "creditsConsumed", "failMsg", "balance" }
state becomes success or fail. Failed tasks are not billed.Endpoints
| Model | 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-imagepromptstringrequiredText description of the image to generate
aspect_ratioenum<string>requiredWidth-height ratio determining visual form
qualityenum<string>requiredMedium 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>requiredInput image file URLs (max 16 URLs)
promptstringrequiredText description of desired image generation or edit
aspect_ratioenum<string>requiredWidth-height ratio of the image
qualityenum<string>requiredQuality: 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-imagepromptstringrequiredText 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-imagepromptstringrequiredText prompt for image generation, up to 20000 characters
input_urlsarray<string>requiredArray 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"
}
}'