マーケットサポート← アプリに戻る

Flux-2

Flux-2 モデルは統一された非同期ジョブ API で呼び出します。POST /api/generate でタスクを開始し、完了するまで GET /api/generate/{taskId} をポーリングします。このファミリーは 4 個のエンドポイントを提供します。

概要

すべてのエンドポイントは同じ外枠を共有し、変わるのは modelinput フィールドだけです。モデルマーケットの playground から任意に実行できます。

認証

/api-keys で API キーを作成し、Bearer トークンとして送信します。ログイン中のブラウザからのリクエストはセッション cookie 経由でも動作します。

Authorization: Bearer <YOUR_API_KEY>

タスクの作成

POST
POST https://api.lithovas.com/api/generate

ボディ:{ "model": "<slug>", "input": { … } }

レスポンス:{ "taskId": "<id>", "state": "waiting" }

結果の照会

GET
GET https://api.lithovas.com/api/generate/<taskId>

レスポンス:{ "taskId", "state": "waiting" | "success" | "fail", "resultUrls": [ … ], "creditsConsumed", "failMsg", "balance" }

非同期
タスク作成の 200 は、タスクが受理されたことを意味するだけで、完了ではありません。statesuccess または fail になるまでこのエンドポイントをポーリングしてください。失敗したタスクは課金されません。

エンドポイント

モデルタスクmodel slug
ProImage to Imageflux2/pro-image-to-image
ProText to Imageflux2/pro-text-to-image
FlexImage to Imageflux2/flex-image-to-image
FlexText to Imageflux2/flex-text-to-image

Pro · Image to Image

POSTImage to Imageflux2/pro-image-to-image
input フィールド
input_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
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

POSTText to Imageflux2/pro-text-to-image
input フィールド
promptstring必須

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
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

POSTImage to Imageflux2/flex-image-to-image
input フィールド
input_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
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

POSTText to Imageflux2/flex-text-to-image
input フィールド
promptstring必須

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
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
  }
}'