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

# Sora 2 Video API

> Generate AI videos with OpenAI's Sora 2 models via the Runcrate API — text-to-video with realistic physics simulation.

export const RuncrateStyles = () => {
  if (typeof document !== 'undefined' && !document.getElementById('runcrate-overrides')) {
    const s = document.createElement('style');
    s.id = 'runcrate-overrides';
    s.textContent = `
      /* Match Runcrate's rounding scale (--radius: 0.75rem) */
      .rounded-sm { border-radius: 0.5rem !important; }   /* 8px */
      .rounded-md { border-radius: 0.625rem !important; } /* 10px */
      .rounded-lg { border-radius: 0.75rem !important; }  /* 12px */
      .rounded-l-sm { border-top-left-radius: 0.5rem !important; border-bottom-left-radius: 0.5rem !important; }
      .rounded-r-sm { border-top-right-radius: 0.5rem !important; border-bottom-right-radius: 0.5rem !important; }
      .rounded-l-md { border-top-left-radius: 0.625rem !important; border-bottom-left-radius: 0.625rem !important; }
      .rounded-r-md { border-top-right-radius: 0.625rem !important; border-bottom-right-radius: 0.625rem !important; }
      .rounded-l-lg { border-top-left-radius: 0.75rem !important; border-bottom-left-radius: 0.75rem !important; }
      .rounded-r-lg { border-top-right-radius: 0.75rem !important; border-bottom-right-radius: 0.75rem !important; }

      /* Cards: never pure white in light mode */
      .card { background-color: #fcfcfc !important; border-radius: 0.75rem !important; }
      html.dark .card { background-color: #141414 !important; }

      /* Docs hero box */
      .rc-hero { background-color: #fcfcfc; border: 1px solid #e0e0e0; }
      html.dark .rc-hero { background-color: #141414; border-color: #242424; }
      html.dark .rc-hero h1 { color: #f5f5f5; }

      /* Runcrate scrollbar — thin, transparent track, hide-until-hover thumb */
      ::-webkit-scrollbar { width: 6px; height: 6px; background-color: transparent; }
      ::-webkit-scrollbar-track { background-color: transparent; }
      ::-webkit-scrollbar-thumb { background-color: rgba(155, 155, 155, 0.5); border-radius: 10px; transition: opacity 0.3s ease; opacity: 0; }
      ::-webkit-scrollbar-thumb:hover { background-color: rgba(155, 155, 155, 0.7); }
      *:hover::-webkit-scrollbar-thumb,
      *:focus::-webkit-scrollbar-thumb,
      *:active::-webkit-scrollbar-thumb { opacity: 1; }
      * { scrollbar-width: thin; scrollbar-color: rgba(155, 155, 155, 0.5) transparent; }
    `;
    document.head.appendChild(s);
  }
  return null;
};

<RuncrateStyles />

Generate videos using OpenAI's Sora 2 models through the Runcrate API. Sora 2 excels at realistic physics simulation, consistent object permanence, and cinematic camera work.

<Warning>
  **Sora API is being discontinued in September 2026.** Plan migrations to [Veo 3](/examples/ai-video-pipeline), [Seedance](/examples/seedance-video-api), or [Kling v3](/examples/ai-video-pipeline) before the deadline.
</Warning>

## Available models

| Model          | Durations | Best for                           |
| -------------- | --------- | ---------------------------------- |
| **Sora 2**     | 4, 8, 12s | General-purpose video generation   |
| **Sora 2 Pro** | 4, 8, 12s | Production-quality, complex scenes |

***

## Basic text-to-video

<CodeGroup>
  ```python Python theme={"theme":"github-dark"}
  from runcrate import Runcrate

  client = Runcrate(api_key="rc_live_YOUR_API_KEY")

  job = client.models.generate_video_and_save(
      "sora-demo.mp4",
      model="openai/sora-2",
      prompt="A paper airplane folds itself from a blank sheet, launches off a wooden desk, "
             "and flies through an open window into a bright blue sky. Tracking shot.",
      duration=8,
      on_status=lambda j: print(f"  {j.status}..."),
  )
  ```

  ```typescript TypeScript theme={"theme":"github-dark"}
  import Runcrate from '@runcrate/sdk';

  const rc = new Runcrate({ apiKey: 'rc_live_YOUR_API_KEY' });

  const job = await rc.models.generateVideo({
    model: 'openai/sora-2',
    prompt: 'A paper airplane folds itself from a blank sheet, launches off a desk, flies through a window.',
    duration: 8,
  });

  let status = job;
  while (status.status !== 'completed' && status.status !== 'failed') {
    await new Promise(r => setTimeout(r, 5000));
    status = await rc.models.getVideoStatus(job.id);
  }

  const videoBuffer = await rc.models.downloadVideo(job.id);
  await Bun.write('sora-demo.mp4', videoBuffer);
  ```
</CodeGroup>

***

## Sora 2 Pro — production quality

```python theme={"theme":"github-dark"}
from runcrate import Runcrate

client = Runcrate(api_key="rc_live_YOUR_API_KEY")

job = client.models.generate_video_and_save(
    "hero-video.mp4",
    model="openai/sora-2-pro",
    prompt="Slow-motion close-up of water droplets falling onto a leaf, each creating "
           "concentric ripples. Macro lens, natural diffused lighting, shallow depth of field.",
    duration=12,
    on_status=lambda j: print(f"  {j.status}..."),
)
```

***

## Sora 2 vs. alternatives

| Feature         | Sora 2                  | Veo 3.0           | Seedance 1.0 |
| --------------- | ----------------------- | ----------------- | ------------ |
| Max duration    | 12s                     | 8s                | 12s          |
| Physics realism | Excellent               | Good              | Good         |
| Resolution      | HD                      | 4K                | HD           |
| Audio           | No                      | Yes (Veo 3 Audio) | No           |
| Status          | **Sunsetting Sep 2026** | Active            | Active       |

## Migration plan

The API shape is identical across all video models — changing the `model` parameter is the only code change needed:

| Current    | Migrate to | Why                                     |
| ---------- | ---------- | --------------------------------------- |
| Sora 2     | Veo 3.0    | Higher resolution, audio support        |
| Sora 2 Pro | Veo 3.0    | Comparable quality, actively maintained |

***

## Tips

* **Sora 2 excels at physical interactions** — dominos, water, fabric, collisions.
* **Camera language works well** — "tracking shot," "dolly zoom," "slow motion" are understood.
* **12s is the maximum** — for longer videos, generate multiple clips and stitch them.
* **Start with Sora 2** for drafts, use Sora 2 Pro for finals.

## Next steps

* [Video generation reference](/models/video-generation)
* [Seedance Video API](/examples/seedance-video-api) — ByteDance's alternative
* [AI Video Pipeline](/examples/ai-video-pipeline) — batch generation with multiple models
