Documentation Index Fetch the complete documentation index at: https://docs.toapis.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Sora2 character creation feature allows you to extract characters from existing videos. Once created, you can reuse the character in subsequent video generations to maintain character consistency.
Important:
Video must contain audio and identifiable characters
Time range limit: minimum 1 second, maximum 3 seconds
Either url or from_task is required - must provide one
prompt parameter is not required in this mode
After creation, the character task ID can be used for subsequent video generation
Authentication
Request Parameters
model
string
default: "sora-2"
required
Video generation model name Supported models:
sora-2 - Standard version
sora-2-pro - Professional version (higher quality)
sora-2-vip - VIP version, higher priority
Character appearance timestamp range Unit is seconds, format is "start_second,end_second" Constraints:
Time range difference minimum: 1 second
Time range difference maximum: 3 seconds
Example: "1,3" means the character appearing from second 1 to second 3 in the video
Video URL containing the character to extract Requirements:
Video must contain audio
Video must contain identifiable characters
Note: Either url or from_task requiredExample: "https://example.com/my-video.mp4"
Task ID of a previously generated video Create character from an existing video generation task Note: Either url or from_task requiredExample: "task_01KBYT59JDHB4A3KDDR9N9JVWP"
Response Fields
Unique task identifier for querying character creation status After completion, this character task ID can be used in video generation via the character_url parameter
Object type, always generation.task
Task status:
queued - Queued for processing
in_progress - Processing
completed - Successfully completed
failed - Failed
Task progress percentage (0-100)
Task creation time (Unix timestamp)
Task completion time (Unix timestamp, only available after completion)
Character creation result (only available after completion) Contains created character information such as character ID, name, profile picture, etc.
cURL (From Video URL)
cURL (From Existing Task)
Python
JavaScript
Go
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "sora-2",
"url": "https://example.com/character-video.mp4",
"timestamps": "1,3"
}'
200 (Submitted)
200 (Completed - Query Result)
400 (Invalid Request)
401 (Authentication Failed)
402 (Insufficient Balance)
{
"id" : "task_01KBYT59JDHB4A3KDDR9N9JVWP" ,
"object" : "generation.task" ,
"model" : "sora-2" ,
"status" : "queued" ,
"progress" : 0 ,
"created_at" : 1703884800 ,
"metadata" : {}
}
Usage Flow
Submit Character Creation Request
Call this API with a video URL or existing task ID containing the character, along with the time range
Get Task ID
API returns task ID with status queued or in_progress
Use Character in Video Generation
After character creation completes, use character_url parameter to reference the character task ID in subsequent video generation
Best Practices
Choose Clear Character Segments : Select 1-3 second segments where character features are most prominent
Ensure Video Quality : High-definition video allows better character feature extraction
Include Audio : Video must contain an audio track
Avoid Multiple Characters : The selected time range should ideally contain only one main character