> ## Documentation Index
> Fetch the complete documentation index at: https://docs.yelinai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sora Official Forward Plan

> OpenAI Sora official API transparent forwarding, 99.99% availability, supports 4/8/12 second durations

## Introduction

**Official Forward** refers to the solution that directly calls OpenAI’s official Sora API and transparently forwards it to users. Unlike the current default “reverse-engineered” solution, the Official Forward plan offers higher stability and more precise instruction following.

\*\*What is Official Forward?\*\*Official Forward is a transparent proxy forwarding service for OpenAI’s official API. Your requests are directly forwarded to OpenAI’s official servers, enjoying the same service quality and stability as OpenAI official.

## Plan Comparison

| Aspect                    | Official Forward     | Reverse-Engineered (Current Default)          |
| ------------------------- | -------------------- | --------------------------------------------- |
| **Stability**             | 99.99% availability  | Depends on reverse engineering, may fluctuate |
| **Instruction Following** | Precise reproduction | Average                                       |
| **Image Quality**         | Stable, no blur      | Occasional blur                               |
| **Duration Options**      | 4/8/12 seconds       | 10/15 seconds                                 |
| **Image-to-Video**        | Supported            | Supported                                     |
| **API Method**            | Async only           | Sync + Async                                  |
| **Pricing**               | Per-second billing   | Per-call billing                              |

**How to choose?**

* **Prioritize stability and quality**: Choose Official Forward
* **Prioritize cost-effectiveness**: Choose reverse-engineered (current default)

## Supported Models and Pricing

### sora-2 (Standard Model)

| Resolution           | Per Second | 4 sec | 8 sec | 12 sec |
| -------------------- | ---------- | ----- | ----- | ------ |
| 720×1280 (Portrait)  | \$0.1      | \$0.4 | \$0.8 | \$1.2  |
| 1280×720 (Landscape) | \$0.1      | \$0.4 | \$0.8 | \$1.2  |

### sora-2-pro (HD Model)

| Resolution               | Per Second | 4 sec | 8 sec | 12 sec |
| ------------------------ | ---------- | ----- | ----- | ------ |
| 720×1280 (Portrait)      | \$0.3      | \$1.2 | \$2.4 | \$3.6  |
| 1280×720 (Landscape)     | \$0.3      | \$1.2 | \$2.4 | \$3.6  |
| 1024×1792 (Portrait HD)  | \$0.5      | \$2.0 | \$4.0 | \$6.0  |
| 1792×1024 (Landscape HD) | \$0.5      | \$2.0 | \$4.0 | \$6.0  |

Prices above include our service fee.

## How to Get Started

1

Create Token

