İçeriğe geç
API Referansı
API Referansı

LTX Video Metinden Videoya

LTX 2.5 Fast veya Pro ile metinden video oluşturun.

01

Genel Bakış

Metinden videoya uç noktasını desteklenen bir modelle kullanın. Durumunu almak için döndürülen Görev Kimliğini kullanın veya aşağıda belgelenen teslimler için callback_url sağlayın.

Hızlı başlangıç

  1. Bir API anahtarı oluşturun ve RUNAPI_API_KEY olarak ayarlayın.
  2. Desteklenen bir model seçin ve gövdesi o modelin şemasıyla eşleşen bir POST isteği gönderin.
  3. Döndürülen görev kimliğini saklayın, ardından bir terminal durumuna ulaşana kadar yoklama yapın ya da aşağıda belgelenen geri çağırmaları işleyin.

Uç Nokta

POST /api/v1/ltx_video/text_to_video
Temel URL
https://runapi.ai
API sürümü
v1
Kimlik doğrulama
Authorization: Bearer YOUR_API_TOKEN
02

Desteklenen modeller

Güncel fiyatlandırma, hız sınırları ve ticari kullanım ayrıntıları için bir model sayfası açın.

03

İstek şeması

JSON gövdesi

Alanlar ve izin verilen değerler seçili modele göre değişir. Sağlandığında, callback_url aşağıda belgelenen Görev teslimatlarını alır.

ltx-2.5-fast-text-to-video8 alan
aspect_ratiostring
İsteğe bağlı

Çıkış videosunun en boy oranı.

İzin verilen değerler: 16:9, 9:16, 1:1, 3:2, 2:3 Varsayılan: 16:9
callback_urlstring
İsteğe bağlı

Görevin nihai sonucunu almak için RunAPI geri çağırma URL'si.

duration_secondsinteger
İsteğe bağlı

Saniye cinsinden çıktı süresi. Fast için 1440p veya 48/50 fps en fazla 10 saniye ile sınırlıdır.

İzin verilen değerler: 6, 8, 10, 12, 14, 16, 18, 20 Varsayılan: 10
fpsinteger
İsteğe bağlı

Saniyedeki kare sayısı. 48/50 fps en fazla 10 saniye ile sınırlıdır. Kare hızı, saniye başına fiyatı etkilemez.

İzin verilen değerler: 24, 25, 48, 50 Varsayılan: 24
modelstring
Zorunlu

LTX 2.5 model tanımlayıcısı.

output_resolutionstring
İsteğe bağlı

Çıktı videosunun çözünürlüğü. Fast için 1440p en fazla 10 saniye ile sınırlıdır.

İzin verilen değerler: 720p, 1080p, 1440p Varsayılan: 1080p
promptstring
Zorunlu

1 ile 5,000 karakter arasında video açıklaması.

Aralık: 1 - 5000
seedinteger
İsteğe bağlı

İsteğe bağlı rastgele seed.

Aralık: 0 - 2147483647
ltx-2.5-pro-text-to-video8 alan
aspect_ratiostring
İsteğe bağlı

Çıkış videosunun en boy oranı.

İzin verilen değerler: 16:9, 9:16, 1:1, 3:2, 2:3 Varsayılan: 16:9
callback_urlstring
İsteğe bağlı

Görevin nihai sonucunu almak için RunAPI geri çağırma URL'si.

duration_secondsinteger
İsteğe bağlı

Saniye cinsinden çıktı süresi; Pro için en fazla 10 saniye.

İzin verilen değerler: 6, 8, 10 Varsayılan: 10
fpsinteger
İsteğe bağlı

Saniyedeki kare sayısı. 48/50 fps en fazla 10 saniye ile sınırlıdır. Kare hızı, saniye başına fiyatı etkilemez.

İzin verilen değerler: 24, 25, 48, 50 Varsayılan: 24
modelstring
Zorunlu

LTX 2.5 model tanımlayıcısı.

