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

# OpenAI SDK — videos.create (async)



## OpenAPI

````yaml mountsea-api.mint.json POST /ms/v1/videos
openapi: 3.0.0
info:
  title: mountsea-api
  description: >-
    mountsea unified AI API — video, image, and audio generation.


    ### Async task flow

    1. `POST /ms/v1/run/{endpoint_slug}` — submit a job (returns Task with
    `status: queued`).

    2. `GET /ms/v1/tasks/{task_id}` — poll until `succeeded` (`output.images` /
    `output.videos` / `output.audio`) or `failed`/`timeout` (`error`).
       Or pass `webhook_url` in the submit body for a signed terminal callback (`x-ms-signature`).
    3. `GET /ms/v1/endpoints[/{slug}]` — marketplace listing with
    `input_schema`, `output_schema`, and `examples`.


    ### Request body

    - `{ "input": { ... } }` — all parameters and media URLs per endpoint
    `input_schema`.

    - Optional `webhook_url` for callbacks.


    ### SDK compatibility (optional)

    Prefer the native async API above? Skip this section.


    - **OpenAI SDK** — `baseURL = https://{gateway}/ms/v1`
      - Image (sync): `POST /ms/v1/images/generations|edits` — gpt-image-2 family
      - Video (async): `POST /ms/v1/videos` + `GET /ms/v1/videos/{id}` — sora-2 → Veo lite/pro slugs
    - **Gemini SDK** — `httpOptions.baseUrl = https://{gateway}/ms`
      - Image (sync): `POST /ms/v1beta/models/{model}:generateContent` — nano-banana family
      - Video (async): `POST /ms/v1beta/models/{model}:predictLongRunning` + poll `GET /ms/v1beta/operations/{task_id}`

    Unsupported `model` → **HTTP 400** before any task is created (no charge).

    Successful calls bill the **same endpoint slug** as the equivalent
    `/ms/v1/run/...` API.
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.mountsea.ai
    description: API Gateway
security: []
tags:
  - name: Run
    description: Submit async tasks by endpoint slug
  - name: Tasks
    description: Poll or cancel tasks
  - name: Endpoints (marketplace)
    description: Endpoint catalog and schemas
  - name: SDK Compatibility
    description: >-
      OpenAI / Gemini official SDK — sync image APIs (same billing as native
      run)
  - name: Admin - Catalog (internal)
    description: Internal admin (swagger only, not public gateway)
paths:
  /ms/v1/videos:
    post:
      tags:
        - SDK Compatibility
      summary: OpenAI SDK — videos.create (async)
      description: >-
        OpenAI SDK async video jobs (`client.videos.create` / `retrieve`).


        ```ts

        const job = await client.videos.create({
          model: 'sora-2',
          prompt: 'Ocean waves at sunset',
          seconds: '8',
          size: '1280x720',
        });

        ```


        **Supported models**:

        - `sora-2`

        - `sora-2-pro`


        `sora-2` maps to `google/veo-3.1/lite/text-to-video`; `sora-2-pro` maps
        to `google/veo-3.1/text-to-video`.

        Job `id` is the mountsea `task_id`. Poll with `videos.retrieve(id)`.
      operationId: openaiVideosCreate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpenAiVideoCreateRequest'
            example:
              model: sora-2
              prompt: Ocean waves at sunset
              seconds: '8'
              size: 1280x720
      responses:
        '200':
          $ref: '#/components/responses/OpenAiVideoJobResponse'
        '400':
          $ref: '#/components/responses/BadRequestResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    OpenAiVideoCreateRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          example: sora-2
        prompt:
          type: string
        seconds:
          type: string
          example: '8'
        size:
          type: string
          example: 1280x720
    OpenAiVideoJob:
      type: object
      properties:
        id:
          type: string
          example: ms-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
        object:
          type: string
          example: video
        model:
          type: string
        status:
          type: string
          enum:
            - queued
            - processing
            - completed
            - failed
        progress:
          type: integer
          nullable: true
        created_at:
          type: integer
    ErrorBody:
      type: object
      properties:
        statusCode:
          type: integer
          example: 400
        message:
          type: string
        error:
          type: string
  responses:
    OpenAiVideoJobResponse:
      description: OpenAI Video job (status=queued)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OpenAiVideoJob'
    BadRequestResponse:
      description: Validation failed or unsupported model
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````