Log in to [YeLIn AI console](https://api.yelinai.com/token), when creating a new token, **select “Sora2官转” (Sora2 Official Forward) group**.（截图请在 **Console** 查看）

2

Configure Billing Mode

Billing mode must be set to **“Pay-as-you-go”**.

Official Forward plan **does not support pay-per-call** mode. You must use pay-as-you-go billing.

3

Call API to Generate Video

Follow the complete examples below to call the API.

## API Reference

### Basic Information

| Configuration      | Value                                |
| ------------------ | ------------------------------------ |
| **Base URL**       | `https://api.yelinai.com`            |
| **Authentication** | `Authorization: Bearer YOUR_API_KEY` |
| **Request Format** | `multipart/form-data`                |

### API Endpoints

| Endpoint                  | Method | Description                  |
| ------------------------- | ------ | ---------------------------- |
| `/v1/videos`              | POST   | Create video generation task |
| `/v1/videos/{id}`         | GET    | Query task status            |
| `/v1/videos/{id}/content` | GET    | Download generated video     |

### Request Parameters

| Parameter         | Type   | Required | Description                                      |
| ----------------- | ------ | -------- | ------------------------------------------------ |
| `model`           | string | Yes      | Model name: `sora-2` or `sora-2-pro`             |
| `prompt`          | string | Yes      | Video description text                           |
| `size`            | string | No       | Resolution, e.g. `1280x720` (default `720x1280`) |
| `seconds`         | string | No       | Video duration: `4`, `8`, or `12` (default `4`)  |
| `input_reference` | file   | No       | Reference image file (for image-to-video)        |

### Supported Resolutions (size parameter)

**sora-2:**

* `720x1280` (Portrait, default)
* `1280x720` (Landscape)

**sora-2-pro:**

* `720x1280` (Portrait)
* `1280x720` (Landscape)
* `1024x1792` (Portrait HD)
* `1792x1024` (Landscape HD)

## Complete Examples

### Text-to-Video (cURL)

**Step 1: Create Video Generation Task**

```
curl -X POST "https://api.yelinai.com/v1/videos" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F model="sora-2" \
  -F prompt="A golden retriever playing fetch on a sunny beach, waves gently rolling in the background, cinematic lighting" \
  -F size="1280x720" \
  -F seconds="8"
```

**Response Example:**

```
{
  "id": "video_69788dc4a1c8819887468fbeffdda023",
  "object": "video",
  "model": "sora-2",
  "status": "queued",
  "progress": 0,
  "created_at": 1769508292,
  "size": "1280x720",
  "seconds": "8"
}
```

### Image-to-Video (cURL)

**Image-to-Video** allows you to provide a reference image as the first frame of the video. The AI will generate a dynamic video based on this image.

```
curl -X POST "https://api.yelinai.com/v1/videos" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F model="sora-2" \
  -F prompt="The camera slowly zooms in, the scene comes alive with gentle movement, cinematic atmosphere" \
  -F size="1280x720" \
  -F seconds="4" \
  -F input_reference="@your_image.jpeg;type=image/jpeg"
```

**Image Requirements**

* Image resolution must match the `size` parameter (e.g., if size=1280x720, image must be 1280×720 pixels)
* Supported formats: JPEG, PNG, WebP
* **Images containing real human faces are not supported** (will be rejected by content moderation)

**Step 2: Poll Task Status**

```
curl "https://api.yelinai.com/v1/videos/video_69788dc4a1c8819887468fbeffdda023" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

**Response Example (In Progress):**

```
{
  "id": "video_69788dc4a1c8819887468fbeffdda023",
  "object": "video",
  "status": "in_progress",
  "progress": 45,
  "created_at": 1769508292
}
```

**Response Example (Completed):**

```
{
  "id": "video_69788dc4a1c8819887468fbeffdda023",
  "object": "video",
  "status": "completed",
  "progress": 100,
  "created_at": 1769508292,
  "completed_at": 1769508592
}
```

**Step 3: Download Video**

```
curl "https://api.yelinai.com/v1/videos/video_69788dc4a1c8819887468fbeffdda023/content" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o output.mp4
```

### Python Example

```
import requests
import time

API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.yelinai.com"

headers = {
    "Authorization": f"Bearer {API_KEY}"
}

# Text-to-Video
def create_video(prompt, model="sora-2", seconds="8", size="1280x720"):
    response = requests.post(
        f"{BASE_URL}/v1/videos",
        headers=headers,
        data={
            "model": model,
            "prompt": prompt,
            "seconds": seconds,
            "size": size
        }
    )
    response.raise_for_status()
    return response.json()

# Image-to-Video
def create_video_from_image(prompt, image_path, model="sora-2", seconds="4", size="1280x720"):
    with open(image_path, "rb") as f:
        response = requests.post(
            f"{BASE_URL}/v1/videos",
            headers=headers,
            data={
                "model": model,
                "prompt": prompt,
                "seconds": seconds,
                "size": size
            },
            files={
                "input_reference": (image_path.split("/")[-1], f, "image/jpeg")
            }
        )
    response.raise_for_status()
    return response.json()

# Poll task status
def poll_status(video_id, timeout=600, interval=15):
    start_time = time.time()
    while time.time() - start_time < timeout:
        response = requests.get(
            f"{BASE_URL}/v1/videos/{video_id}",
            headers=headers
        )
        response.raise_for_status()
        data = response.json()

        status = data.get("status")
        progress = data.get("progress", 0)
        print(f"Status: {status}, Progress: {progress}%")

        if status == "completed":
            return data
        elif status == "failed":
            raise Exception(f"Video generation failed: {data.get('error')}")

        time.sleep(interval)

    raise TimeoutError("Video generation timeout")

# Download video
def download_video(video_id, output_path="output.mp4"):
    response = requests.get(
        f"{BASE_URL}/v1/videos/{video_id}/content",
        headers=headers
    )
    response.raise_for_status()

    with open(output_path, "wb") as f:
        f.write(response.content)
    print(f"Video saved to: {output_path}")

# Complete workflow
if __name__ == "__main__":
    # Text-to-Video
    job = create_video(
        prompt="A golden retriever playing fetch on a sunny beach",
        model="sora-2",
        seconds="8",
        size="1280x720"
    )
    print(f"Task created: {job['id']}")

    # Wait for completion
    result = poll_status(job["id"])
    print("Video generation completed!")

    # Download video
    download_video(job["id"], "my_video.mp4")

    # Image-to-Video example
    # job2 = create_video_from_image(
    #     prompt="The scene comes alive with gentle movement",
    #     image_path="reference.jpg",
    #     model="sora-2",
    #     seconds="4",
    #     size="1280x720"
    # )
```

### Task Status Reference

| Status        | Description                             |
| ------------- | --------------------------------------- |
| `queued`      | Task queued, waiting to be processed    |
| `in_progress` | Video is being generated                |
| `completed`   | Generation complete, ready for download |
| `failed`      | Generation failed                       |

**Polling Recommendation**Video generation typically takes 2-5 minutes. We recommend polling status every 15-20 seconds to avoid excessive requests.

## Developer Documentation

The Official Forward plan is fully compatible with OpenAI’s official API format. For more parameters and advanced usage, please refer to:

## OpenAI Sora Official Guide

Complete video generation guide

## OpenAI Videos API

API reference documentation

## Sora 2 Model Docs

sora-2 model details

## Sora 2 Pro Model Docs

sora-2-pro model details

## Important Notes

**Key Limitations**

1. **Async only**: Official Forward does not support sync API, all requests are asynchronous
2. **Pay-as-you-go only**: Must select “Pay-as-you-go” billing mode, “Pay-per-call” is not supported
3. **Group selection**: Must select “Sora2官转” group when creating tokens
4. **Image limitation**: Image-to-video does not support images containing real human faces

## FAQ

What's the difference between Official Forward and reverse-engineered?

Official Forward directly calls OpenAI’s official API with 99.99% stability; reverse-engineered is implemented through reverse engineering the official website, with lower prices but potentially affected stability.

Why doesn't Official Forward support sync API?

OpenAI’s official Sora API itself only provides async calling method, so Official Forward also only supports async calls.

Why are duration options different?

Official Forward supports OpenAI’s official 4/8/12 second duration options; reverse-engineered supports the official website interface’s 10/15 second durations.

What are the requirements for image-to-video?

Image resolution must match the target video’s size parameter. For example, if size=1280x720, the image must be 1280×720 pixels. Supported formats: JPEG, PNG, WebP. Images containing real human faces are not supported.
