Skip to content

mountsea-ai/sora-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎬 Sora 2 API - OpenAI Sora API | Sora Pro | Text-to-Video API

English | 中文

Access OpenAI Sora 2 (Sora Pro, Sora2, Sora-2) text-to-video and image-to-video generation through a simple, affordable API. The cheapest Sora 2 API access available.

License: MIT API Status Documentation


🤔 What is Sora 2 API?

Sora 2 (also known as Sora Pro, Sora2, OpenAI Sora) is OpenAI's latest AI video generation model. This project provides the cheapest and easiest way to access Sora 2 API through Mountsea AI.

Supported Models

Model Also Known As Description
Sora 2 Sora-2, Sora2, OpenAI Sora 2 Latest text-to-video model
Sora Pro Sora-Pro, SoraPro High-quality production model

✨ Features

  • 🎥 Text-to-Video – Generate stunning videos from text descriptions
  • 🖼️ Image-to-Video – Animate static images into dynamic videos
  • Fast Generation – Optimized infrastructure for quick results
  • 💰 Affordable Pricing – Up to 50% cheaper than alternatives
  • 🔄 Task Management – Easy-to-use async task system

🚀 Quick Start

Install SDK

# Python
pip install mountsea-sora

# Node.js
npm install mountsea-sora

Get Your API Key

  1. Visit Mountsea AI Platform
  2. Sign up and get your API key
  3. Start generating videos!

Python SDK Example

from mountsea_sora import SoraClient

client = SoraClient("your-api-key")
task = client.generate("A golden retriever playing in autumn leaves, cinematic 4K")
result = client.wait(task["taskId"])
print(result["videoUrl"])

Node.js SDK Example

const { SoraClient } = require('mountsea-sora');

const client = new SoraClient('your-api-key');
const task = await client.generate('A golden retriever in autumn leaves, 4K');
const result = await client.wait(task.taskId);
console.log(result.videoUrl);

Python Example (requests)

import requests
import time

API_KEY = "your-api-key"
BASE_URL = "https://api.mountsea.ai"

headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
}

# Text-to-Video Generation
response = requests.post(
    f"{BASE_URL}/sora/generate",
    headers=headers,
    json={
        "prompt": "A golden retriever playing in autumn leaves in a park, cinematic lighting, 4K",
        "duration": 5,
        "resolution": "1080p"
    }
)

task = response.json()
task_id = task['taskId']
print(f"Task ID: {task_id}")

# Poll for results
while True:
    status = requests.get(
        f"{BASE_URL}/sora/task",
        headers=headers,
        params={"taskId": task_id}
    ).json()
    
    if status['status'] == 'completed':
        print(f"Video URL: {status['videoUrl']}")
        break
    elif status['status'] == 'failed':
        print(f"Error: {status['error']}")
        break
    
    print(f"Status: {status['status']}...")
    time.sleep(10)

Image-to-Video

# Animate an image
response = requests.post(
    f"{BASE_URL}/sora/generate",
    headers=headers,
    json={
        "prompt": "The person in the image slowly turns and smiles",
        "imageUrl": "https://example.com/your-image.jpg",
        "duration": 5
    }
)

task = response.json()
print(f"Task ID: {task['taskId']}")

JavaScript / Node.js

const axios = require('axios');

const API_KEY = process.env.MOUNTSEA_API_KEY || 'your-api-key';
const BASE_URL = 'https://api.mountsea.ai';

async function generateVideo(prompt, options = {}) {
  const response = await axios.post(`${BASE_URL}/sora/generate`, {
    prompt,
    duration: options.duration || 5,
    resolution: options.resolution || '1080p',
    ...options
  }, {
    headers: {
      'Authorization': `Bearer ${API_KEY}`,
      'Content-Type': 'application/json'
    }
  });

  return response.data;
}

