Sora 2

Sora 2 transforms detailed text descriptions into stunning, dynamic videos within seconds.


API

If you're looking for an API, you can choose from your desired programming language.

POST
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 import requests import base64 # Use this function to convert an image file from the filesystem to base64 def image_file_to_base64(image_path): with open(image_path, 'rb') as f: image_data = f.read() return base64.b64encode(image_data).decode('utf-8') # Use this function to fetch an image from a URL and convert it to base64 def image_url_to_base64(image_url): response = requests.get(image_url) image_data = response.content return base64.b64encode(image_data).decode('utf-8') # Use this function to convert a list of image URLs to base64 def image_urls_to_base64(image_urls): return [image_url_to_base64(url) for url in image_urls] api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/sora-2" # Request payload data = { "prompt": "A monk meditating under a waterfall, droplets misting around, capturing tranquility amidst nature's power.", "duration": 8, "size": "720x1280" } headers = {'x-api-key': api_key} response = requests.post(url, json=data, headers=headers) print(response.content) # The response is the generated image
RESPONSE
video/mp4
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


promptstr *

Define the video content with detailed or abstract descriptions. Use detailed action scenes or serene landscapes to enhance creativity.


input_referencestr ( default: 1 )

Provide an URL to an image for reference.


durationenum:str ( default: 8 )

Set the animation duration in seconds. Use shorter durations for quick previews and longer for detailed animations.

Allowed values:


sizeenum:str ( default: 720x1280 )

Select the video's aspect ratio. Choose portrait for social media stories or landscape for traditional videos.

Allowed values:

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

Resources to get you started

Everything you need to know to get the most out of Sora 2

# Sora 2: Effective Usage Guide

Sora 2 is an advanced text-to-video AI model designed to turn detailed text prompts into dynamic, high-quality video clips. By carefully crafting your prompt and choosing the right parameters, you can generate smooth, engaging content for social media, marketing, education, and prototyping.

## 1. Prompt Best Practices
- Be specific: describe actions, environment, lighting, and camera movement.
- Use vivid verbs: “glide,” “pan,” “zoom out,” “ripple,” “sparkle.”
- Add temporal cues: “as the sun dips below the horizon,” “over three beats,” “slow reveal.”
- Include character details: expressions, attire, interactions.
- Leverage reference images: supply an `input_reference` URL to match existing assets or styles.

Example prompt:
“A young explorer in a brass diving suit ascends from turquoise waters, light shafts rippling across the ocean floor as schools of fish scatter around her.”

## 2. Parameter Recommendations

| Parameter        | Description                                | Suggested Value         | Use Case                                     |
|------------------|--------------------------------------------|-------------------------|-----------------------------------------------|
| prompt           | Detailed scene description                 | Custom 2–3 sentences    | Always required                               |
| input_reference  | URL for style/content matching (optional)  | `https://…/style.jpg`   | Branding videos, character consistency        |
| duration         | Animation length in seconds                | 4, 8, or 12             | Short teasers (4 s), social media (8 s), tutorials (12 s) |
| size (aspect)    | Video resolution (portrait or landscape)   | 720×1280 or 1280×720    | Stories/Reels (720×1280), YouTube/Ads (1280×720) |

## 3. Use Case Scenarios

1. Social Media Stories  
   - duration: 4 s or 8 s  
   - size: 720×1280  
   - prompt: Focus on a single highlight or moment.  
   - input_reference: Optional brand logo background.

2. Promotional/Marketing Videos  
   - duration: 8 s or 12 s  
   - size: 1280×720  
   - prompt: Showcase product interaction, key benefits, movement.  
   - input_reference: Product renders for style matching.

3. Educational Shorts  
   - duration: 12 s  
   - size: 1280×720  
   - prompt: Narrate complex topics with clear visuals and on-screen text cues.  
   - input_reference: Diagram images to maintain consistency.

4. Rapid Prototyping  
   - duration: 4 s  
   - size: Either aspect  
   - prompt: Abstract concept visuals for quick client feedback.  
   - input_reference: Sketches or wireframes.

## 4. Optimization Tips
- Preview with 4 s clips before committing to longer renders.
- Use an input reference to enforce brand colors, character designs, or textures.
- Adjust prompt length: 2–3 sentences balance detail and creativity.
- Monitor content safety: Sora 2’s safeguards block harmful or misleading outputs.
- Combine portrait and landscape outputs for multi-platform campaigns.

By following these guidelines, you’ll harness Sora 2’s full potential—generating consistent, visually rich videos that capture attention and tell your story.

Other Popular Models

Discover other models you might be interested in.

Cookie settings

We use cookies to enhance your browsing experience, analyze site traffic, and personalize content. By clicking "Accept all", you consent to our use of cookies.