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

# Create video · OpenAI video

> Submit a Seedance video task using OpenAI video, with examples, input limits and full parameters.

Use this format with an existing OpenAI SDK `client.videos` integration. It supports text or one first-frame image at 720p. Use [Ark / Seedance](/en/api/video-ark) for reference audio, multiple reference images and video editing.

## Setup

Set the OpenAI SDK base URL to `https://api.aiohub.org/v1` and supply your full AIOHub `sk-` API key. This is the video API, not Chat Completions or Responses.

## Example request

Replace `<AIOHUB_API_KEY>` with your full API key. Its group must include the Seedance model used here.

```bash theme={"system"}
curl https://api.aiohub.org/v1/videos \
  -H "Authorization: Bearer <AIOHUB_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedance-2-5-260628",
    "prompt": "A blue ceramic cup on a wooden table in daylight.",
    "seconds": "4",
    "size": "1280x720"
  }'
```

The creation response includes these fields. Save `id`; do not submit another creation request to check progress.

```json theme={"system"}
{"id": "task_example", "object": "video", "status": "queued", "progress": 0}
```

After saving the task identifier, [poll the task](/en/api/video-openai-get).

## Parameter limits

Use `application/json` for JSON requests and `multipart/form-data` with the `input_reference` field for file uploads. Crop or resize an image to match `size` before submitting.

<Accordion title="Complete SDK example">
  Install the `openai` SDK and set `AIOHUB_API_KEY` in your environment. These examples download only after generation succeeds.

  <CodeGroup>
    ```python Python theme={"system"}
    import os
    from openai import OpenAI

    client = OpenAI(api_key=os.environ["AIOHUB_API_KEY"], base_url="https://api.aiohub.org/v1")

    video = client.videos.create(
        model="doubao-seedance-2-5-260628",
        prompt="A blue ceramic cup on a wooden table in daylight, slow camera push-in.",
        seconds="4",
        size="1280x720",
    )
    video = client.videos.poll(video.id)
    if video.status != "completed":
        raise RuntimeError(f"Video generation failed: {video.error}")
    with open("video.mp4", "wb") as f:
        f.write(client.videos.download_content(video.id).read())
    ```

    ```typescript TypeScript theme={"system"}
    import OpenAI from "openai";

    const client = new OpenAI({ apiKey: process.env.AIOHUB_API_KEY, baseURL: "https://api.aiohub.org/v1" });

    let video = await client.videos.create({
      model: "doubao-seedance-2-5-260628",
      prompt: "A blue ceramic cup on a wooden table in daylight, slow camera push-in.",
      seconds: "4",
      size: "1280x720",
    });
    while (video.status !== "completed" && video.status !== "failed") {
      await new Promise((r) => setTimeout(r, 15000));
      video = await client.videos.retrieve(video.id);
    }
    if (video.status !== "completed") {
      throw new Error(JSON.stringify(video.error));
    }
    const bytes = await (await client.videos.downloadContent(video.id)).arrayBuffer();
    ```
  </CodeGroup>
</Accordion>

<Note>If creation times out without a task identifier, check the [usage log](https://api.aiohub.org/console/log) before resubmitting to avoid duplicate generation and charges. Correct parameters after a 400 and check the API key after a 401. See [Authentication](/en/api/authentication) for access and quota requirements.</Note>


## OpenAPI

````yaml openapi/relay.en.json POST /v1/videos
openapi: 3.0.1
info:
  title: AIOHub API
  description: AIOHub public API
  version: 1.0.0
servers:
  - url: https://api.aiohub.org
security:
  - BearerAuth: []
tags:
  - name: List models
  - name: OpenAI Chat
  - name: OpenAI Responses
  - name: Image generation
  - name: OpenAI Images
  - name: Video generation
  - name: Claude Messages
  - name: Gemini API
  - name: OpenAI Embeddings
  - name: Text completions
  - name: OpenAI Audio
  - name: Realtime API
paths:
  /v1/videos:
    post:
      tags:
        - Video generation
      summary: Create video
      description: >
        OpenAI-compatible video generation endpoint. Works with the OpenAI SDK
        `videos` client.


        Seedance models generate 720p video through this endpoint: `seconds` is
        `"4"`, `"8"` or `"12"` (default `"4"`), `size` is `"1280x720"` or
        `"720x1280"` (default), and the optional `input_reference` is a
        first-frame image whose pixel size must equal `size`. For reference
        images, audio, video edit, 1080p or 4k, longer clips or other aspect
        ratios, use the task endpoints described in [Ark /
        Seedance](/en/api/video-ark).


        Reference: https://platform.openai.com/docs/api-reference/videos/create
      operationId: createVideo
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - prompt
              properties:
                model:
                  type: string
                  example: doubao-seedance-2-5-260628
                  description: Model name
                prompt:
                  type: string
                  example: >-
                    A blue ceramic cup on a wooden table in daylight, slow
                    camera push-in.
                  description: Prompt
                seconds:
                  type: string
                  example: '4'
                  description: Duration in seconds
                size:
                  type: string
                  example: 1280x720
                  description: Video size
                input_reference:
                  type: string
                  example: https://example.com/first.png
                  description: First-frame image as an HTTPS URL or data URL
            examples:
              text:
                summary: Text to video
                value:
                  model: doubao-seedance-2-5-260628
                  prompt: A blue ceramic cup on a wooden table in daylight.
                  seconds: '4'
                  size: 1280x720
          multipart/form-data:
            schema:
              type: object
              properties:
                model:
                  type: string
                  example: doubao-seedance-2-5-260628
                  description: Model name
                prompt:
                  description: Prompt
                  example: cute cat dance
                  type: string
                seconds:
                  type: string
                  example: '4'
                  description: Duration in seconds
                input_reference:
                  format: binary
                  type: string
                  description: Reference image file
                  example: ''
                size:
                  type: string
                  example: 1280x720
                  description: >-
                    Video size. Seedance models accept `1280x720` and
                    `720x1280`.
            examples: {}
      responses:
        '200':
          description: Video task created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Video ID
                  object:
                    type: string
                    description: Object type
                  model:
                    type: string
                    description: Model used
                  status:
                    type: string
                    description: Task status
                  progress:
                    type: integer
                    description: Progress percentage
                  created_at:
                    type: integer
                    description: Creation timestamp
                  seconds:
                    type: string
                    description: Video duration
                  completed_at:
                    type: integer
                    description: Completion timestamp
                  expires_at:
                    type: integer
                    description: Expiration timestamp
                  size:
                    type: string
                    description: Video size
                  error:
                    $ref: '#/components/schemas/OpenAIVideoError'
                  metadata:
                    type: object
                    description: Additional metadata
                    additionalProperties: true
                    properties: {}
                required:
                  - id
                  - object
                  - model
                  - status
                  - progress
                  - created_at
                  - seconds
              example:
                id: task_ADQ5XK6AKWg36WePoJ3sZRyDvWl1ogGZ
                object: video
                model: doubao-seedance-2-5-260628
                status: queued
                progress: 0
                created_at: 1791275108
                seconds: '4'
                size: 1280x720
          headers: {}
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers: {}
      deprecated: false
      security:
        - BearerAuth: []
components:
  schemas:
    OpenAIVideoError:
      type: object
      description: OpenAI video error information
      properties:
        message:
          type: string
          description: Error message
        code:
          type: string
          description: Error code
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: Error message
            type:
              type: string
              description: Error type
            param:
              type: string
              description: Related parameters
              nullable: true
            code:
              type: string
              description: Error code
              nullable: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key (sk-xxx)

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.