AI Studio API
Task status
Poll a generation task and handle queued, running, succeeded, and failed states.
API playground
Send a real request to this site and inspect the HTTP response immediately.
Response
Send a request to view its response here.任務進度狀態
這些狀態告訴你你的任務是正在等待、運行、完成還是失敗。
queuedrunningsucceededfailedGET
/api/ai-studio/tasks/{taskId}在創建返回 taskId 並且 statusSupported=true 後,檢查任務進度。
請求標頭
Authorization: Bearer YOUR_API_KEY請求參數
| 名稱 | 類型 | 必填 | 預設 | 選項 | 描述 |
|---|---|---|---|---|---|
| taskId | string | 是 | - | - | 啟動生成後返回的任務 ID。 |
請求
curl -X GET "https://freesoragenerator.com/api/ai-studio/tasks/provider-task-id" \
-H "Authorization: Bearer YOUR_API_KEY"回應範例
{
"success": true,
"data": {
"generationId": "b6a7f5c4-8a7c-4e2b-8cf6-6b8d9b3d8d21",
"taskId": "provider-task-id",
"modelId": "video:sora2-text-to-video-standard",
"state": "running",
"mediaUrls": [],
"raw": {},
"reservedCredits": 20,
"refundedCredits": 0
}
}錯誤範例
{
"success": false,
"error": "Generation record not found"
}