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

# Sora 2 Create Video

> Use DeerAPI to call the Sora 2 Create Video endpoint with request details, response details, examples, and an OpenAPI playground.

## Overview

Use this endpoint to call the Sora 2 Create Video workflow through DeerAPI. The API reference on this page shows the request schema, response schema, authentication requirements, and runnable examples for the configured endpoint.

## Before you start

Use the DeerAPI base URL and pass your API Key in the `Authorization` header:

```text theme={null}
https://api.deerapi.com
```

```text theme={null}
Authorization: Bearer $DEERAPI_KEY
```

## Model selection

Choose a current model ID from the [live pricing page](https://api.deerapi.com/pricing). Model availability changes over time, so avoid copying a model ID from an old project without checking the live list first.

## Implementation notes

* Use the OpenAPI playground for the exact request fields accepted by this endpoint.
* Keep API Keys on the server side when you build production applications.
* Log the request ID from failed calls so support can investigate the request.
* Retry `429`, `500`, and `503` responses with exponential backoff.


## OpenAPI

````yaml /api/openapi/video/sora-2/official/post-create-video.openapi.json POST /v1/videos
openapi: 3.1.0
info:
  title: Create Video API
  version: 1.0.0
servers:
  - url: https://api.deerapi.com
security:
  - bearerAuth: []
paths:
  /v1/videos:
    post:
      summary: Create Video API
      operationId: post_v1_videos
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  description: Use this field according to the endpoint schema.
                  example: cat
                model:
                  type: string
                  enum:
                    - sora-2-pro
                    - sora-2
                  x-apifox-enum:
                    - value: sora-2-pro
                      name: sora-2-pro
                      description: ''
                    - value: sora-2
                      name: sora-2
                      description: ''
                  description: Use this field according to the endpoint schema.
                  example: sora-2
                seconds:
                  type: string
                  enum:
                    - '4'
                    - '8'
                    - '12'
                  x-apifox-enum:
                    - value: '4'
                      name: ''
                      description: ''
                    - value: '8'
                      name: ''
                      description: ''
                    - value: '12'
                      name: ''
                      description: ''
                  description: Use this field according to the endpoint schema.
                  example: '4'
                size:
                  type: string
                  enum:
                    - 720x1280
                    - 1280x720
                    - 1024x1792
                    - 1792x1024
                  x-apifox-enum:
                    - value: 720x1280
                      name: ''
                      description: ''
                    - value: 1280x720
                      name: ''
                      description: ''
                    - value: 1024x1792
                      name: ''
                      description: Use this field according to the endpoint schema.
                    - value: 1792x1024
                      name: ''
                      description: Use this field according to the endpoint schema.
                  description: Use this field according to the endpoint schema.
                  example: 1024x1792
                input_reference:
                  format: binary
                  type: string
                  description: Use this field according to the endpoint schema.
              required:
                - prompt
              default:
                prompt: cat
            example:
              prompt: cat
              model: sora-2
            examples:
              Default:
                summary: Default request
                value:
                  prompt: cat
                  model: sora-2
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                  - object
                  - created_at
                  - status
                  - completed_at
                  - error
                  - expires_at
                  - model
                  - progress
                  - remixed_from_video_id
                  - seconds
                  - size
                properties:
                  id:
                    type: string
                    description: Use this field according to the endpoint schema.
                  object:
                    type: string
                    description: Use this field according to the endpoint schema.
                  created_at:
                    type: integer
                    description: Use this field according to the endpoint schema.
                  status:
                    type: string
                    description: Use this field according to the endpoint schema.
                  completed_at:
                    type: 'null'
                    description: Use this field according to the endpoint schema.
                  error:
                    type: 'null'
                    description: Use this field according to the endpoint schema.
                  expires_at:
                    type: 'null'
                    description: Use this field according to the endpoint schema.
                  model:
                    type: string
                    description: Use this field according to the endpoint schema.
                  progress:
                    type: integer
                    description: Use this field according to the endpoint schema.
                  remixed_from_video_id:
                    type: 'null'
                    description: Use this field according to the endpoint schema.
                  seconds:
                    type: string
                    description: Use this field according to the endpoint schema.
                  size:
                    type: string
                    description: Use this field according to the endpoint schema.
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl -s 'https://api.deerapi.com/v1/videos' \
              -H "Authorization: Bearer $DEERAPI_KEY" \
              -F 'prompt=cat' \
              -F 'model=sora-2'
        - lang: Python
          label: requests
          source: >
            import os

            import requests


            url = "https://api.deerapi.com/v1/videos"

            headers = {"Authorization": "Bearer " + os.environ["DEERAPI_KEY"]}

            data = {
              "prompt": "cat",
              "model": "sora-2"
            }

            files = {}


            response = requests.post(url, headers=headers, data=data,
            files=files)

            print(response.json())
        - lang: JavaScript
          label: fetch
          source: |
            const form = new FormData();
            form.append("prompt", "cat");
            form.append("model", "sora-2");

            const response = await fetch("https://api.deerapi.com/v1/videos", {
              method: "POST",
              headers: { Authorization: `Bearer ${process.env.DEERAPI_KEY}` },
              body: form,
            });

            console.log(await response.json());
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Use a DeerAPI API Key as a Bearer token.

````