Sora2 Text-to-Video
Generate high-quality videos from text descriptions using OpenAI's Sora2 model
Tool Overview
The Sora2 Text-to-Video tool uses OpenAI's Sora2 model to generate high-quality video content from text descriptions. It supports both Fast and Pro generation modes, as well as multiple video duration options.
Tool Identifier
sora2-text-to-video-api
Parameters
Required Parameters
prompt
- Type:
string(required) - Description: Text description of the video content to guide AI video generation
- Validation: Must be a non-empty string
- Example:
"A cinematic shot of a robot walking through a neon-lit cyberpunk city at night"
Optional Parameters
aspect_ratio
- Type:
string(optional) - Default:
"16:9" - Available Values:
"16:9","9:16" - Note: If an invalid value is provided, the default value will be used
mode
- Type:
string(optional) - Default:
"std" - Available Values:
"std","pro" - Note: Affects credit cost (std: 420 credits, pro: 2100 credits). If an invalid value is provided, the default value will be used
duration
- Type:
number(optional) - Default:
10 - Available Values:
10,15 - Unit: seconds
- Note: If an invalid value is provided, the default value will be used
Pricing
- Std Mode: 420 credits per task
- Pro Mode: 2100 credits per task
- Membership Requirement: None
Request Examples
Std Mode (Default)
curl -X POST https://sjinn.ai/api/un-api/create_tool_task \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tool_type": "sora2-text-to-video-api",
"input": {
"prompt": "A time-lapse of a flower blooming in a garden",
"aspect_ratio": "16:9",
"duration": 10
}
}'
Pro Mode (High Quality)
curl -X POST https://sjinn.ai/api/un-api/create_tool_task \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tool_type": "sora2-text-to-video-api",
"input": {
"prompt": "A cinematic aerial shot of a mountain landscape at golden hour",
"aspect_ratio": "16:9",
"mode": "pro",
"duration": 15
}
}'
Using JavaScript
const response = await fetch('https://sjinn.ai/api/un-api/create_tool_task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
tool_type: 'sora2-text-to-video-api',
input: {
prompt: 'A time-lapse of a flower blooming in a garden',
aspect_ratio: '16:9',
mode: 'std',
duration: 10,
},
}),
});
const result = await response.json();
console.log('Task ID:', result.data.task_id);
Using Python
import requests
url = 'https://sjinn.ai/api/un-api/create_tool_task'
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
data = {
'tool_type': 'sora2-text-to-video-api',
'input': {
'prompt': 'A time-lapse of a flower blooming in a garden',
'aspect_ratio': '16:9',
'mode': 'pro',
'duration': 15
}
}
response = requests.post(url, json=data, headers=headers)
result = response.json()
print('Task ID:', result['data']['task_id'])
Response Examples
Success Response
{
"success": true,
"errorMsg": "",
"error_code": 0,
"data": {
"task_id": "550e8400-e29b-41d4-a716-446655440000"
}
}
Error Response
{
"success": false,
"errorMsg": "Insufficient balance",
"error_code": 100
}
Mode Comparison
Std Mode
- Generation Speed: 2-4 minutes
- Video Quality: High
- Detail Rendering: Good
- Motion Smoothness: Good
- Credit Cost: 420 credits
- Use Cases: Quick prototyping, testing
Pro Mode
- Generation Speed: 5-10 minutes
- Video Quality: Very High
- Detail Rendering: Excellent
- Motion Smoothness: Excellent
- Credit Cost: 2100 credits
- Use Cases: Final products, commercial use
Best Practices
- Mode Selection:
- Use Std mode for testing and rapid iteration
- Use Pro mode for final products and important projects
- Prompt Optimization:
- Use specific, detailed descriptions
- Include camera movement, lighting, and style details
- Duration Selection:
- Start with 10 seconds for initial testing
- Use 15 seconds for longer, more complex scenes
- Aspect Ratio Selection: Choose appropriate aspect ratio based on target platform
- Generation Time: Pro mode takes longer, please be patient
