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

# sora-2

> API usage guide for sora-2.

{/* source_model_id: sora-2 */}

{/* source_updated_at: 1781809375 */}

**Model ID**

```bash theme={null}
sora-2
```

**Calling method:** async

# sora-2 API Usage Guide

## Overview

**Sora-2** is OpenAI's state-of-the-art video generation model that can create realistic and imaginative video content from text descriptions. The model excels at understanding complex prompts and generating coherent, high-quality videos with smooth motion, realistic physics, and detailed visual elements. It supports various aspect ratios and durations, making it suitable for a wide range of creative applications.

## Authentication

All API requests require authentication using an API key. Include your API key in the Authorization header:

```bash theme={null}
Authorization: Bearer YOUR_API_KEY
```

## Submit Video Generation Request

### Base URL

```
https://console.gmicloud.ai
```

### Endpoint

```
POST /api/v1/ie/requestqueue/apikey/requests
```

### Request Format

```bash theme={null}
curl -X POST "https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sora-2",
    "payload": {
      "prompt": "A majestic eagle soaring through a mountain landscape at sunset",
      "input_reference": "https://example.com/reference_image.jpg",
      "seconds": "4",
      "size": "1280x720"
    }
  }'
```

### Request Parameters

| Parameter         | Type   | Required | Description                                                                                                               | Default     | Constraints                     |
| ----------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------- | ----------- | ------------------------------- |
| `prompt`          | string | Yes      | Text description of the video to generate (max 2000 characters). Include scenes, actions, camera moves, and visual style. | -           | Required                        |
| `input_reference` | string | No       | The image MUST match the target video's resolution (size).Supported file formats are: jpeg, png, and webp.                | -           | Max 1 image                     |
| `seconds`         | string | No       | Duration of the video in seconds.                                                                                         | "4"         | Options: "4", "8", "12"         |
| `size`            | string | No       | Video resolution and aspect ratio.                                                                                        | "1792x1024" | Options: "1280x720", "720x1280" |

### Response

```json theme={null}
{
  "request_id": "550e8400-e29b-41d4-a716-446655440000",
  "model": "sora-2",
  "status": "queued",
  "created_at": 1750442925,
  "updated_at": 1750442925,
  "queued_at": 1750442925
}
```

## Check Request Status

### Endpoint

```
GET /api/v1/ie/requestqueue/apikey/requests/{request_id}
```

### Example

```bash theme={null}
curl -X GET "https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Response

```json theme={null}
{
  "request_id": "550e8400-e29b-41d4-a716-446655440000",
  "org_id": "your-org-id",
  "user_id": "your-user-id",
  "model": "sora-2",
  "status": "success",
  "is_public": false,
  "payload": {
    "prompt": "A majestic eagle soaring through a mountain landscape at sunset",
    "input_reference": "https://example.com/reference_image.jpg",
    "seconds": "8",
    "size": "1280x720"
  },
  "outcome": {
    "video_url": "https://storage.googleapis.com/bucket/generated-video.mp4",
    "thumbnail_image_url": "https://storage.googleapis.com/bucket/thumbnail.jpg"
  },
  "created_at": 1750442925,
  "updated_at": 1750442930,
  "queued_at": 1750442925
}
```

## Request Status Values

| Status       | Description                             |
| ------------ | --------------------------------------- |
| `queued`     | Request is waiting to be processed      |
| `processing` | Video generation is in progress         |
| `success`    | Video generation completed successfully |
| `failed`     | Video generation failed                 |
| `cancelled`  | Request was cancelled                   |

## List Your Requests

### Endpoint

```
GET api/v1/ie/requestqueue/apikey/requests?model_id=sora-2
```

### Example

```bash theme={null}
curl -X GET "https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests?model_id=sora-2" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Get Model Information

### Endpoint

```
GET /api/v1/ie/requestqueue/apikey/models/sora-2
```

### Example

```bash theme={null}
curl -X GET "https://api.example.com/api/v1/apikey/models/sora-2" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## List Available Models

### Endpoint

```
GET /api/v1/apikey/models
```

### Example

```bash theme={null}
curl -X GET "https://api.example.com/api/v1/apikey/models" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Response

```json theme={null}
{
    "model_ids": [
        "sora-2",
        "other-model-1",
        "other-model-2"
    ]
}
```

## Pricing

* **Pricing Type**: Video length based pricing
* **Unit Price**: \$0.10 per second
