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

# Sora-2 動画生成

> - Sora 2 Preview (sora-2-preview) はテキストから動画、画像から動画などをサポートしています
- 非同期処理、返されたタスクIDを使用して[ステータスを照会](/ja/api-manual/task-management/get-task-detail)してください
- 生成された動画リンクは24時間有効です。速やかに保存してください

**注意:**
- Sora2 のコンテンツモデレーションは非常に厳格で、これによりタスクが失敗する場合があります
- 実在の人物の画像はサポートされていません



## OpenAPI

````yaml ja/api-manual/video-series/sora2/sora-2-preview-video-generate.json POST /v1/videos/generations
openapi: 3.1.0
info:
  title: Sora-2-Preview API
  description: AIモデルを使用して動画生成タスクを作成し、テキストから動画、画像から動画などをサポート
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.evolink.ai
    description: 本番環境
security:
  - bearerAuth: []
tags:
  - name: 動画生成
    description: AI動画生成API
paths:
  /v1/videos/generations:
    post:
      tags:
        - 動画生成
      summary: Sora-2-Preview API
      description: >-
        - Sora 2 Preview (sora-2-preview) はテキストから動画、画像から動画などをサポートしています

        -
        非同期処理、返されたタスクIDを使用して[ステータスを照会](/ja/api-manual/task-management/get-task-detail)してください

        - 生成された動画リンクは24時間有効です。速やかに保存してください


        **注意:**

        - Sora2 のコンテンツモデレーションは非常に厳格で、これによりタスクが失敗する場合があります

        - 実在の人物の画像はサポートされていません
      operationId: createVideoGeneration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoGenerationRequest'
            examples:
              text_to_video:
                summary: テキストから動画
                value:
                  model: sora-2-preview
                  prompt: A cat playing piano
      responses:
        '200':
          description: 動画生成タスクが正常に作成されました
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoGenerationResponse'
        '400':
          description: リクエストパラメータが不正です
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: invalid_request
                  message: Invalid request parameters
                  type: invalid_request_error
        '401':
          description: 未認証、トークンが無効または期限切れです
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: unauthorized
                  message: Invalid or expired token
                  type: authentication_error
        '402':
          description: クォータ不足のため、チャージが必要です
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: insufficient_quota
                  message: Insufficient quota. Please top up your account.
                  type: insufficient_quota
        '403':
          description: アクセスが拒否されました
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: model_access_denied
                  message: 'Token does not have access to model: sora-2-preview'
                  type: invalid_request_error
        '429':
          description: レート制限を超えました
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: rate_limit_exceeded
                  message: Too many requests, please try again later
                  type: rate_limit_error
        '500':
          description: サーバー内部エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: internal_error
                  message: Internal server error
                  type: api_error
components:
  schemas:
    VideoGenerationRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          description: 動画生成モデル名
          default: sora-2-preview
          example: sora-2-preview
        prompt:
          type: string
          description: 生成する動画を説明するプロンプト、最大5000トークン
          example: A cat playing piano
          maxLength: 5000
        aspect_ratio:
          type: string
          description: 動画のアスペクト比。`1280x720` は横長動画を生成、`720x1280` は縦長動画を生成
          enum:
            - 1280x720
            - 720x1280
            - '16:9'
            - '9:16'
          example: '16:9'
        duration:
          type: integer
          description: |-
            動画の長さ（秒）、デフォルト `4`

            **注意:**
            - `4`、`8`、`12` 秒のみサポート
            - 長い動画ほどコストが高くなります
          example: 4
        image_urls:
          type: array
          description: >-
            画像から動画用の参照画像URL


            **注意:**

            - 実在の人物の画像はサポートされていません

            - 1回のリクエストにつき最大1枚

            - 最大サイズ: 10MB

            - 形式: .jpg、.jpeg、.png、.webp

            - **画像のピクセル寸法は選択した aspect_ratio と完全に一致する必要があります**（例: aspect_ratio が
            `1280x720` の場合、アップロードする画像は正確に 1280x720 ピクセルである必要があります）

            - 画像URLはサーバーから直接アクセス可能であるか、アクセス時にダウンロードが開始される必要があります（通常、.png、.jpg
            などの画像拡張子で終わるURL）
          items:
            type: string
            format: uri
          maxItems: 1
          example:
            - http://example.com/image1.jpg
        callback_url:
          type: string
          description: >-
            タスク完了時のHTTPSコールバックURL


            **コールバックのタイミング:**

            - タスクが完了、失敗、またはキャンセルされた時にトリガーされます

            - 課金確認後に送信されます


            **セキュリティ制限:**

            - HTTPSプロトコルのみ

            -
            プライベートIPアドレスは許可されていません（127.0.0.1、10.x.x.x、172.16-31.x.x、192.168.x.x
            など）

            - URLの長さは最大2048文字


            **コールバックメカニズム:**

            - タイムアウト: 10秒

            - 失敗時最大3回リトライ（1秒/2秒/4秒間隔）

            - レスポンス形式はタスク照会APIと一致

            - 2xxステータスコード = 成功、その他のコードはリトライをトリガー
          format: uri
          example: https://your-domain.com/webhooks/video-task-completed
    VideoGenerationResponse:
      type: object
      properties:
        created:
          type: integer
          description: タスク作成タイムスタンプ
          example: 1757169743
        id:
          type: string
          description: タスク ID
          example: task-unified-1757169743-7cvnl5zw
        model:
          type: string
          description: 使用されたモデル名
          example: sora-2-preview
        object:
          type: string
          enum:
            - video.generation.task
          description: タスクタイプ
        progress:
          type: integer
          description: タスク進捗（0-100）
          minimum: 0
          maximum: 100
          example: 0
        status:
          type: string
          description: タスクステータス
          enum:
            - pending
            - processing
            - completed
            - failed
          example: pending
        task_info:
          $ref: '#/components/schemas/VideoTaskInfo'
        type:
          type: string
          enum:
            - text
            - image
            - audio
            - video
          description: 出力タイプ
          example: video
        usage:
          $ref: '#/components/schemas/VideoUsage'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: エラーコード識別子
            message:
              type: string
              description: エラーの説明
            type:
              type: string
              description: エラータイプ
    VideoTaskInfo:
      type: object
      properties:
        can_cancel:
          type: boolean
          description: タスクをキャンセルできるかどうか
          example: true
        estimated_time:
          type: integer
          description: 推定完了時間（秒）
          minimum: 0
          example: 300
        video_duration:
          type: integer
          description: 動画の長さ（秒）
          example: 9
    VideoUsage:
      type: object
      properties:
        billing_rule:
          type: string
          description: 課金ルール
          enum:
            - per_call
            - per_token
            - per_second
          example: per_call
        credits_reserved:
          type: number
          description: 推定クレジット
          minimum: 0
          example: 7
        user_group:
          type: string
          description: ユーザーグループカテゴリ
          example: default
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        ##すべてのAPIにBearer Token認証が必要です##

        **APIキーの取得：**

        [APIキー管理ページ](https://evolink.ai/dashboard/keys)にアクセスしてAPIキーを取得してください

        **リクエストヘッダーに追加：**
        ```
        Authorization: Bearer YOUR_API_KEY
        ```

````