curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "flux-3-video",
"prompt": "An orange cat jumps onto a sunlit wooden table, its tail brushes a glass that wobbles but does not fall. Cinematic, shallow depth of field.",
"duration": 5,
"resolution": "hd",
"aspect_ratio": "16:9"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "flux-3-video",
"prompt": "An orange cat jumps onto a sunlit wooden table, its tail brushes a glass that wobbles but does not fall. Cinematic, shallow depth of field.",
"duration": 5,
"resolution": "hd",
"aspect_ratio": "16:9",
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "flux-3-video",
prompt: "An orange cat jumps onto a sunlit wooden table, its tail brushes a glass that wobbles but does not fall. Cinematic, shallow depth of field.",
duration: 5,
resolution: "hd",
aspect_ratio: "16:9",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "flux-3-video",
"prompt": "An orange cat jumps onto a sunlit wooden table",
"duration": 5,
"resolution": "hd",
"aspect_ratio": "16:9",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "リクエストパラメータが無効です",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "認証に失敗しました、APIキーを確認してください",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "残高不足です、チャージしてから再試行してください",
"type": "payment_required"
}
}
{
"error": {
"code": 422,
"message": "パラメータの競合または無効な値です",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 429,
"message": "リクエストが多すぎます、しばらくしてから再試行してください",
"type": "rate_limit_error"
}
}
FLUX 3 Video
FLUX 3 動画生成
- 非同期処理モード、後続の照会用にタスク ID を返します
- 統一エントリ:テキストから動画 / 画像から動画 / 動画継続 / ドラフト二段階
- 出力は H.264 + AAC、同期音声付き、長さ 5~20 秒
- 解像度 hd / fhd、7 種類のアスペクト比
POST
/
v1
/
videos
/
generations
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "flux-3-video",
"prompt": "An orange cat jumps onto a sunlit wooden table, its tail brushes a glass that wobbles but does not fall. Cinematic, shallow depth of field.",
"duration": 5,
"resolution": "hd",
"aspect_ratio": "16:9"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "flux-3-video",
"prompt": "An orange cat jumps onto a sunlit wooden table, its tail brushes a glass that wobbles but does not fall. Cinematic, shallow depth of field.",
"duration": 5,
"resolution": "hd",
"aspect_ratio": "16:9",
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "flux-3-video",
prompt: "An orange cat jumps onto a sunlit wooden table, its tail brushes a glass that wobbles but does not fall. Cinematic, shallow depth of field.",
duration: 5,
resolution: "hd",
aspect_ratio: "16:9",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "flux-3-video",
"prompt": "An orange cat jumps onto a sunlit wooden table",
"duration": 5,
"resolution": "hd",
"aspect_ratio": "16:9",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "リクエストパラメータが無効です",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "認証に失敗しました、APIキーを確認してください",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "残高不足です、チャージしてから再試行してください",
"type": "payment_required"
}
}
{
"error": {
"code": 422,
"message": "パラメータの競合または無効な値です",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 429,
"message": "リクエストが多すぎます、しばらくしてから再試行してください",
"type": "rate_limit_error"
}
}
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "flux-3-video",
"prompt": "An orange cat jumps onto a sunlit wooden table, its tail brushes a glass that wobbles but does not fall. Cinematic, shallow depth of field.",
"duration": 5,
"resolution": "hd",
"aspect_ratio": "16:9"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "flux-3-video",
"prompt": "An orange cat jumps onto a sunlit wooden table, its tail brushes a glass that wobbles but does not fall. Cinematic, shallow depth of field.",
"duration": 5,
"resolution": "hd",
"aspect_ratio": "16:9",
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "flux-3-video",
prompt: "An orange cat jumps onto a sunlit wooden table, its tail brushes a glass that wobbles but does not fall. Cinematic, shallow depth of field.",
duration: 5,
resolution: "hd",
aspect_ratio: "16:9",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "flux-3-video",
"prompt": "An orange cat jumps onto a sunlit wooden table",
"duration": 5,
"resolution": "hd",
"aspect_ratio": "16:9",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "リクエストパラメータが無効です",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "認証に失敗しました、APIキーを確認してください",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "残高不足です、チャージしてから再試行してください",
"type": "payment_required"
}
}
{
"error": {
"code": 422,
"message": "パラメータの競合または無効な値です",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 429,
"message": "リクエストが多すぎます、しばらくしてから再試行してください",
"type": "rate_limit_error"
}
}
認証
string
必須
すべてのエンドポイントは Bearer Token 認証が必要ですAPI Key 管理ページ で API Key を取得してください:
Authorization: Bearer YOUR_API_KEY
生成モード
flux-3-video は統一エントリです。フィールドからモードを推定するか、mode で明示指定できます。
| モード | トリガー | 説明 |
|---|---|---|
| テキストから動画(t2v) | prompt のみ | 純粋なテキスト |
| 画像から動画(i2v) | image_urls | キーフレーム、下記参照 |
| 動画継続(v2v) | video_url / video_urls | 単価が高い。画像と動画の両方がある場合は継続が優先 |
| ドラフト → 本編 | draft:true または draft_from_task_id | 低価格プレビュー後、正規価格で本編 |
mode の値:t2v / i2v / v2v / draft_enhance、または公式表記 text-to-video / image-continuation / video-continuation。明示的な mode が最優先です。
画像から動画のキーフレーム意味
image_urls の順序が意味を持ちます — 並べ替えや重複排除をしないでください:
| 枚数 | 意味 |
|---|---|
| 1 | 開始フレーム |
| 2 | 1 枚目が開始、2 枚目が終了フレーム |
| 3~10 | 先頭が開始、末尾が終了、中間フレームは均等配置(duration を明示推奨) |
リクエストパラメータ
string
必須
固定値:
flux-3-videoboolean
デフォルト:"false"
動画タスクを送信する前にコンテンツモデレーションを実行するかどうかを指定します。
true:omni-moderation-latestでプロンプトと入力画像を審査falseまたは省略:審査リクエストを行わず、審査コストや遅延を追加しない(デフォルト)
string
必須
プロンプト。
draft_from_task_id 使用時は送信禁止(送信すると拒否されます)。integer
デフォルト:"5"
長さ(秒)、整数 5~20、デフォルト
5duration: "auto" は非対応です(課金に固定秒数が必要)。省略、"auto"、非整数 → エラーなく 5 秒として扱い、自動適応はしません。動画継続では、実際の出力がリクエスト秒数より短くなる場合があります(例:5 秒要求で 4 秒)。要求秒数で仮請求し、完了後に差分を返金します。最終金額は照会の
cost が基準です。テキスト/画像から動画ではこの差は出ません。string
デフォルト:"hd"
解像度
hd(デフォルト、720pも可)fhd(1080pも可)
hd は 16:9 で約 1280×704、fhd は約 1920×1088。ドラフトモード(
draft:true)は hd のみ許可。string
デフォルト:"auto"
アスペクト比選択肢:
21:9、2:1、16:9、4:3、1:1、3:4、9:16、または auto(デフォルト、プロンプトと素材から自動選択)string[]
画像から動画のキーフレーム、1~10、公開 http(s) URL または base64
string
継続用の入力動画(mp4、公開 URL または base64)
string[]
video_url と同じ、先頭の要素を使用(互換用)boolean
デフォルト:"true"
同期音声を生成、デフォルト
true。false は無音動画(値引きなし)boolean
デフォルト:"false"
ドラフトモード:約 1/3 価格の低品質プレビュー、
resolution: hd のみstring
ドラフト → 本編:自分の成功済みドラフトタスク ID
- 変更可能なのは
resolutionのみ、プロンプト・長さ・画像・動画は変更不可 - 本編の正規価格で課金、ドラフト料金は相殺されません
draft:trueと相互排他
integer
デフォルト:"2"
モデレーション許容度 0~4、デフォルト
2(大きいほど緩い)FLUX.2 画像(05)や Kontext(06)と混同しないでください。
string
明示モード(任意)、生成モードを参照
ドラフトモード
反復が高コストな場合の二段階ワークフロー:Step 1 draft:true → 約 1/3 価格の低品質プレビュー
Step 2 draft_from_task_id → ドラフト見た目に合わせた正規価格の本編
ドラフト作成
{
"model": "flux-3-video",
"prompt": "An orange cat jumps onto a sunlit wooden table",
"duration": 5,
"draft": true
}
ドラフトから本編
{
"model": "flux-3-video",
"draft_from_task_id": "task_01K_DRAFT...",
"resolution": "fhd"
}
リクエスト例
テキストから動画(縦向き)
{
"model": "flux-3-video",
"prompt": "Rainy Tokyo street at night, neon in puddles, a person walks with an umbrella.",
"duration": 8,
"resolution": "fhd",
"aspect_ratio": "9:16"
}
画像から動画(開始 + 終了フレーム)
{
"model": "flux-3-video",
"prompt": "Slow push-in as a flower opens from bud to bloom",
"image_urls": [
"https://example.com/bud.jpg",
"https://example.com/bloom.jpg"
],
"duration": 5
}
動画継続
{
"model": "flux-3-video",
"prompt": "Camera keeps following as the lead turns toward a distant lighthouse",
"video_url": "https://example.com/clip.mp4",
"duration": 5
}
無音動画
{
"model": "flux-3-video",
"prompt": "...",
"audio": false
}
制約
| 制限 | 値 |
|---|---|
| 長さ | 整数 5~20(auto 非対応、21 は拒否) |
| キーフレーム | 1~10 |
| 解像度 | hd / fhd のみ、ドラフトは hd のみ |
| アスペクト比 | 7 種類または auto |
safety_tolerance | 0~4 |
よくある送信エラー(通常は課金なし)
| ケース | 説明 |
|---|---|
prompt 欠落 | ドラフト本編化以外では必須 |
無効な resolution / aspect_ratio / duration | 範囲外 |
| キーフレーム > 10 | 上限超過 |
明示 i2v で画像なし / v2v で動画なし | モードと素材の不一致 |
draft:true + fhd | ドラフトは hd のみ |
無効 / 非ドラフト / 未完了の draft_from_task_id | 本編化の前提条件 |
| 本編化時に prompt / duration を変更 | resolution のみ変更可 |
draft と draft_from_task_id の両方 | 相互排他 |
failed 終了となり全額返金されます。
機能カバレッジ
| 機能 | 状態 |
|---|---|
| t2v / i2v / v2v | ✅ 自動または明示 mode |
| ドラフト / ドラフト本編化 | ✅ draft / draft_from_task_id |
| 同期音声 | ✅ デフォルトオン、audio:false でオフ(値引きなし) |
時刻付きキーフレーム [秒, 画像] | ❌ 均等配置のキーフレーム配列のみ |
duration: "auto" | ❌ 非対応 |
Response
integer
ステータスコード、成功時は 200
結果の照会動画生成は非同期です。タスク状態の取得 でポーリングしてください。推奨間隔 5~10 秒、クライアントタイムアウト 15 分(20 秒 fhd はより遅い)。実測
t2v + hd + 5 秒で約 60 秒。成功時は result.videos[0].url を使用。成果物はプラットフォーム CDN にミラーされます。cost が最終請求額です。失敗時は全額返金。