Sora 2 Text To Video API Documentation¶
Generate content using the Sora 2 Text To Video model Generate content using the Sora 2 Image To Video model Generate content using the Sora 2 pro Text To Video model Generate content using the Sora 2 pro Image To Video model Pricing: min 50 credits per video
Overview¶
This document describes how to use the Sora 2 ( Pro) Text/Image To Video model for content generation. The process consists of two steps:
-
Create a generation task
-
Query task status and results
Authentication¶
All API requests require a Bearer Token in the request header:
x-api-key: YOUR_API_KEY
Get API Key:
- Visit API Key to get your API Key
- Add to request header:
x-api-key: Your_API_Key
1. Create Generation Task¶
API Information¶
- URL:
POST https://api.revidapi.com/paid/sora2/create - Header:
x-api-key: Your_API_Key
Request Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model name, format: sora-2-text-to-video |
| input | object | Yes | Input parameters object |
| callBackUrl | string | No | Callback URL for task completion notifications. If provided, the system will send POST requests to this URL when the task completes (success or fail). If not provided, no callback notifications will be sent. Example: "https://your-domain.com/api/callback" |
Model Parameter¶
The model parameter specifies which AI model to use for content generation.
| Model | Pricing credit | Description |
|---|---|---|
sora-2-text-to-video |
•50 credit per 10s •60credit per 15s |
The exact model identifier for this API |
sora-2-image-to-video |
•50 credit per 10s •60credit per 15s |
The exact model identifier for this API |
sora-2-pro-text-to-video |
•200 credit per 10s •350 credit per 15s |
size: standard |
sora-2-pro-text-to-video |
•500 credit per 10s • 790 credit per 15s |
size: high |
sora-2-pro-image-to-video |
•200 credit per 10s •350 credit per 15s |
size: standard |
sora-2-pro-image-to-video |
•500 credit per 10s • 790 credit per 15s |
size: high |
sora-watermark-remover |
•20 credit | The exact model identifier for this API |
sora-2-pro-storyboard |
•250 credit per 10s •350 credit per 15s` |
The exact model identifier for this API |
Note: The model parameter must match exactly as shown above. Different models have different capabilities and parameter requirements.
Callback URL Parameter¶
The callBackUrl parameter allows you to receive automatic notifications when your task completes.
| Property | Value | Description |
|---|---|---|
| Purpose | Task completion notification | Receive real-time updates when your task finishes |
| Method | POST request | The system sends POST requests to your callback URL |
| Timing | When task completes | Notifications sent for both success and failure states |
| Content | Query Task API response | Callback content structure is identical to the Query Task API response |
| Parameters | Complete request data | The param field contains the complete Create Task request parameters, not just the input section |
| Optional | Yes | If not provided, no callback notifications will be sent |
Important Notes:
- The callback content structure is identical to the Query Task API response
- The param field contains the complete Create Task request parameters, not just the input section
- If callBackUrl is not provided, no callback notifications will be sent
input Object Parameters¶
prompt¶
- Type:
string - Required: Yes
- Description: The text prompt describing the desired video motion
- Max Length: 10000 characters
- Default Value:
"A professor stands at the front of a lively classroom, enthusiastically giving a lecture. On the blackboard behind him are colorful chalk diagrams. With an animated gesture, he declares to the students: “Sora 2 is now available on Revid API, making it easier than ever to create stunning videos.” The students listen attentively, some smiling and taking notes."
aspect_ratio¶
- Type:
string - Required: No
- Description: This parameter defines the aspect ratio of the image.
- Options:
portrait: Portraitlandscape: Landscape- Default Value:
"landscape"
n_frames¶
- Type:
string - Required: No
- Description: The number of frames to be generated.
- Options:
10: 10s15: 15s- Default Value:
"10"
remove_watermark¶
- Type:
boolean - Required: No
- Description: When enabled, removes watermarks from the generated video.
- Default Value:
true
Request Example¶
{
"model": "sora-2-text-to-video",
"input": {
"prompt": "A professor stands at the front of a lively classroom, enthusiastically giving a lecture. On the blackboard behind him are colorful chalk diagrams. With an animated gesture, he declares to the students: “Sora 2 is now available on Revid API, making it easier than ever to create stunning videos.” The students listen attentively, some smiling and taking notes.",
"aspect_ratio": "landscape",
"n_frames": "10",
"remove_watermark": true
}
}
Response Example¶
{
"code": 200,
"msg": "success",
"data": {
"taskId": "281e5b0*********************f39b9"
}
}
Response Parameters¶
| Parameter | Type | Description |
|---|---|---|
| code | integer | Response status code, 200 indicates success |
| msg | string | Response message |
| data.taskId | string | Task ID for querying task status |
2. Query Task Status¶
API Information¶
- URL:
POST https://api.revidapi.com/paid/get/taskid - Parameter:
taskId(passed via URL parameter)
Request Example¶
POST https://api.revidapi.com/paid/get/taskid?taskId=281e5b0*********************f39b9
Response Example¶
{
"code": 200,
"msg": "success",
"data": {
"taskId": "281e5b0*********************f39b9",
"model": "sora-2-text-to-video",
"state": "waiting",
"param": "{\"model\":\"sora-2-text-to-video\",\"input\":{\"prompt\":\"A professor stands at the front of a lively classroom, enthusiastically giving a lecture. On the blackboard behind him are colorful chalk diagrams. With an animated gesture, he declares to the students: “Sora 2 is now available on Revid API, making it easier than ever to create stunning videos.” The students listen attentively, some smiling and taking notes.\",\"aspect_ratio\":\"landscape\",\"n_frames\":\"10\",\"remove_watermark\":true}}",
"resultJson": "{\"resultUrls\":[\"https://file.aiquickdraw.com/custom-page/akr/section-images/1759432328669pkhobl0t.mp4\"]}",
"failCode": null,
"failMsg": null,
"costTime": null,
"completeTime": null,
"createTime": 1757584164490
}
}
Response Parameters¶
| Parameter | Type | Description |
|---|---|---|
| code | integer | Response status code, 200 indicates success |
| msg | string | Response message |
| data.taskId | string | Task ID |
| data.model | string | Model name used |
| data.state | string | Task status: waiting(waiting), success(success), fail(fail) |
| data.param | string | Task parameters (JSON string) |
| data.resultJson | string | Task result (JSON string, available when task is success). Structure depends on outputMediaType: {resultUrls: []} for image/media/video, {resultObject: {}} for text |
| data.failCode | string | Failure code (available when task fails) |
| data.failMsg | string | Failure message (available when task fails) |
| data.costTime | integer | Task duration in milliseconds (available when task is success) |
| data.completeTime | integer | Completion timestamp (available when task is success) |
| data.createTime | integer | Creation timestamp |
Usage Flow¶
- Create Task: Call
POST https://api.revidapi.com/paid/sora2/createto create a generation task - Get Task ID: Extract
taskIdfrom the response - Wait for Results:
- If you provided a
callBackUrl, wait for the callback notification - If no
callBackUrl, poll status by callingPOST https://api.revidapi.com/paid/get/taskid - Get Results: When
stateissuccess, extract generation results fromresultJson
Error Codes¶
| Status Code | Description |
|---|---|
| 200 | Request successful |
| 400 | Invalid request parameters |
| 401 | Authentication failed, please check API Key |
| 402 | Insufficient account balance |
| 404 | Resource not found |
| 422 | Parameter validation failed |
| 429 | Request rate limit exceeded |
| 500 | Internal server error |