Flux-2
Flux-2 モデルは統一された非同期ジョブ API で呼び出します。POST /api/generate でタスクを開始し、完了するまで GET /api/generate/{taskId} をポーリングします。このファミリーは 4 個のエンドポイントを提供します。
概要
すべてのエンドポイントは同じ外枠を共有し、変わるのは model と input フィールドだけです。モデルマーケットの playground から任意に実行できます。
認証
/api-keys で API キーを作成し、Bearer トークンとして送信します。ログイン中のブラウザからのリクエストはセッション cookie 経由でも動作します。
Authorization: Bearer <YOUR_API_KEY>タスクの作成
POST https://api.lithovas.com/api/generateボディ:{ "model": "<slug>", "input": { … } }
レスポンス:{ "taskId": "<id>", "state": "waiting" }
結果の照会
GET https://api.lithovas.com/api/generate/<taskId>レスポンス:{ "taskId", "state": "waiting" | "success" | "fail", "resultUrls": [ … ], "creditsConsumed", "failMsg", "balance" }
state が success または fail になるまでこのエンドポイントをポーリングしてください。失敗したタスクは課金されません。エンドポイント
Pro · Image to Image
flux2/pro-image-to-imageinput_urlsarray<string>必須Reference images (1-8), max 10MB each, JPEG/PNG/WebP formats
promptstring必須Text description (3-5000 characters) guiding the generation
aspect_ratiostring必須Output image proportions; 'auto' matches first input image
resolutionstring必須Output image resolution level
nsfw_checkerboolean任意Content 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-imagepromptstring必須Generation prompt, must be between 3 and 5000 characters
aspect_ratioenum<string>必須Aspect ratio for generated image
resolutionenum<string>必須Output image resolution
nsfw_checkerboolean任意Disable 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>必須Input reference images (1-8), file URLs after upload
promptstring必須Text description of desired modifications; 3-5000 characters
aspect_ratioenum<string>必須Output image aspect ratio; auto matches first input
resolutionenum<string>必須Output 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-imagepromptstring必須Generation prompt, length must be between 3-5000 characters
aspect_ratioenum<string>必須Aspect ratio of the generated image
resolutionenum<string>必須Output image resolution
nsfw_checkerboolean任意Disable 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
}
}'