async function waitForResult(taskId) {
  while (true) {
    const { data } = await axios.get(`${BASE_URL}/sora/task`, {
      headers: { 'Authorization': `Bearer ${API_KEY}` },
      params: { taskId }
    });

    if (data.status === 'completed') return data;
    if (data.status === 'failed') throw new Error(data.error);
    
    console.log(`Status: ${data.status}...`);
    await new Promise(r => setTimeout(r, 10000));
  }
}

// Usage
(async () => {
  const task = await generateVideo(
    'A timelapse of a city skyline from day to night, 4K cinematic'
  );
  console.log('Task created:', task.taskId);

  const result = await waitForResult(task.taskId);
  console.log('Video URL:', result.videoUrl);
})();

cURL

# Text-to-Video
curl -X POST https://api.mountsea.ai/sora/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A beautiful sunset over the ocean with waves crashing on the shore",
    "duration": 5,
    "resolution": "1080p"
  }'

# Image-to-Video
curl -X POST https://api.mountsea.ai/sora/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "The landscape slowly pans from left to right with clouds moving",
    "imageUrl": "https://example.com/landscape.jpg",
    "duration": 5
  }'

# Check Task Status
curl -X GET "https://api.mountsea.ai/sora/task?taskId=YOUR_TASK_ID" \
  -H "Authorization: Bearer YOUR_API_KEY"

📖 API Endpoints

Endpoint Method Description
/sora/generate POST Generate video from text or image
/sora/task GET Get task status and results

🎯 Use Cases

  • 🎬 Content Creation – Generate marketing videos, social media content
  • 🎨 Creative Projects – Bring artistic visions to life
  • 📱 App Development – Add AI video generation to your app
  • 🏢 Enterprise – Automate video production workflows
  • 📚 Education – Create educational video content

💰 Pricing

Mountsea AI offers the most competitive pricing for Sora API:

Package Credits Price
Starter 10,000 ¥100
Basic 50,000 ¥500
Pro 200,000 ¥2,000
Business 500,000 ¥4,500 (10% OFF)
Enterprise 1,000,000 ¥8,000 (20% OFF)

👉 View Full Pricing

📚 Documentation

🔗 Related Projects


🇨🇳 中文文档

🎬 Sora 2 API - OpenAI Sora API | Sora Pro | AI 视频生成

通过简单、实惠的 API 访问 OpenAI Sora 2(Sora Pro、Sora2、Sora-2)视频生成能力。最便宜的 Sora 2 API 接入方案。

✨ 功能特点

  • 🎥 文本生成视频 – 从文字描述生成精彩视频
  • 🖼️ 图片生成视频 – 将静态图片动态化
  • 快速生成 – 优化的基础设施,快速出结果
  • 💰 价格实惠 – 比竞品便宜高达 50%
  • 🔄 任务管理 – 简单易用的异步任务系统

🚀 快速开始

获取 API 密钥

  1. 访问 Mountsea AI 平台
  2. 注册账号并获取 API 密钥
  3. 开始生成视频!

Python 示例

import requests

API_KEY = "your-api-key"
BASE_URL = "https://api.mountsea.ai"

# 文本生成视频
response = requests.post(
    f"{BASE_URL}/sora/generate",
    headers={
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json"
    },
    json={
        "prompt": "一只金毛犬在秋叶中玩耍,电影级光影,4K",
        "duration": 5,
        "resolution": "1080p"
    }
)

task = response.json()
print(f"任务 ID: {task['taskId']}")

📖 API 接口

接口 方法 描述
/sora/generate POST 从文本或图片生成视频
/sora/task GET 获取任务状态和结果

📚 文档

⭐ Star History

如果这个项目对你有帮助,请给我们一个 Star ⭐

📄 License

MIT License


Powered by Mountsea AI – 全球顶级 AI 视频和音乐生成器 API 一体化平台

Last API Check: 2026-03-06 | Status: online

Releases

No releases published

Packages

 
 
 

Contributors