Skip to main content
POST
/
v1
/
videos
/
generations
curl --request POST \
  --url https://toapis.com/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "sora-2",
    "prompt": "A golden retriever running on grass, sunny day",
    "duration": 10,
    "aspect_ratio": "16:9"
  }'
{
  "id": "video_01K8SGYNNNVBQTXNR4MM964S7K",
  "object": "generation.task",
  "model": "sora-2",
  "status": "queued",
  "progress": 0,
  "created_at": 1768380224,
  "metadata": {
    "size": "720x720"
  }
}
  • OpenAI Sora2 video generation model
  • Use model parameter to select sora-2 or sora-2-pro model
  • Supports text-to-video, image-to-video, and character reference
  • Async task management, query results by task ID
Important Change: For better performance and cost control, we no longer support passing base64 image data directly in image_urls. Please use the Upload Image API first to upload images and get URLs, then call this endpoint.

Authorizations

Authorization
string
required
All endpoints require Bearer Token authenticationGet your API Key from the API Key Management PageAdd to request header:
Authorization: Bearer YOUR_API_KEY

Body

model
string
default:"sora-2"
required
Video generation model nameSupported models:
  • sora-2 - Standard version
  • sora-2-pro - Professional version, supports longer duration
  • sora-2-vip - VIP version, higher priority
Example: "sora-2" or "sora-2-pro"
prompt
string
required
Text description for video generation💡 @Character Reference Feature:You can use @username format in the prompt to reference previously created characters and include them in the generated video.
  • The character’s username can be obtained via the Query Character API
  • Supports referencing multiple characters at once
Example: "A cat and a dog driving a car together @duksvfkf.cruisingki @zdqwahgj.baronbarki"
duration
integer
Video duration in seconds
  • sora-2: Supports 10 or 15 seconds
  • sora-2-pro: Supports 15 seconds (HD) or 25 seconds
Example: 10
aspect_ratio
string
Video aspect ratioSupported formats:
  • 16:9 (Landscape)
  • 9:16 (Portrait)
image_urls
string[]
Array of reference image URLs for image-to-video generation⚠️ URL format only (base64 no longer supported)
  • Publicly accessible image URL (http:// or https://)
  • You can use the Upload Image API to upload local images and get URLs
thumbnail
boolean
Whether to generate a video thumbnail
  • true - Generate a video thumbnail for preview and display
If you don’t need a thumbnail, you can omit this parameter
metadata.n
integer
default:"1"
Number of different variants to generateRange: 1-4Default: 1
metadata.watermark
boolean
default:"false"
Whether to add a watermark to the generated video
  • false - No watermark
  • true - Add Sora official watermark to the video
Default: false
metadata.hd
boolean
default:"false"
Whether to generate high-definition video
  • true - Generate HD video
  • false - Standard definition
⚠️ Note: Requires sora-2-pro model and duration cannot be 25 secondsDefault: false
metadata.private
boolean
default:"false"
Whether to enable privacy mode
  • true - Video will not be published and cannot be remixed (re-edited)
  • false - Video can be published and remixed
Default: false
metadata.style
string
Video styleSupported values:
  • thanksgiving - Thanksgiving style
  • comic - Comic style
  • news - News style
  • selfie - Selfie style
  • nostalgic - Nostalgic/Retro style
  • anime - Anime style
Example: "anime"
metadata.storyboard
boolean
Whether to use storyboard for finer control over video generation details
  • true - Enable storyboard feature
  • false - Do not use storyboard
Example: true
metadata.character_url
string
Reference video URL for character extractionUsed to reuse characters from a reference video in the generated videoExample: "https://filesystem.site/cdn/20251030/javYrU4etHVFDqg8by7mViTWHlMOZy.mp4"⚠️ Note: When using this parameter, the generated video duration will be reduced by 1 second
metadata.character_timestamps
string
Character appearance timestampsSpecifies the time range in the reference video where the character appears, only supports 2-second segmentsFormat: "start_second,end_second"Example: "1,3" means the character from second 1 to second 3 in the reference video⚠️ Note: When using this parameter, the generated video duration will be reduced by 1 second
metadata.character_create
boolean
default:"false"
Automatically create a character from the generated video after completion
  • true - Automatically create character
  • false - Do not create character
Default: false
metadata.character_from_task
string
Create a character from an already generated task IDReference a previously generated video task ID to extract characters from that videoExample: "video_01K8SGYNNNVBQTXNR4MM964S7K"

Response

id
string
Unique task identifier for status queries
object
string
Object type, always generation.task
model
string
Model name used
status
string
Task status
  • queued - Queued for processing
  • in_progress - Processing
  • completed - Successfully completed
  • failed - Failed
progress
integer
Task progress percentage (0-100)
created_at
integer
Task creation timestamp (Unix timestamp)
metadata
object
Task metadata
curl --request POST \
  --url https://toapis.com/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "sora-2",
    "prompt": "A golden retriever running on grass, sunny day",
    "duration": 10,
    "aspect_ratio": "16:9"
  }'
{
  "id": "video_01K8SGYNNNVBQTXNR4MM964S7K",
  "object": "generation.task",
  "model": "sora-2",
  "status": "queued",
  "progress": 0,
  "created_at": 1768380224,
  "metadata": {
    "size": "720x720"
  }
}