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

# Quickstart

> Generate your first AI video in 3 steps

## 1. Create an API key

Go to [Account Settings](https://rawugc.com/account) and create a new API key. Copy the secret -- it's only shown once.

## 2. Generate a video

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://rawugc.com/api/v1/videos/generate \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -H "RawUGC-Version: 2026-03-06" \
    -d '{
      "model": "sora-2-text-to-video",
      "prompt": "A serene beach at sunset with gentle waves",
      "aspectRatio": "landscape",
      "nFrames": "15"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://rawugc.com/api/v1/videos/generate', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${YOUR_API_KEY}`,
      'Content-Type': 'application/json',
      'RawUGC-Version': '2026-03-06',
    },
    body: JSON.stringify({
      model: 'sora-2-text-to-video',
      prompt: 'A serene beach at sunset with gentle waves',
      aspectRatio: 'landscape',
      nFrames: '15',
    }),
  });

  const data = await response.json();
  console.log('Video ID:', data.videoId);
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://rawugc.com/api/v1/videos/generate',
      headers={
          'Authorization': f'Bearer {YOUR_API_KEY}',
          'Content-Type': 'application/json',
          'RawUGC-Version': '2026-03-06',
      },
      json={
          'model': 'sora-2-text-to-video',
          'prompt': 'A serene beach at sunset with gentle waves',
          'aspectRatio': 'landscape',
          'nFrames': '15',
      }
  )

  data = response.json()
  print('Video ID:', data['videoId'])
  ```
</CodeGroup>

<Tip>
  The `RawUGC-Version` header is optional. If omitted, your API key's pinned version is used, or the latest version (`2026-03-06`) if unpinned. See [Versioning](/versioning).
</Tip>

You'll receive a response like:

```json theme={null}
{
  "videoId": "vid_jh7a3b9xq2pn4r8k",
  "model": "sora-2-text-to-video",
  "status": "pending",
  "creditsUsed": 6,
  "newBalance": 994,
  "estimatedCompletionTime": "1-3 minutes",
  "createdAt": 1234567890000
}
```

## 3. Check video status

Poll the status endpoint until the video is ready:

<CodeGroup>
  ```bash cURL theme={null}
  curl https://rawugc.com/api/v1/videos/vid_jh7a3b9xq2pn4r8k \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const status = await fetch('https://rawugc.com/api/v1/videos/vid_jh7a3b9xq2pn4r8k', {
    headers: { 'Authorization': `Bearer ${YOUR_API_KEY}` },
  });
  const result = await status.json();

  if (result.status === 'completed') {
    console.log('Video URL:', result.url);
  }
  ```

  ```python Python theme={null}
  status = requests.get(
      'https://rawugc.com/api/v1/videos/vid_jh7a3b9xq2pn4r8k',
      headers={'Authorization': f'Bearer {YOUR_API_KEY}'}
  )
  result = status.json()

  if result['status'] == 'completed':
      print('Video URL:', result['url'])
  ```
</CodeGroup>

When complete, the response includes the video URL:

```json theme={null}
{
  "videoId": "vid_jh7a3b9xq2pn4r8k",
  "status": "completed",
  "model": "sora-2-text-to-video",
  "url": "https://storage.rawugc.com/videos/abc123.mp4",
  "creditsUsed": 6,
  "createdAt": 1234567890000,
  "completedAt": 1234567950000
}
```

## Next steps

* [Available models](/models) -- explore all 5 AI video models
* [Authentication](/authentication) -- learn about API key management
* [API Versioning](/versioning) -- understand date-based versioning
* [API Reference](/api-reference) -- full endpoint documentation
