# OpenAI/Sora2-T2V-Pro

Text-to-video model

## Asynchronous Task Submission

### Endpoint

`https://api-us-ca.umodelverse.ai/v1/tasks/submit`

### Input

| Parameter           | Type   | Required | Description                                                                                                                                                       |
| :------------------ | :----- | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| model               | string | Yes      | Model name, which is `openai/sora-2/text-to-video-pro` in this case                                                                                               |
| input.prompt        | string | Yes      | Prompt text to guide video generation                                                                                                                             |
| parameters.size     | string | No       | Size of the generated video. <br>Available resolutions: <br>- `720x1280`<br>- `1280x720`<br>- `1024x1792`<br>- `1792x1024`<br>Default is `720x1280`               |
| parameters.duration | int    | No       | Duration of the generated video (seconds), optional values are `4`, `8`, `12`, default is `4`                                                                     |

### Request Example
⚠️ If you're using Windows, it's recommended to use Postman or other API calling tools.
```shell
curl --location --globoff 'https://api-us-ca.umodelverse.ai/v1/tasks/submit' \
--header 'Authorization: <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
    "model": "openai/sora-2/text-to-video-pro",
    "input": {
      "prompt": "A beautiful girl is dancing"
    },
    "parameters": {
      "size": "720x1280",
      "duration": 4
    }
  }'
```

### Output

| Parameter      | Type   | Description                   |
| :------------- | :----- | :---------------------------- |
| output.task_id | string | Unique identifier for the task |
| request_id     | string | Unique identifier for the request |

### Response Example

```json
{
  "output": {
    "task_id": "task_id"
  },
  "request_id": "request_id"
}
```

## Check Task Status

### Endpoint

`https://api-us-ca.umodelverse.ai/v1/tasks/status?task_id=<task_id>`

### Request Example

```shell
curl --location 'https://api-us-ca.umodelverse.ai/v1/tasks/status?task_id=<task_id>' \
--header 'Authorization: <YOUR_API_KEY>'
```

### Output

| Parameter            | Type    | Description                                             |
| :------------------- | :------ | :------------------------------------------------------ |
| output.task_id       | string  | Unique identifier for the task                          |
| output.task_status   | string  | Task status: `Pending`,`Running`,`Success`,`Failure`    |
| output.urls          | array   | List of URLs for the video results                      |
| output.submit_time   | integer | Task submission timestamp                               |
| output.finish_time   | integer | Task completion timestamp                               |
| output.error_message | string  | Error message returned in case of failure               |
| usage.duration       | integer | Duration of task execution (seconds)                    |
| request_id           | string  | Unique identifier for the request                       |

### Response Example

```json
{
  "output": {
    "task_id": "task_id",
    "task_status": "Success",
    "urls": ["https://xxxxx/xxxx.mp4"],
    "submit_time": 1756959000,
    "finish_time": 1756959050
  },
  "usage": {
    "duration": 4
  },
  "request_id": ""
}
```