Skip to main content
GET
/
vendors
/
openai
/
v1
/
sora
/
generation
/
{task_id}
Get Sora Video Generation Task
curl --request GET \
  --url https://api.mulerun.com/vendors/openai/v1/sora/generation/{task_id} \
  --header 'Authorization: Bearer <token>'
{
  "task_info": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "status": "completed",
    "created_at": "2025-09-21T00:00:00.000Z",
    "updated_at": "2025-09-21T00:00:00.000Z"
  },
  "videos": [
    "https://mulerouter.muleusercontent.com/public/123e4567-e89b-12d3-a456-426614174000/video.mp4"
  ]
}
This API retrieves the status and result of a Sora video generation task. Video generation is asynchronous and may take several minutes to complete.

Response Status

The status field in the response indicates the current state of the task:
  • pending: Task is queued and waiting to be processed
  • processing: Task is currently being executed
  • completed: Task completed successfully, video URLs are available
  • failed: Task failed, error details are provided

Generation Time

Depending on the model, API load, and resolution, a single render may take several minutes:
  • sora-2: Typically faster, 2-5 minutes

Video Retention

Download URLs are valid for a maximum of 1 hour after generation. If you need long-term storage, copy the file to your own storage system promptly.

Response Examples

Completed Task

{
  "task_info": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "status": "completed",
    "created_at": "2025-09-21T00:00:00Z",
    "updated_at": "2025-09-21T00:05:30Z"
  },
  "videos": [
    "https://mulerouter.muleusercontent.com/public/123e4567-e89b-12d3-a456-426614174000/video.mp4"
  ]
}

Processing Task

{
  "task_info": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "status": "processing",
    "created_at": "2025-09-21T00:00:00Z",
    "updated_at": "2025-09-21T00:02:00Z"
  }
}

Failed Task

{
  "task_info": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "status": "failed",
    "created_at": "2025-09-21T00:00:00Z",
    "updated_at": "2025-09-21T00:01:30Z",
    "error": {
      "code": 3001,
      "title": "Task Execution Error",
      "detail": "Video generation failed: Prompt contains restricted content"
    }
  }
}

Polling Recommendations

Since video generation is a long-running operation:
  1. Poll the task status every 10-20 seconds
  2. Use exponential backoff if necessary to reduce API load
  3. Maximum generation time can be up to 10 minutes for high-quality renders
  4. Provide feedback to users that the job is still in progress

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

task_id
string<uuid>
required

Response

200 - application/json

Task completed successfully

task_info
object
videos
string<uri>[]

URL of the generated video

Example:
[
"https://mulerouter.muleusercontent.com/public/123e4567-e89b-12d3-a456-426614174000/video.mp4"
]