output_resolutionstring
İsteğe bağlı

Çıktı video çözünürlüğü.

İzin verilen değerler: 720p, 1080p Varsayılan: 1080p
promptstring
Zorunlu

1 ile 5,000 karakter arasında video açıklaması.

Aralık: 1 - 5000
seedinteger
İsteğe bağlı

İsteğe bağlı rastgele seed.

Aralık: 0 - 2147483647

Koşullu kurallar

Bu gereksinimler, listelenen tüm koşulların eşleştiği durumlarda uygulanır.

  1. Şu durumlarda model = ltx-2.5-fast-text-to-video
    Gerekli
    Kabul edilmez
    source_image_url, source_audio_url
  2. Şu durumlarda model = ltx-2.5-pro-text-to-video
    Gerekli
    Kabul edilmez
    source_image_url, source_audio_url
04

Kabul oluştur

HTTP 202

POST /api/v1/ltx_video/text_to_video

Yanıt şeması
JSON
{
  "properties": {
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "processing"
      ],
      "type": "string"
    },
    "task_replayed": {
      "type": "boolean"
    }
  },
  "required": [
    "id",
    "status"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "id": "tsk_reference_demo",
  "status": "processing"
}
05

Yoklama işleniyor

HTTP 200

GET /api/v1/ltx_video/text_to_video/:id

