メインコンテンツへスキップ

概要

video、image、music、3D generation などのタスクタイプ全体で統一された async ポーリングを行うには、このエンドポイントを使用します。
create レスポンスに poll_url が含まれている場合は、その完全に一致するパスを呼び出してください。新しい async ワークフローでは、poll_url/v1/tasks/{taskId} を指す場合があります。

パスパラメータ

taskId
string
必須
create リクエストによって返されるタスク ID。

レスポンス

id
string
タスク識別子。
status
string
pendingprocessingcompleted、または failed などのタスクステータス。
video_url
string
タスクが完了して video を生成した場合の結果アセット URL。
error
string
タスクが失敗した場合のエラーメッセージ。

cURL
curl "https://api.lemondata.cc/v1/tasks/video_abc123" \
  -H "Authorization: Bearer sk-your-api-key"
Python
import requests

poll_url = "/v1/tasks/video_abc123"
response = requests.get(
    f"https://api.lemondata.cc{poll_url}",
    headers={"Authorization": "Bearer sk-your-api-key"},
)
print(response.json())
JavaScript
const pollUrl = '/v1/tasks/video_abc123';
const response = await fetch(`https://api.lemondata.cc${pollUrl}`, {
  headers: { Authorization: 'Bearer sk-your-api-key' },
});
console.log(await response.json());