Tác vụ
Lấy một task Runway
Truy xuất trạng thái task hình ảnh, video hoặc âm thanh và các URL đầu ra cho yêu cầu Runway thông qua CometAPI.
GET
/
runwayml
/
v1
/
tasks
/
{id}
cURL
TASK_ID="<task_id>"
curl "https://api.cometapi.com/runwayml/v1/tasks/$TASK_ID" \
--header "Authorization: Bearer $COMETAPI_KEY"import os
import requests
task_id = "<task_id>"
response = requests.get(
f"https://api.cometapi.com/runwayml/v1/tasks/{task_id}",
headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
timeout=60,
)
response.raise_for_status()
print(response.json())
const taskId = "<task_id>";
const response = await fetch(
`https://api.cometapi.com/runwayml/v1/tasks/${taskId}`,
{ headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` } },
);
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/runwayml/v1/tasks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.cometapi.com/runwayml/v1/tasks/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.cometapi.com/runwayml/v1/tasks/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/runwayml/v1/tasks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "00000000-0000-4000-8000-000000000001"
}Sử dụng endpoint này với
Một task vừa được gửi có thể tạm thời trả về HTTP
id được trả về bởi bất kỳ yêu cầu tạo /runwayml/v1 nào
Yêu cầu. Xác thực bằng khóa API CometAPI từ cùng tài khoản đã
tạo task.
Theo dõi trạng thái task
Phản hồi là một đối tượng task. Đọc trực tiếpid, status và output
từ phản hồi, không qua lớp bao data.
status | Bước tiếp theo |
|---|---|
Thiếu, PENDING, hoặc THROTTLED | Đợi vài giây rồi yêu cầu lại task. |
RUNNING | Tiếp tục thăm dò. progress, khi có, là một phân số từ 0 đến 1. |
SUCCEEDED | Đọc các URL kết quả từ output. |
FAILED | Ngừng thăm dò và kiểm tra failure cùng failureCode, khi có. |
CANCELLED | Ngừng thăm dò; task đã bị hủy. |
400 với
code: "task_not_exist". Đợi vài giây rồi thử lại bằng chính id đó.
Nếu tình trạng này tiếp diễn, hãy kiểm tra ID task và tài khoản dùng để xác thực.
Không gửi lại yêu cầu tạo chỉ để kiểm tra trạng thái của nó.
Lưu trữ đầu ra
Mảngoutput chứa các URL hình ảnh, video hoặc âm thanh theo
endpoint tạo và định dạng đã chọn. Hãy tải xuống các tài sản đã hoàn tất ngay
và lưu chúng trong kho lưu trữ của riêng bạn. Các URL kết quả là tạm thời.
Đối với một integration mới, hãy chọn model và endpoint tạo trong phần tổng quan
Runway.Phản hồi
Task details. Fields vary with the task state.
Lần sửa đổi cuối 21 tháng 9, 2026
⌘I
cURL
TASK_ID="<task_id>"
curl "https://api.cometapi.com/runwayml/v1/tasks/$TASK_ID" \
--header "Authorization: Bearer $COMETAPI_KEY"import os
import requests
task_id = "<task_id>"
response = requests.get(
f"https://api.cometapi.com/runwayml/v1/tasks/{task_id}",
headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
timeout=60,
)
response.raise_for_status()
print(response.json())
const taskId = "<task_id>";
const response = await fetch(
`https://api.cometapi.com/runwayml/v1/tasks/${taskId}`,
{ headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` } },
);
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/runwayml/v1/tasks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.cometapi.com/runwayml/v1/tasks/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.cometapi.com/runwayml/v1/tasks/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/runwayml/v1/tasks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "00000000-0000-4000-8000-000000000001"
}