Yanıt şeması
JSON
{
  "properties": {
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "processing"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "id": "tsk_reference_demo",
  "status": "processing"
}
06

Yoklama tamamlandı

HTTP 200

GET /api/v1/ltx_video/text_to_video/:id

Yanıt şeması
JSON
{
  "properties": {
    "first_frame_image_url": {
      "type": "string",
      "x-runapi-generated-media": true
    },
    "id": {
      "type": "string"
    },
    "last_frame_image_url": {
      "type": "string",
      "x-runapi-generated-media": true
    },
    "status": {
      "enum": [
        "completed"
      ],
      "type": "string"
    },
    "usage": {
      "properties": {
        "cost": {
          "type": "number"
        }
      },
      "required": [
        "cost"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "videos": {
      "items": {
        "properties": {
          "url": {
            "type": "string",
            "x-runapi-generated-media": true
          }
        },
        "required": [
          "url"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    }
  },
  "required": [
    "id",
    "status",
    "videos",
    "usage"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "id": "tsk_reference_demo",
  "status": "completed",
  "usage": {
    "cost": 0.05
  },
  "videos": [
    {
      "url": "https://file.runapi.ai/reference-video.mp4"
    }
  ]
}
07

Yoklama başarısız oldu

HTTP 200

GET /api/v1/ltx_video/text_to_video/:id

Yanıt şeması
JSON
{
  "properties": {
    "error": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "failed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "error": "Task processing failed.",
  "id": "tsk_reference_demo",
  "status": "failed"
}
08

Müşteri geri çağırması: tamamlandı

HTTP 200

POST callback_url

Yanıt şeması
JSON
{
  "properties": {
    "first_frame_image_url": {
      "type": "string",
      "x-runapi-generated-media": true
    },
    "id": {
      "type": "string"
    },
    "last_frame_image_url": {
      "type": "string",
      "x-runapi-generated-media": true
    },
    "status": {
      "enum": [
        "completed"
      ],
      "type": "string"
    },
    "usage": {
      "properties": {
        "cost": {
          "type": "number"
        }
      },
      "required": [
        "cost"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "videos": {
      "items": {
        "properties": {
          "url": {
            "type": "string",
            "x-runapi-generated-media": true
          }
        },
        "required": [
          "url"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    }
  },
  "required": [
    "id",
    "status",
    "videos",
    "usage"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "id": "tsk_reference_demo",
  "status": "completed",
  "usage": {
    "cost": 0.05
  },
  "videos": [
    {
      "url": "https://file.runapi.ai/reference-video.mp4"
    }
  ]
}
09

Müşteri geri çağırması: başarısız oldu

HTTP 200

POST callback_url

Yanıt şeması
JSON
{
  "properties": {
    "error": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "properties": {
            "code": {
              "type": "string"
            },
            "limit_cents": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            },
            "reset_at": {
              "format": "date-time",
              "type": [
                "string",
                "null"
              ]
            },
            "used_cents": {
              "type": "integer"
            },
            "window": {
              "enum": [
                "1h",
                "1d",
                "7d",
                "daily",
                "weekly",
                "monthly",
                "lifetime"
              ],
              "type": "string"
            }
          },
          "required": [
            "code",
            "message"
          ],
          "type": "object",
          "unevaluatedProperties": false
        }
      ]
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "failed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "error": {
    "code": "generation_failed",
    "message": "Task processing failed."
  },
  "id": "tsk_reference_demo",
  "status": "failed"
}
10

Hatalar

HTTP 401

POST /api/v1/ltx_video/text_to_video

Yanıt şeması
JSON
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "error": "Authentication required"
}
11

Hatalar

HTTP 401

GET /api/v1/ltx_video/text_to_video/:id

Yanıt şeması
JSON
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "error": "Authentication required"
}
12

Hatalar

HTTP 400

POST /api/v1/ltx_video/text_to_video

Yanıt şeması
JSON
{
  "oneOf": [
    {
      "properties": {
        "error": {
          "description": "İnsan tarafından okunabilir hata mesajı.",
          "type": "string"
        }
      },
      "required": [
        "error"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    {
      "properties": {
        "error": {
          "description": "İnsan tarafından okunabilir doğrulama özeti.",
          "type": "string"
        },
        "errors": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "Herkese açık istek alanına göre anahtarlanan doğrulama mesajları; her alan için insan tarafından okunabilir dizelerden oluşan bir dizi içerir.",
          "type": "object"
        }
      },
      "required": [
        "error",
        "errors"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  ]
}

Yanıt örneği

JSON
{
  "error": "model must be one of: ltx-2.5-fast-text-to-video, ltx-2.5-pro-text-to-video"
}
13

Hatalar

HTTP 402

POST /api/v1/ltx_video/text_to_video

Yanıt şeması
JSON
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "error": "Insufficient balance"
}
14

Hatalar

HTTP 429

POST /api/v1/ltx_video/text_to_video

Yanıt şeması
JSON
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "error": "API key credit limit exceeded"
}
15

Hatalar

HTTP 409

POST /api/v1/ltx_video/text_to_video

Yanıt şeması
JSON
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "error": "The request uses features that are not supported for the selected model"
}
16

Hatalar

HTTP 429

POST /api/v1/ltx_video/text_to_video

Yanıt şeması
JSON
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "error": "Rate limit reached. Please retry later."
}
17

Hatalar

HTTP 503

POST /api/v1/ltx_video/text_to_video

Yanıt şeması
JSON
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "error": "Service under maintenance, please try again later"
}
18

Hatalar

HTTP 503

POST /api/v1/ltx_video/text_to_video

Yanıt şeması
JSON
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "error": "The request timed out"
}
19

Hatalar

HTTP 404

GET /api/v1/ltx_video/text_to_video/:id

Yanıt şeması
JSON
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "error": "Task with id 'tsk_reference_demo' not found"
}
20

Oluşturulan Kod Örnekleri

Doğrudan cURL kullanın veya diliniz için bir SDK yükleyin. Her örnek, bu başvuruda gösterilen doğrulanmış isteği gönderir.

Yükle

Shell
pip install runapi-ltx-video
PYTHON
import os
from runapi.ltx_video import LtxVideoClient

client = LtxVideoClient(api_key=os.environ["RUNAPI_API_KEY"])
task = client.text_to_video.create(
  model="ltx-2.5-fast-text-to-video",
  prompt="A cinematic walk through a quiet city.",
  output_resolution="720p",
  duration_seconds=6,
  fps=24,
  aspect_ratio="16:9"
)