Videolar
Bir Runway metinden videoya görevi oluşturun
CometAPI aracılığıyla Runway Gen-4.5 ile bir metin Prompt’undan video oluşturun.
POST
/
runwayml
/
v1
/
text_to_video
cURL
curl "https://api.cometapi.com/runwayml/v1/text_to_video" \
--request POST \
--header "Authorization: Bearer $COMETAPI_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "gen4.5",
"promptText": "A paper boat drifts on calm water at sunrise.",
"ratio": "1280:720",
"duration": 5
}'
import os
import requests
payload = {'model': 'gen4.5',
'promptText': 'A paper boat drifts on calm water at sunrise.',
'ratio': '1280:720',
'duration': 5}
response = requests.post(
"https://api.cometapi.com/runwayml/v1/text_to_video",
headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
json=payload,
timeout=60,
)
response.raise_for_status()
print(response.json()["id"])
const payload = {
"model": "gen4.5",
"promptText": "A paper boat drifts on calm water at sunrise.",
"ratio": "1280:720",
"duration": 5
};
const response = await fetch(
"https://api.cometapi.com/runwayml/v1/text_to_video",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
},
);
if (!response.ok) throw new Error(await response.text());
console.log((await response.json()).id);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/runwayml/v1/text_to_video",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'gen4.5',
'promptText' => 'A paper boat drifts on calm water at sunrise.',
'ratio' => '1280:720',
'duration' => 5
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cometapi.com/runwayml/v1/text_to_video"
payload := strings.NewReader("{\n \"model\": \"gen4.5\",\n \"promptText\": \"A paper boat drifts on calm water at sunrise.\",\n \"ratio\": \"1280:720\",\n \"duration\": 5\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cometapi.com/runwayml/v1/text_to_video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gen4.5\",\n \"promptText\": \"A paper boat drifts on calm water at sunrise.\",\n \"ratio\": \"1280:720\",\n \"duration\": 5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/runwayml/v1/text_to_video")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"gen4.5\",\n \"promptText\": \"A paper boat drifts on calm water at sunrise.\",\n \"ratio\": \"1280:720\",\n \"duration\": 5\n}"
response = http.request(request)
puts response.read_body{
"id": "00000000-0000-4000-8000-000000000001"
}{
"code": "<string>",
"message": "<string>",
"data": "<unknown>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}Bir metin Prompt’undan video oluşturmak için
gen4.5 kullanın. CometAPI API
anahtarınızı Bearer kimlik doğrulaması ve bir JSON istek gövdesiyle gönderin.
İsteği hazırlayın
modeldeğerinigen4.5olarak ayarlayın.promptTextiçinde sahneyi ve hareketi 1 ila 1.000 UTF-16 kod birimi kullanarak açıklayın.- Yatay için
ratiodeğerini1280:720olarak, dikey için ise720:1280olarak ayarlayın. durationdeğerini2ile10saniye arasında bir tam sayı olarak ayarlayın.
promptImage veya audio geçişi eklemeyin.
İsteğe bağlı denetimleri ayarlayın
Açık bir örnekleme seed’i için1 ile 4294967295 arasını kullanın. Atlanması veya 0
rastgele bir seed seçer. contentModeration eklerseniz, onun
publicFigureThreshold değerini auto ya da low olarak ayarlayın; aksi takdirde nesneyi atlayın.
MP4, ProRes, PNG dizilerini veya HDR biçimlerinden birini seçmek için outputFormat kullanın
istek şemasında listelenen biçimlerden birini seçin. H.264 MP4 için bunu atlayın. Şunu ayarlayabilirsiniz:
proresProfile yalnızca outputFormat değeri prores veya hdr_prores olduğunda.
HDR ProRes biçimi 422, 422 HQ veya 4444 kabul eder.
Sonucu alın
Döndürülenid değerini kaydedin ve şunu kullanın: Bir Runway görevi alın.
status değeri SUCCEEDED olduğunda, output içindeki video URL’lerini okuyun.Gövde
application/json
Request parameters for gen4.5.
Output encoding. Omit for mp4 (H.264). prores returns MOV; png_sequence returns a PNG ZIP; sdr_rec709_10bit returns 10-bit Rec.709 HEVC. hdr10 and hlg return 10-bit HDR MP4; hdr_pq_12bit_master returns 12-bit HEVC MOV; hdr_prores returns HDR ProRes MOV. The HDR PNG/EXR sequence formats return ZIP archives; the ACEScg variants target the named ACES version.
Mevcut seçenekler:
mp4, prores, png_sequence, hdr10, hlg, sdr_rec709_10bit, hdr_pq_12bit_master, hdr_prores, hdr_png_sequence, hdr_exr_sequence, hdr_exr_acescg_sequence_1_3, hdr_exr_acescg_sequence_2_0 Yanıt
Task submitted. Save its id to retrieve task status.
Son değiştirilme tarihi 21 Eylül 2026
⌘I
cURL
curl "https://api.cometapi.com/runwayml/v1/text_to_video" \
--request POST \
--header "Authorization: Bearer $COMETAPI_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "gen4.5",
"promptText": "A paper boat drifts on calm water at sunrise.",
"ratio": "1280:720",
"duration": 5
}'
import os
import requests
payload = {'model': 'gen4.5',
'promptText': 'A paper boat drifts on calm water at sunrise.',
'ratio': '1280:720',
'duration': 5}
response = requests.post(
"https://api.cometapi.com/runwayml/v1/text_to_video",
headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
json=payload,
timeout=60,
)
response.raise_for_status()
print(response.json()["id"])
const payload = {
"model": "gen4.5",
"promptText": "A paper boat drifts on calm water at sunrise.",
"ratio": "1280:720",
"duration": 5
};
const response = await fetch(
"https://api.cometapi.com/runwayml/v1/text_to_video",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
},
);
if (!response.ok) throw new Error(await response.text());
console.log((await response.json()).id);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/runwayml/v1/text_to_video",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'gen4.5',
'promptText' => 'A paper boat drifts on calm water at sunrise.',
'ratio' => '1280:720',
'duration' => 5
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cometapi.com/runwayml/v1/text_to_video"
payload := strings.NewReader("{\n \"model\": \"gen4.5\",\n \"promptText\": \"A paper boat drifts on calm water at sunrise.\",\n \"ratio\": \"1280:720\",\n \"duration\": 5\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cometapi.com/runwayml/v1/text_to_video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gen4.5\",\n \"promptText\": \"A paper boat drifts on calm water at sunrise.\",\n \"ratio\": \"1280:720\",\n \"duration\": 5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/runwayml/v1/text_to_video")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"gen4.5\",\n \"promptText\": \"A paper boat drifts on calm water at sunrise.\",\n \"ratio\": \"1280:720\",\n \"duration\": 5\n}"
response = http.request(request)
puts response.read_body{
"id": "00000000-0000-4000-8000-000000000001"
}{
"code": "<string>",
"message": "<string>",
"data": "<unknown>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}