openapi: 3.0.3
info:
  title: API Documentation
  version: 1.5.17
servers:
- url: 'https://api.imarouter.com'
tags:
- name: Seedance Video
- name: MiniMax Video
- name: Kling Video
- name: Vidu Video
- name: Doubao Subtitle Erase
- name: Gemini Images
- name: GPT Image
- name: Doubao Seedream
- name: Wan Images
- name: Wan2.6 Video
- name: HappyHorse Video
- name: Midjourney
- name: Portrait
- name: Chat
- name: Usage
- name: Music
- name: Pixverse Video
- name: Veo Video
- name: Seed TTS Speech
- name: PrunaAI Images
security:
- BearerAuth: []
paths:
  /api/usage/token/user-balance:
    get:
      tags:
      - Usage
      summary: Query the current user's consumable balance by SK (USD)
      description: 'Use `Authorization: Bearer sk-...` to query the consumable USD balance for the user that owns the current
        SK.


        **Returned values**

        - `balance_usd`: current available USD-equivalent balance.

        - `used_amount_usd`: cumulative USD-equivalent usage.


        **Typical use cases**

        - Let API clients query how much USD-equivalent balance remains for the current account through SK.

        - Keep the external display consistent with the site balance shown in USD.

        '
      operationId: getUserBalanceByToken
      responses:
        '200':
          description: Query succeeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: ''
                  data:
                    type: object
                    properties:
                      object:
                        type: string
                        example: user_balance
                      user_id:
                        type: integer
                        example: 1001
                      username:
                        type: string
                        example: demo-user
                      quota:
                        type: integer
                        example: 1250000
                      used_quota:
                        type: integer
                        example: 250000
                      balance_usd:
                        type: number
                        format: double
                        example: 2.5
                      used_amount_usd:
                        type: number
                        format: double
                        example: 0.5
                      quota_per_unit:
                        type: number
                        format: double
                        example: 500000
                      currency:
                        type: string
                        example: USD
              examples:
                success:
                  summary: Return the current user's consumable balance (USD)
                  value:
                    success: true
                    message: ''
                    data:
                      object: user_balance
                      user_id: 1001
                      username: demo-user
                      quota: 1250000
                      used_quota: 250000
                      balance_usd: 2.5
                      used_amount_usd: 0.5
                      quota_per_unit: 500000
                      currency: USD
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
      - lang: curl-get-api-usage-token-user-balance
        label: Query the current user's consumable balance by SK (USD)
        source: "curl https://api.imarouter.com/api/usage/token/user-balance \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'"
  /v1/music/generations:
    post:
      tags:
      - Music
      summary: Create a music generation task
      description: 'Submit a `sonic` text-to-music task through the generic music endpoint.


        **Actual request path:** `POST /v1/music/generations`


        **Supported model:**

        - `sonic`


        **Parameters:**

        - `prompt`: required, up to 5000 characters

        - `custom_mode`: optional, defaults to `true`

        - `model_version`: optional, defaults to `sonic-v4`; supported values are `sonic-v3-5`, `sonic-v4`, `sonic-v4-5`,
        `sonic-v4-5-plus`, and `sonic-v5`

        - `auto_lyrics`, `make_instrumental`, `gpt_description_prompt`, `negative_tags`, `style_weight`, `tags`, `title`,
        `vocal_gender`, and `weirdness_constraint`: optional extended parameters


        **Result lookup:**

        - After successful submission, the response returns a task ID. Use `GET /v1/music/generations/{task_id}` to query
        status and music results.

        '
      operationId: createMusicGenerationTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImaMusicCreateTaskRequest'
            examples:
              sonic_basic:
                summary: sonic basic text-to-music
                value:
                  model: sonic
                  prompt: Bright synth-pop with a catchy chorus
              sonic_custom:
                summary: sonic custom parameters
                value:
                  model: sonic
                  prompt: A cinematic electronic track with soft female vocals
                  custom_mode: false
                  model_version: sonic-v5
                  tags: electronic, cinematic
                  title: Neon Skyline
                  vocal_gender: f
                  style_weight: 0
                  weirdness_constraint: 0
      responses:
        '200':
          description: Submission successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaMusicCreateTaskResponse'
              examples:
                task_submitted:
                  summary: Music task accepted
                  value:
                    id: task_music_202605130001
                    task_id: task_music_202605130001
                    object: music
                    model: sonic
                    status: submitted
                    progress: 0
                    created_at: 1778640000
        '400':
          description: Parameter error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-sonic-basic
        label: sonic basic text-to-music
        source: "curl https://api.imarouter.com/v1/music/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"sonic\",\n\
          \  \"prompt\": \"Bright synth-pop with a catchy chorus\"\n}'"
      - lang: curl-sonic-custom
        label: sonic custom parameters
        source: "curl https://api.imarouter.com/v1/music/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"sonic\",\n\
          \  \"prompt\": \"A cinematic electronic track with soft female vocals\",\n  \"custom_mode\": false,\n  \"model_version\"\
          : \"sonic-v5\",\n  \"tags\": \"electronic, cinematic\",\n  \"title\": \"Neon Skyline\",\n  \"vocal_gender\": \"\
          f\",\n  \"style_weight\": 0,\n  \"weirdness_constraint\": 0\n}'"
  /v1/music/generations/{task_id}:
    get:
      tags:
      - Music
      summary: Query music task status and results
      description: 'Query a music task submitted with `POST /v1/music/generations`. On success, `data.data` returns an array
        of music results.


        If music result URLs are returned, download and persist them promptly.'
      operationId: fetchMusicGenerationTask
      parameters:
      - in: path
        name: task_id
        required: true
        schema:
          type: string
        description: Task ID returned by the create endpoint.
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaMusicTaskFetchResponse'
              examples:
                pending:
                  summary: Processing
                  value:
                    code: success
                    data:
                      task_id: task_music_202605130001
                      status: processing
                      data: []
                      error: null
                success:
                  summary: Succeeded with multiple music results
                  value:
                    code: success
                    data:
                      task_id: task_music_202605130001
                      status: succeeded
                      data:
                      - url: https://cdn.example.com/music/sonic-a.mp3
                        audio_url: https://cdn.example.com/music/sonic-a.mp3
                        title: Neon Skyline A
                        lyrics: Sample lyric text
                        duration: 180
                        metadata:
                          model_version: sonic-v5
                      - url: https://cdn.example.com/music/sonic-b.mp3
                        audio_url: https://cdn.example.com/music/sonic-b.mp3
                        title: Neon Skyline B
                        lyrics: Sample lyric text
                        duration: 182
                        metadata:
                          model_version: sonic-v5
                      amount_usd: 0.15
                      error: null
                failed:
                  summary: Failed
                  value:
                    code: success
                    data:
                      task_id: task_music_202605130001
                      status: failed
                      data: []
                      error:
                        message: task failed
        '400':
          description: Parameter error, such as a missing task_id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-get-v1-music-generations-task-id
        label: Query music task status and results
        source: "curl https://api.imarouter.com/v1/music/generations/task_202604270001 \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN'"
  /v1/audio/speech:
    post:
      tags:
      - Seed TTS Speech
      summary: Create a Seed TTS speech task
      description: 'Submit a `seed-tts-2.0` speech synthesis task through the OpenAI-compatible `POST /v1/audio/speech` endpoint.


        **Actual request path:** `POST /v1/audio/speech`


        **Supported model:**

        - `seed-tts-2.0`


        **Parameters:**

        - `input` / `text` / `prompt` / `ssml`: provide at least one text input, up to 10000 characters

        - `voice` / `speaker`: one is required

        - `response_format`: optional, defaults to `mp3`

        - `speed`: optional speech speed multiplier


        **Result lookup:**

        - After successful submission, the response returns a task ID. Use `GET /v1/audio/speech/{task_id}` to query status
        and audio results.

        '
      operationId: createSeedTtsSpeechTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SeedTtsSpeechCreateRequest'
            examples:
              seed_tts_input_voice:
                summary: input + voice example
                value:
                  model: seed-tts-2.0
                  input: 你好，欢迎使用异步语音合成。
                  voice: zh_female_shuangkuaisisi_uranus
                  response_format: mp3
              seed_tts_ssml_speaker:
                summary: SSML + speaker example
                value:
                  model: seed-tts-2.0
                  ssml: <speak>你好，欢迎使用异步语音合成。</speak>
                  speaker: zh_female_shuangkuaisisi_uranus
      responses:
        '200':
          description: Submission successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedTtsSpeechCreateResponse'
              examples:
                task_submitted:
                  summary: Return speech task ID
                  value:
                    id: task_seed_tts_202605260001
                    task_id: task_seed_tts_202605260001
                    object: audio.speech
                    model: seed-tts-2.0
                    status: submitted
                    progress: 0
                    created_at: 1779720000
        '400':
          description: Parameter error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-seed-tts-input-voice
        label: input + voice example
        source: "curl https://api.imarouter.com/v1/audio/speech \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seed-tts-2.0\"\
          ,\n  \"input\": \"你好，欢迎使用异步语音合成。\",\n  \"voice\": \"zh_female_shuangkuaisisi_uranus\",\n  \"response_format\": \"\
          mp3\"\n}'"
      - lang: curl-seed-tts-ssml-speaker
        label: SSML + speaker example
        source: "curl https://api.imarouter.com/v1/audio/speech \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seed-tts-2.0\"\
          ,\n  \"ssml\": \"<speak>你好，欢迎使用异步语音合成。</speak>\",\n  \"speaker\": \"zh_female_shuangkuaisisi_uranus\"\n}'"
  /v1/audio/speech/{task_id}:
    get:
      tags:
      - Seed TTS Speech
      summary: Query a Seed TTS speech task
      description: 'Query the `seed-tts-2.0` speech task submitted through `POST /v1/audio/speech`.


        A successful response returns task status, audio format, audio URL, and usage information when available.'
      operationId: getSeedTtsSpeechTask
      parameters:
      - in: path
        name: task_id
        required: true
        schema:
          type: string
        description: Speech task ID returned by the create endpoint.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedTtsSpeechFetchResponse'
              examples:
                queued:
                  summary: Queued
                  value:
                    code: success
                    data:
                      task_id: task_seed_tts_202605260001
                      status: queued
                      format: mp3
                      url: ''
                      error: null
                      usage:
                        count: 0
                succeeded:
                  summary: Success
                  value:
                    code: success
                    data:
                      task_id: task_seed_tts_202605260001
                      status: succeeded
                      format: mp3
                      url: https://cdn.example.com/audio/seed-tts-result.mp3
                      amount_usd: 0.003
                      error: null
                      usage:
                        count: 80
                failed:
                  summary: Failed
                  value:
                    code: success
                    data:
                      task_id: task_seed_tts_202605260001
                      status: failed
                      format: mp3
                      url: ''
                      error:
                        message: task failed
                      usage:
                        count: 0
        '400':
          description: Parameter error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-get-v1-audio-speech-task-id
        label: Query a Seed TTS speech task
        source: "curl https://api.imarouter.com/v1/audio/speech/task_202604270001 \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'"
  /v1/images/generations:
    post:
      tags:
      - Gemini Images
      summary: Generate Gemini images
      description: 'OpenAI Images compatible endpoint.


        **Actual request path:** `POST /v1/images/generations`


        Supported image model families:

        - Gemini Images: `gemini-2.5-flash-image`, `gemini-3-pro-image-preview`, `gemini-3.1-flash-image-preview`

        - GPT Image: `gpt-image-2`

        - Doubao Seedream: `doubao-seedream-4-5-251128`, `doubao-seedream-5-0-lite-260128`

        - Wan Images: `wan2.6-t2i`, `wan2.6-image`, `wan2.7-image`, `wan2.7-image-pro`

        - PrunaAI Images: `prunaai/p-image`, `prunaai/p-image-edit`

        - `gemini-3-pro-preview` (text-to-text) is not supported here


        This page shows the Gemini image request body.

        - `prompt`: required, up to 10000 characters

        - `aspect_ratio`: optional, validated by model-specific enum

        - `size`: optional; `gemini-3-pro-image-preview` supports `1K/2K/4K`, and `gemini-2.5-flash-image` / `gemini-3.1-flash-image-preview`
        also support `512px`

        - `image` / `images`: optional for image-to-image, up to 14 images

        - Input image URL file types: `jpg/png`


        After successful submission, the response returns a task ID. Use `GET /v1/images/generations/{task_id}` to query status
        and results.


        **IMPORTANT NOTICE (MUST READ)**

        - The 30-day expiration rule only applies to image result URLs returned by the API; it does not mean input `image`
        / `images` URLs are actively expired by the platform.

        - Image result URLs are short-term platform-hosted links. Download and persist them promptly; they expire after about
        30 days by default.'
      operationId: createImageGenerationTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GeminiImageGenerationRequest'
            examples:
              gemini3_pro_text_to_image:
                summary: gemini-3-pro-image-preview text-to-image (16:9, 2K)
                value:
                  model: gemini-3-pro-image-preview
                  prompt: a futuristic city at sunset
                  aspect_ratio: '16:9'
                  size: 2K
              gemini3_pro_single_image_to_image:
                summary: gemini-3-pro-image-preview single-image image-to-image (`image` field)
                value:
                  model: gemini-3-pro-image-preview
                  prompt: convert to cinematic film still style
                  image: https://example.com/source.jpg
                  aspect_ratio: '4:3'
                  size: 1K
              gemini3_pro_multi_image_to_image:
                summary: gemini-3-pro-image-preview multi-image image-to-image (`images` field)
                value:
                  model: gemini-3-pro-image-preview
                  prompt: blend these references into one product poster
                  images:
                  - https://example.com/ref-1.jpg
                  - https://example.com/ref-2.png
                  aspect_ratio: '3:2'
                  size: 4K
              gemini31_flash_image_to_image:
                summary: gemini-3.1-flash-image-preview image-to-image (1:1, 1K)
                value:
                  model: gemini-3.1-flash-image-preview
                  prompt: turn this into watercolor style
                  images:
                  - https://example.com/input.jpg
                  aspect_ratio: '1:1'
                  size: 1K
              gemini31_flash_text_to_image_512:
                summary: gemini-3.1-flash-image-preview text-to-image (512px)
                value:
                  model: gemini-3.1-flash-image-preview
                  prompt: minimalist icon set for weather app
                  aspect_ratio: '1:1'
                  size: 512px
              gemini25_flash_text_to_image:
                summary: gemini-2.5-flash-image text-to-image (21:9, 4K)
                value:
                  model: gemini-2.5-flash-image
                  prompt: compact watercolor postcard of a mountain village
                  aspect_ratio: '21:9'
                  size: 4K
              gemini25_flash_image_to_image:
                summary: gemini-2.5-flash-image image-to-image (1:1, 1K)
                value:
                  model: gemini-2.5-flash-image
                  prompt: convert this reference into a clean editorial illustration
                  images:
                  - https://example.com/reference.png
                  aspect_ratio: '1:1'
                  size: 1K
      responses:
        '200':
          description: Submission successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaImageCreateTaskResponse'
              examples:
                task_submitted:
                  summary: Return task ID
                  value:
                    id: task_202603200001
                    task_id: task_202603200001
                    object: image
                    model: gemini-3.1-flash-image-preview
                    status: queued
                    progress: 0
                    created_at: 1774000000
        '400':
          description: Parameter error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
      - lang: curl-gemini3-pro-text-to-image
        label: gemini-3-pro-image-preview text-to-image (16:9, 2K)
        source: "curl https://api.imarouter.com/v1/images/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gemini-3-pro-image-preview\"\
          ,\n  \"prompt\": \"a futuristic city at sunset\",\n  \"aspect_ratio\": \"16:9\",\n  \"size\": \"2K\"\n}'"
      - lang: curl-gemini3-pro-single-image-to-image
        label: gemini-3-pro-image-preview single-image image-to-image (`image` field)
        source: "curl https://api.imarouter.com/v1/images/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gemini-3-pro-image-preview\"\
          ,\n  \"prompt\": \"convert to cinematic film still style\",\n  \"image\": \"https://example.com/source.jpg\",\n\
          \  \"aspect_ratio\": \"4:3\",\n  \"size\": \"1K\"\n}'"
      - lang: curl-gemini3-pro-multi-image-to-image
        label: gemini-3-pro-image-preview multi-image image-to-image (`images` field)
        source: "curl https://api.imarouter.com/v1/images/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gemini-3-pro-image-preview\"\
          ,\n  \"prompt\": \"blend these references into one product poster\",\n  \"images\": [\n    \"https://example.com/ref-1.jpg\"\
          ,\n    \"https://example.com/ref-2.png\"\n  ],\n  \"aspect_ratio\": \"3:2\",\n  \"size\": \"4K\"\n}'"
      - lang: curl-gemini31-flash-image-to-image
        label: gemini-3.1-flash-image-preview image-to-image (1:1, 1K)
        source: "curl https://api.imarouter.com/v1/images/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gemini-3.1-flash-image-preview\"\
          ,\n  \"prompt\": \"turn this into watercolor style\",\n  \"images\": [\n    \"https://example.com/input.jpg\"\n\
          \  ],\n  \"aspect_ratio\": \"1:1\",\n  \"size\": \"1K\"\n}'"
      - lang: curl-gemini31-flash-text-to-image-512
        label: gemini-3.1-flash-image-preview text-to-image (512px)
        source: "curl https://api.imarouter.com/v1/images/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gemini-3.1-flash-image-preview\"\
          ,\n  \"prompt\": \"minimalist icon set for weather app\",\n  \"aspect_ratio\": \"1:1\",\n  \"size\": \"512px\"\n\
          }'"
      - lang: curl-gemini25-flash-text-to-image
        label: gemini-2.5-flash-image text-to-image (21:9, 4K)
        source: "curl https://api.imarouter.com/v1/images/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gemini-2.5-flash-image\"\
          ,\n  \"prompt\": \"compact watercolor postcard of a mountain village\",\n  \"aspect_ratio\": \"21:9\",\n  \"size\"\
          : \"4K\"\n}'"
      - lang: curl-gemini25-flash-image-to-image
        label: gemini-2.5-flash-image image-to-image (1:1, 1K)
        source: "curl https://api.imarouter.com/v1/images/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gemini-2.5-flash-image\"\
          ,\n  \"prompt\": \"convert this reference into a clean editorial illustration\",\n  \"images\": [\n    \"https://example.com/reference.png\"\
          \n  ],\n  \"aspect_ratio\": \"1:1\",\n  \"size\": \"1K\"\n}'"
  /v1/images/generations/{task_id}:
    get:
      tags:
      - Gemini Images
      summary: Query Gemini image task
      description: 'Query the task submitted through `POST /v1/images/generations`.

        If `amount_usd` appears in a successful response, it is the USD amount for the completed image task.

        **IMPORTANT NOTICE (MUST READ)**

        - The 30-day expiration rule only applies to the image result URL returned by the API; it does not mean input `image`
        / `images` URLs are actively expired by the platform.

        - If an image result URL is returned, download and persist it promptly; the platform does not guarantee long-term
        accessibility, and it expires after about 30 days by default.'
      operationId: fetchImageGenerationTask
      parameters:
      - in: path
        name: task_id
        required: true
        schema:
          type: string
        description: Submit the task ID returned by the creation interface.
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaImageTaskFetchResponse'
              examples:
                pending:
                  summary: Processing
                  value:
                    code: success
                    data:
                      task_id: task_202603200001
                      status: processing
                      format: png
                      url: ''
                      usage:
                        input_tokens: 9
                        output_tokens: 0
                        total_tokens: 9
                      error: null
                      metadata: null
                success:
                  summary: success
                  value:
                    code: success
                    data:
                      task_id: task_202603200001
                      status: succeeded
                      format: png
                      url: https://cdn.example.com/gen/abc123.png
                      amount_usd: 0.032
                      usage:
                        input_tokens: 9
                        output_tokens: 1505
                        total_tokens: 1514
                      error: null
                      metadata: null
                failed:
                  summary: fail
                  value:
                    code: success
                    data:
                      task_id: task_202603200001
                      status: failed
                      format: png
                      url: ''
                      usage:
                        input_tokens: 9
                        output_tokens: 0
                        total_tokens: 9
                      error:
                        message: task failed
                      metadata: null
        '400':
          description: Parameter error (such as task_id does not exist)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
      - lang: curl-get-v1-images-generations-task-id
        label: Query Gemini image task
        source: "curl https://api.imarouter.com/v1/images/generations/task_202604270001 \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN'"
  /v1/images/generations#gpt-image:
    post:
      tags:
      - GPT Image
      summary: Generate images (gpt-image-2)
      description: 'The OpenAI Images compatible submission endpoint for gpt-image-2. This document entry shows the `POST
        /v1/images/generations` request body under the gpt-image category.


        **Actual request path:** `POST /v1/images/generations`


        **Supported model:**

        - `gpt-image-2`


        **Parameters:**

        - `prompt`: required

        - `size`: optional

        - `quality`: optional

        - `image` / `images`: optional; with image input and no `mask`, the request is treated as `image_to_image`

        - `mask`: optional; with image input and `mask`, the request is treated as `image_edit`

        - Optional extended fields: `background`, `input_fidelity`, `moderation`, `n`, `output_compression`, `output_format`


        **IMPORTANT NOTICE (MUST READ)**

        - The 30-day expiration rule only applies to the image result URL returned by the API; it does not mean input `image`
        / `images` URLs are actively expired by the platform.

        - Image result URLs are short-term platform-hosted links. Download and persist them promptly; they expire after about
        30 days by default.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GptImage2ImageGenerationRequest'
            examples:
              gpt_image_2_text_to_image:
                summary: gpt-image-2 text-to-image
                value:
                  model: gpt-image-2
                  prompt: generate a glossy product hero image for a smartwatch
                  size: 1024x1024
                  quality: high
                  background: transparent
                  output_format: png
              gpt_image_2_image_edit:
                summary: gpt-image-2 image edit (with mask)
                value:
                  model: gpt-image-2
                  prompt: replace the background with a clean studio backdrop
                  images:
                  - https://example.com/input.png
                  mask: https://example.com/mask.png
                  size: 1536x1024
                  quality: high
                  input_fidelity: high
                  moderation: low
                  output_format: png
      responses:
        '200':
          description: Submission successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaImageCreateTaskResponse'
              examples:
                gpt_image_2_task_submitted:
                  summary: gpt-image-2 returned task ID
                  value:
                    id: task_gpt_image_2_202604230001
                    task_id: task_gpt_image_2_202604230001
                    object: image
                    model: gpt-image-2
                    status: queued
                    progress: 0
                    created_at: 1776952800
        '400':
          description: Parameter error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-gpt-image-2-text-to-image
        label: gpt-image-2 text-to-image
        source: "curl https://api.imarouter.com/v1/images/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gpt-image-2\"\
          ,\n  \"prompt\": \"generate a glossy product hero image for a smartwatch\",\n  \"size\": \"1024x1024\",\n  \"quality\"\
          : \"high\",\n  \"background\": \"transparent\",\n  \"output_format\": \"png\"\n}'"
      - lang: curl-gpt-image-2-image-edit
        label: gpt-image-2 image edit (with mask)
        source: "curl https://api.imarouter.com/v1/images/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gpt-image-2\"\
          ,\n  \"prompt\": \"replace the background with a clean studio backdrop\",\n  \"images\": [\n    \"https://example.com/input.png\"\
          \n  ],\n  \"mask\": \"https://example.com/mask.png\",\n  \"size\": \"1536x1024\",\n  \"quality\": \"high\",\n  \"\
          input_fidelity\": \"high\",\n  \"moderation\": \"low\",\n  \"output_format\": \"png\"\n}'"
  /v1/images/generations/{task_id}#gpt-image:
    get:
      tags:
      - GPT Image
      summary: Query image task status and results (gpt-image-2)
      description: 'The OpenAI Images compatible fetch endpoint for gpt-image-2. This document entry shows `GET /v1/images/generations/{task_id}`
        under the gpt-image category.


        **Actual request path:** `GET /v1/images/generations/{task_id}`


        If `amount_usd` appears in a successful response, it is the USD amount for the completed image task.


        **IMPORTANT NOTICE (MUST READ)**

        - The 30-day expiration rule only applies to the image result URL returned by the API; it does not mean input `image`
        / `images` URLs are actively expired by the platform.

        - If an image result URL is returned, download and persist it promptly; the platform does not guarantee long-term
        accessibility, and it expires after about 30 days by default.'
      parameters:
      - in: path
        name: task_id
        required: true
        schema:
          type: string
        description: Submit the task ID returned by the creation interface.
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaImageTaskFetchResponse'
              examples:
                gpt_image_2_success:
                  summary: gpt-image-2 success
                  value:
                    code: success
                    data:
                      task_id: task_gpt_image_2_202604230001
                      status: succeeded
                      format: png
                      url: https://cdn.example.com/gen/gpt-image-2-abc123.png
                      amount_usd: 0.084
                      usage:
                        input_tokens: 120
                        output_tokens: 840
                        total_tokens: 960
                      error: null
                      metadata: null
        '400':
          description: Parameter error (such as task_id does not exist)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-get-v1-images-generations-task-id
        label: Query image task status and results (gpt-image-2)
        source: "curl https://api.imarouter.com/v1/images/generations/task_202604270001 \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN'"
  /v1/images/generations#doubao-seedream:
    post:
      tags:
      - Doubao Seedream
      summary: Generate images (doubao-seedream-5-0-lite-260128)
      description: 'OpenAI Images compatible submission endpoint for Seedream 5.0 models. This entry shows the `POST /v1/images/generations`
        request body under the Doubao Seedream category.


        **Actual request path:** `POST /v1/images/generations`


        **Supported models:**

        - `doubao-seedream-5-0-lite-260128`

        - `seedream-5-0-260128`


        **Parameters:**

        - `prompt`: required, up to 600 characters

        - `size`: optional; supported values are `2K`, `3K`, `2048x2048`, `2304x1728`, `1728x2304`, `2848x1600`, `1600x2848`,
        `2496x1664`, `1664x2496`, `3136x1344`, `3072x3072`, `3456x2592`, `2592x3456`, `4096x2304`, `2304x4096`, `2496x3744`,
        `3744x2496`, `4704x2016`

        - `image` / `images`: optional; with image input the request is treated as image-to-image, up to 14 images

        - `output_format`: optional, only `jpeg` and `png` are supported

        - `optimize_prompt_options.mode`: optional, currently only `standard` is supported


        After successful submission, the response returns a task ID. Use `GET /v1/images/generations/{task_id}` to query status
        and results.


        **IMPORTANT NOTICE (MUST READ)**

        - The 30-day expiration rule only applies to image result URLs returned by the API; it does not mean input `image`
        / `images` URLs are actively expired by the platform.

        - Image result URLs are short-term platform-hosted links. Download and persist them promptly; they expire after about
        30 days by default.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DoubaoSeedream50LiteImageGenerationRequest'
            examples:
              doubao_seedream_text_to_image:
                summary: doubao-seedream-5-0-lite-260128 text-to-image (2K/png/prompt optimization)
                value:
                  model: doubao-seedream-5-0-lite-260128
                  prompt: generate a cinematic beverage poster with glossy lighting
                  size: 2K
                  output_format: png
                  optimize_prompt_options:
                    mode: standard
              doubao_seedream_image_to_image:
                summary: doubao-seedream-5-0-lite-260128 image-to-image (3K/png/prompt optimization)
                value:
                  model: doubao-seedream-5-0-lite-260128
                  prompt: turn this reference into a cinematic poster
                  images:
                  - https://example.com/input.webp
                  size: 3K
                  output_format: png
                  optimize_prompt_options:
                    mode: standard
              seedream_5_text_to_image:
                summary: seedream-5-0-260128 text-to-image (3K/png)
                value:
                  model: seedream-5-0-260128
                  prompt: generate a clean product poster with soft studio lighting
                  size: 3K
                  output_format: png
      responses:
        '200':
          description: Submission successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaImageCreateTaskResponse'
              examples:
                doubao_seedream_task_submitted:
                  summary: doubao-seedream-5-0-lite-260128 returned task ID
                  value:
                    id: task_doubao_seedream_202604240001
                    task_id: task_doubao_seedream_202604240001
                    object: image
                    model: doubao-seedream-5-0-lite-260128
                    status: queued
                    progress: 0
                    created_at: 1777017600
        '400':
          description: Parameter error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-doubao-seedream-text-to-image
        label: doubao-seedream-5-0-lite-260128 text-to-image (2K/png/prompt optimization)
        source: "curl https://api.imarouter.com/v1/images/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"doubao-seedream-5-0-lite-260128\"\
          ,\n  \"prompt\": \"generate a cinematic beverage poster with glossy lighting\",\n  \"size\": \"2K\",\n  \"output_format\"\
          : \"png\",\n  \"optimize_prompt_options\": {\n    \"mode\": \"standard\"\n  }\n}'"
      - lang: curl-doubao-seedream-image-to-image
        label: doubao-seedream-5-0-lite-260128 image-to-image (3K/png/prompt optimization)
        source: "curl https://api.imarouter.com/v1/images/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"doubao-seedream-5-0-lite-260128\"\
          ,\n  \"prompt\": \"turn this reference into a cinematic poster\",\n  \"images\": [\n    \"https://example.com/input.webp\"\
          \n  ],\n  \"size\": \"3K\",\n  \"output_format\": \"png\",\n  \"optimize_prompt_options\": {\n    \"mode\": \"standard\"\
          \n  }\n}'"
      - lang: curl-seedream-5-text-to-image
        label: seedream-5-0-260128 text-to-image (3K/png)
        source: "curl https://api.imarouter.com/v1/images/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedream-5-0-260128\"\
          ,\n  \"prompt\": \"generate a clean product poster with soft studio lighting\",\n  \"size\": \"3K\",\n  \"output_format\"\
          : \"png\"\n}'"
  /v1/images/generations#doubao-seedream-45:
    post:
      tags:
      - Doubao Seedream
      summary: Generate images (doubao-seedream-4-5-251128)
      description: 'OpenAI Images compatible submission endpoint for doubao-seedream-4-5-251128.


        **Actual request path:** `POST /v1/images/generations`


        **Parameters:**

        - `prompt`: required, up to 600 characters

        - `size`: optional; supported values are `2K`, `4K`, `2048x2048`, `2304x1728`, `1728x2304`, `2560x1440`, `1440x2560`,
        `2496x1664`, `1664x2496`, `3024x1296`

        - `image` / `images`: optional; with image input the request is treated as image-to-image, up to 14 images


        After successful submission, the response returns a task ID. Use `GET /v1/images/generations/{task_id}` to query status
        and results.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DoubaoSeedream45ImageGenerationRequest'
            examples:
              doubao_seedream_45_text_to_image:
                summary: doubao-seedream-4-5-251128 text-to-image (2K)
                value:
                  model: doubao-seedream-4-5-251128
                  prompt: generate a cinematic beverage poster with glossy lighting
                  size: 2K
              doubao_seedream_45_image_to_image:
                summary: doubao-seedream-4-5-251128 image-to-image (4K)
                value:
                  model: doubao-seedream-4-5-251128
                  prompt: turn this reference into a cinematic poster
                  images:
                  - https://example.com/input.webp
                  size: 4K
      responses:
        '200':
          description: Submission successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaImageCreateTaskResponse'
              examples:
                doubao_seedream_45_task_submitted:
                  summary: doubao-seedream-4-5-251128 returned task ID
                  value:
                    id: task_doubao_seedream_45_202604250001
                    task_id: task_doubao_seedream_45_202604250001
                    object: image
                    model: doubao-seedream-4-5-251128
                    status: queued
                    progress: 0
                    created_at: 1777100000
        '400':
          description: Parameter error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-doubao-seedream-45-text-to-image
        label: doubao-seedream-4-5-251128 text-to-image (2K)
        source: "curl https://api.imarouter.com/v1/images/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"doubao-seedream-4-5-251128\"\
          ,\n  \"prompt\": \"generate a cinematic beverage poster with glossy lighting\",\n  \"size\": \"2K\"\n}'"
      - lang: curl-doubao-seedream-45-image-to-image
        label: doubao-seedream-4-5-251128 image-to-image (4K)
        source: "curl https://api.imarouter.com/v1/images/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"doubao-seedream-4-5-251128\"\
          ,\n  \"prompt\": \"turn this reference into a cinematic poster\",\n  \"images\": [\n    \"https://example.com/input.webp\"\
          \n  ],\n  \"size\": \"4K\"\n}'"
  /v1/images/generations/{task_id}#doubao-seedream:
    get:
      tags:
      - Doubao Seedream
      summary: Query image task status and results (Doubao Seedream)
      description: 'The OpenAI Images compatible fetch endpoint for doubao-seedream-5-0-lite-260128. This document entry shows
        `GET /v1/images/generations/{task_id}` under the Doubao Seedream category.


        **Actual request path:** `GET /v1/images/generations/{task_id}`


        If `amount_usd` appears in a successful response, it is the USD amount for the completed image task.


        **IMPORTANT NOTICE (MUST READ)**

        - The 30-day expiration rule only applies to the image result URL returned by the API; it does not mean input `image`
        / `images` URLs are actively expired by the platform.

        - If an image result URL is returned, download and persist it promptly; the platform does not guarantee long-term
        accessibility, and it expires after about 30 days by default.'
      parameters:
      - in: path
        name: task_id
        required: true
        schema:
          type: string
        description: Submit the task ID returned by the creation interface.
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaImageTaskFetchResponse'
              examples:
                doubao_seedream_success:
                  summary: doubao-seedream-5-0-lite-260128 success
                  value:
                    code: success
                    data:
                      task_id: task_doubao_seedream_202604240001
                      status: succeeded
                      format: png
                      url: https://cdn.example.com/gen/doubao-seedream-5-0-lite-260128-abc123.png
                      amount_usd: 0.14
                      usage:
                        input_tokens: 96
                        output_tokens: 2
                        total_tokens: 98
                      error: null
                      metadata: null
        '400':
          description: Parameter error (such as task_id does not exist)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-get-v1-images-generations-task-id
        label: Query image task status and results (Doubao Seedream)
        source: "curl https://api.imarouter.com/v1/images/generations/task_202604270001 \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN'"
  /v1/images/generations#wan:
    post:
      tags:
      - Wan Images
      summary: Generate images (wan2.7-image / wan2.7-image-pro)
      description: "OpenAI Images compatible submission endpoint for Wan image models. This entry shows the `POST /v1/images/generations`\
        \ request body under the Wan Images category.\n\n**Actual request path:** `POST /v1/images/generations`\n\n**Supported\
        \ models:**\n- `wan2.7-image`\n- `wan2.7-image-pro` (adds 4K)\n\n**Parameters:**\n- `prompt`: required\n- `image`\
        \ / `images`: optional; with image input the request is treated as image-to-image, up to 14 images\n- `size`: optional\n\
        \  - `wan2.7-image`: supports `1K`, `2K`, or custom `width*height`; total pixels must stay between `768*768` and `2048*2048`,\
        \ and aspect ratio must stay between `1:8` and `8:1`\n  - `wan2.7-image-pro`: supports `1K`, `2K`, `4K`, or custom\
        \ `width*height`\n  - Only text-to-image without input images and without sequential mode supports `4K` and custom\
        \ sizes up to `4096*4096`; all other cases only support `2K` and `2048*2048`\n- Optional extended fields: `bbox_list`/`bboxList`,\
        \ `color_palette`/`colorPalette`, `enable_sequential`/`enableSequential`, `seed`, `thinking_mode`/`thinkingMode`\n\
        \n**Parameter constraints:**\n- `bbox_list` is only for image-to-image requests with input images; do not send it\
        \ for text-to-image requests\n- Do not send `thinking_mode` together with `enable_sequential=true`\n- Do not send\
        \ `color_palette` together with `enable_sequential=true`\n\nAfter successful submission, the response returns a task\
        \ ID. Use `GET /v1/images/generations/{task_id}` to query status and results.\n\n**IMPORTANT NOTICE (MUST READ)**\n\
        - The 30-day expiration rule only applies to image result URLs returned by the API; it does not mean input parameters\
        \ are actively expired by the platform.\n- Image result URLs are short-term platform-hosted links. Download and persist\
        \ them promptly; they expire after about 30 days by default."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Wan27ImageGenerationRequest'
            examples:
              wan27_basic:
                summary: wan2.7-image basic text-to-image (1024*1024, seed)
                value:
                  model: wan2.7-image
                  prompt: 电影感插画
                  size: 1024*1024
                  seed: 12345
              wan27_advanced:
                summary: wan2.7-image-pro image-to-image advanced fields (bbox_list/color_palette)
                value:
                  model: wan2.7-image-pro
                  prompt: 电影感插画
                  images:
                  - https://cdn.example.com/reference.png
                  size: 1024*1024
                  bbox_list:
                  - - - 0
                      - 0
                      - 12
                      - 12
                  color_palette:
                  - hex: '#C2D1E6'
                    ratio: 50.00%
                  - hex: '#F4D06F'
                    ratio: 30.00%
                  - hex: '#7FA99B'
                    ratio: 20.00%
                  enable_sequential: false
                  seed: 12345
      responses:
        '200':
          description: Submission successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaImageCreateTaskResponse'
              examples:
                wan27_task_submitted:
                  summary: wan2.7-image / wan2.7-image-pro returned task ID
                  value:
                    id: task_wan27_202604240001
                    task_id: task_wan27_202604240001
                    object: image
                    model: wan2.7-image-pro
                    status: queued
                    progress: 0
                    created_at: 1777017600
        '400':
          description: Parameter error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-wan27-basic
        label: wan2.7-image basic text-to-image (1024*1024, seed)
        source: "curl https://api.imarouter.com/v1/images/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"wan2.7-image\"\
          ,\n  \"prompt\": \"电影感插画\",\n  \"size\": \"1024*1024\",\n  \"seed\": 12345\n}'"
      - lang: curl-wan27-advanced
        label: wan2.7-image-pro image-to-image advanced fields (bbox_list/color_palette)
        source: "curl https://api.imarouter.com/v1/images/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"wan2.7-image-pro\"\
          ,\n  \"prompt\": \"电影感插画\",\n  \"images\": [\n    \"https://cdn.example.com/reference.png\"\n  ],\n  \"size\": \"\
          1024*1024\",\n  \"bbox_list\": [\n    [\n      [\n        0,\n        0,\n        12,\n        12\n      ]\n   \
          \ ]\n  ],\n  \"color_palette\": [\n    {\n      \"hex\": \"#C2D1E6\",\n      \"ratio\": \"50.00%\"\n    },\n   \
          \ {\n      \"hex\": \"#F4D06F\",\n      \"ratio\": \"30.00%\"\n    },\n    {\n      \"hex\": \"#7FA99B\",\n    \
          \  \"ratio\": \"20.00%\"\n    }\n  ],\n  \"enable_sequential\": false,\n  \"seed\": 12345\n}'"
  /v1/images/generations#wan26:
    post:
      tags:
      - Wan Images
      summary: Create Wan2.6 image task
      description: 'Wan2.6 image models use the real endpoint `POST /v1/images/generations`.


        **Supported models:**

        - `wan2.6-t2i`: text-to-image; `image` / `images` are not allowed

        - `wan2.6-image`: image-to-image; either `image` or `images` is required


        **Parameters:**

        - `prompt`: required, up to 2000 characters

        - `size`: optional, only one of `1280*1280`, `800*1200`, `1200*800`, `960*1280`, `1280*960`, `720*1280`, `1280*720`,
        `1344*576`

        - `negative_prompt`: optional, up to 500 characters

        - `prompt_extend`: optional

        - `seed`: optional

        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
              - $ref: '#/components/schemas/Wan26T2IImageGenerationRequest'
              - $ref: '#/components/schemas/Wan26I2IImageGenerationRequest'
              discriminator:
                propertyName: model
                mapping:
                  wan2.6-t2i: '#/components/schemas/Wan26T2IImageGenerationRequest'
                  wan2.6-image: '#/components/schemas/Wan26I2IImageGenerationRequest'
            examples:
              wan26_t2i:
                summary: wan2.6-t2i text-to-image (1280*1280, prompt_extend=false)
                value:
                  model: wan2.6-t2i
                  prompt: 一个美丽的日落海景
                  size: 1280*1280
                  prompt_extend: false
                  seed: 12345
              wan26_image:
                summary: wan2.6-image image-to-image (1280*720, single reference image)
                value:
                  model: wan2.6-image
                  prompt: 将参考图改成电影海报风格
                  images:
                  - https://example.com/reference.png
                  size: 1280*720
                  prompt_extend: false
      responses:
        '200':
          description: Wan2.6 image task accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaImageCreateTaskResponse'
              examples:
                wan26_task_submitted:
                  summary: Task accepted
                  value:
                    id: task_wan26_image_202604250001
                    task_id: task_wan26_image_202604250001
                    object: image
                    model: wan2.6-t2i
                    status: queued
                    progress: 0
                    created_at: 1777100000
        '400':
          description: Parameter error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-wan26-t2i
        label: wan2.6-t2i text-to-image (1280*1280, prompt_extend=false)
        source: "curl https://api.imarouter.com/v1/images/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"wan2.6-t2i\"\
          ,\n  \"prompt\": \"一个美丽的日落海景\",\n  \"size\": \"1280*1280\",\n  \"prompt_extend\": false,\n  \"seed\": 12345\n}'"
      - lang: curl-wan26-image
        label: wan2.6-image image-to-image (1280*720, single reference image)
        source: "curl https://api.imarouter.com/v1/images/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"wan2.6-image\"\
          ,\n  \"prompt\": \"将参考图改成电影海报风格\",\n  \"images\": [\n    \"https://example.com/reference.png\"\n  ],\n  \"size\"\
          : \"1280*720\",\n  \"prompt_extend\": false\n}'"
  /v1/images/generations/{task_id}#wan:
    get:
      tags:
      - Wan Images
      summary: Query image task status and results (wan2.7-image / wan2.7-image-pro)
      description: 'OpenAI Images compatible fetch endpoint for Wan image models. This document entry shows `GET /v1/images/generations/{task_id}`
        under the Wan Images category.


        **Actual request path:** `GET /v1/images/generations/{task_id}`


        If `amount_usd` appears in a successful response, it is the USD amount for the completed image task.


        **IMPORTANT NOTICE (MUST READ)**

        - The 30-day expiration rule only applies to the image result URL returned by the API; it does not mean input parameters
        are actively expired by the platform.

        - If an image result URL is returned, download and persist it promptly; the platform does not guarantee long-term
        accessibility, and it expires after about 30 days by default.'
      parameters:
      - in: path
        name: task_id
        required: true
        schema:
          type: string
        description: Submit the task ID returned by the creation interface.
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaImageTaskFetchResponse'
              examples:
                wan27_success:
                  summary: wan2.7-image success
                  value:
                    code: success
                    data:
                      task_id: task_wan27_202604240001
                      status: succeeded
                      format: png
                      url: https://cdn.example.com/gen/wan2.7-image-pro-abc123.png
                      amount_usd: 0.22
                      usage:
                        image_count: 2
                        input_tokens: 100
                        output_tokens: 200
                        total_tokens: 300
                      error: null
                      metadata: null
        '400':
          description: Parameter error (such as task_id does not exist)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-get-v1-images-generations-task-id
        label: Query image task status and results (wan2.7-image / wan2.7-image-pro)
        source: "curl https://api.imarouter.com/v1/images/generations/task_202604270001 \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN'"
  /v1/images/generations#pruna:
    post:
      tags:
      - PrunaAI Images
      summary: Create a PrunaAI image task
      description: 'OpenAI Images compatible submission endpoint for PrunaAI image models. This entry shows the `POST /v1/images/generations`
        request body under the PrunaAI Images category.


        **Actual request path:** `POST /v1/images/generations`


        **Supported models:**

        - `prunaai/p-image`: text-to-image, requires `prompt`

        - `prunaai/p-image-edit`: image edit, requires both `prompt` and image input (`image`, `images`, or `extra_fields.input.images`)


        **Parameters:**

        - `prunaai/p-image` supports `prompt`, `size`, `aspect_ratio`, `width`, `height`, `seed`, and `disable_safety_checker`

        - `prunaai/p-image-edit` supports `prompt`, `image`, `images`, `extra_fields`, `aspect_ratio`, `turbo`, `seed`, and
        `disable_safety_checker`

        - `image` or `images` provides input images; `extra_fields` can carry extended parameters


        **Result lookup:**

        - After successful submission, the response returns a task ID. Use `GET /v1/images/generations/{task_id}` to query
        status and results.

        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PrunaImageGenerationRequest'
            examples:
              pruna_p_image_text_to_image:
                summary: prunaai/p-image text-to-image
                value:
                  model: prunaai/p-image
                  prompt: a clean studio product photo of a ceramic cup
                  size: 1024x1024
                  aspect_ratio: '1:1'
                  seed: 0
              pruna_p_image_edit:
                summary: prunaai/p-image-edit image edit
                value:
                  model: prunaai/p-image-edit
                  prompt: edit this image into a clean product-style composition
                  image: https://example.com/source.png
                  extra_fields:
                    input:
                      images:
                      - https://example.com/source.png
                      aspect_ratio: '1:1'
                      turbo: false
                      seed: 0
      responses:
        '200':
          description: Submission successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PrunaImageCreateTaskResponse'
              examples:
                pruna_task_submitted:
                  summary: PrunaAI returned task ID
                  value:
                    id: task_pruna_202605260001
                    task_id: task_pruna_202605260001
                    object: image
                    model: prunaai/p-image
                    status: queued
                    progress: 0
                    created_at: 1780041600
        '400':
          description: Parameter error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-pruna-p-image-text-to-image
        label: prunaai/p-image text-to-image
        source: "curl https://api.imarouter.com/v1/images/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"prunaai/p-image\"\
          ,\n  \"prompt\": \"a clean studio product photo of a ceramic cup\",\n  \"size\": \"1024x1024\",\n  \"aspect_ratio\"\
          : \"1:1\",\n  \"seed\": 0\n}'"
      - lang: curl-pruna-p-image-edit
        label: prunaai/p-image-edit image edit
        source: "curl https://api.imarouter.com/v1/images/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"prunaai/p-image-edit\"\
          ,\n  \"prompt\": \"edit this image into a clean product-style composition\",\n  \"image\": \"https://example.com/source.png\"\
          ,\n  \"extra_fields\": {\n    \"input\": {\n      \"images\": [\n        \"https://example.com/source.png\"\n  \
          \    ],\n      \"aspect_ratio\": \"1:1\",\n      \"turbo\": false,\n      \"seed\": 0\n    }\n  }\n}'"
  /v1/images/generations/{task_id}#pruna:
    get:
      tags:
      - PrunaAI Images
      summary: Query a PrunaAI image task
      description: 'OpenAI Images compatible fetch endpoint for PrunaAI image models. This entry shows `GET /v1/images/generations/{task_id}`
        under the PrunaAI Images category.


        **Actual request path:** `GET /v1/images/generations/{task_id}`


        A successful response returns the task status and image result URL.


        **IMPORTANT NOTICE (MUST READ)**

        - If the image result URL is returned after a successful query, download and persist it promptly; the platform does
        not guarantee long-term accessibility, and the URL expires after about 30 days by default.

        '
      parameters:
      - in: path
        name: task_id
        required: true
        schema:
          type: string
        description: Task ID returned by the create endpoint.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaImageTaskFetchResponse'
              examples:
                pruna_success:
                  summary: PrunaAI image success
                  value:
                    code: success
                    data:
                      task_id: task_pruna_202605260001
                      status: succeeded
                      format: png
                      url: https://cdn.example.com/gen/pruna-p-image-abc123.png
                      amount_usd: 0.005
                      usage:
                        image_count: 1
                      error: null
                      metadata: null
        '400':
          description: Parameter error (such as task_id does not exist)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-get-v1-images-generations-task-id
        label: Query a PrunaAI image task
        source: "curl https://api.imarouter.com/v1/images/generations/task_202604270001 \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN'"
  /v1/videos:
    post:
      tags:
      - Seedance Video
      summary: Create Seedance video task
      description: 'Submit video tasks using the Seedance model:

        - `seedance-2.0`

        - `seedance-2.0-fast`

        - `seedance-2.0-cn`

        - `seedance-2.0-fast-cn`

        - ~~`ima-pro`~~ (Historical alias for overseas channels, expired; for backward compatibility, please use `seedance-2.0`
        / `seedance-2.0-cn` instead)

        - ~~`ima-pro-fast`~~ (Historical alias for overseas channels, expired; for backward compatibility, please use `seedance-2.0-fast`
        / `seedance-2.0-fast-cn` instead)

        Authentication: The request header must contain `Authorization: Bearer sk-...`.

        Moderation passthrough: `x-moderation` is treated as `false` by default; to enable moderation passthrough, additionally
        send the request header `x-moderation: enabled`.

        Endpoint constraints: `/v1/videos` is the video task endpoint and accepts video models only; use `/v1/images/generations`
        for image generation models.

        **IMPORTANT NOTICE (MUST READ)**

        - `images`, `metadata.reference_video_urls`, `metadata.reference_audio_urls`, `metadata.first_frame_image` and other
        input URLs (including public network URLs or `asset://...`) are task input references, please confirm that they are
        accessible when submitting.

        Commonly used fields:

        - Text: `prompt`

        - Images: `images` (supports multiple images)

        - Reference video: `metadata.reference_video_urls`

        - Reference audio: `metadata.reference_audio_urls`

        - Audio switch: `metadata.audio` (it is recommended to set it to `false` first in copyright risk scenarios, that is,
        no background music)

        - Size: `size` can be passed `WxH`, but must be normalized to the exact supported ratio; for example `854x480` will
        be normalized to `427:240`, not exactly `16:9`, and will be rejected as `ratio is invalid: 427:240`. For 480p 16:9,
        use `848x480` or pass `metadata.resolution=480p` directly.


        **Important note: Select examples by how they were built**

        - Text-to-video (text only): refer to `C01 text (seedance-2.0-fast)`, `C01b text 1080p (seedance-2.0)`.

        - Image-to-video (driven by images): refer to `C02 text + image (1 image)`, `C03 single-image reference`, `C04 single
        image as first frame`, `C05 two reference images`, `C06 two images as first and last frames`.

        - Reference-to-video (reference video/audio/portrait protocol participates in generation): refer to `C07 text + video`,
        `C08 text + image + audio`, `C09 text + image + video`, `C10 text + video + audio`, `C11 text + image + video + audio`,
        `C12 text + portrait + video + audio`, `C15 text + video portrait protocol`, `C16 text + image + audio portrait protocol`.

        - Counterexamples and avoidance strategies: refer to `C13 Reference Video Insufficient Pixels (601300)`, `C14 Music
        Copyright Risk Scenario (Block Background Music First)`.


        Combinational logic (aligned with ima-router''s current behavior):

        - text (`prompt` required)

        - text + image (`prompt` optional)

        - text + video (`prompt` optional)

        - text + image + audio (`prompt` optional)

        - text + image + video (`prompt` optional)

        - text + video + audio (`prompt` optional)

        - text + image + video + audio (`prompt` optional)


        Image role mapping (important):

        - Default mode (`role_mode=reference`): Images are uniformly mapped to `reference_image`

        - Frame mode (`role_mode=frame`): single image mapping `first_frame`, double image mapping `first_frame + last_frame`

        - Frame mode cannot be used together with `reference_video_urls`/`reference_audio_urls`


        Character material compliance instructions:

        - When using your own virtual characters or real-life materials, only amateurs are allowed, and celebrity characters
        are not supported.

        - The platform will review uploaded materials to avoid possible legal risks.

        - Character material upload is supported through `/v1/assets/create`, which enters the review process.

        - Recommended process: First call `/v1/assets/create` to upload and persist materials, then reference the reviewed
        materials in `/v1/videos` request.

        - After uploading, you can call `/v1/assets/get` to poll the material status, and the results will generally be available
        within 10 seconds.

        - Document examples support click-to-copy; the copied request body can be directly handed over to AI to automatically
        identify and generate the final access code.

        - If you need to access materials in batches, please give priority to the material library interface rather than the
        temporary direct link.


        The example below is the request body, not the return body.'
      parameters:
      - name: x-moderation
        in: header
        required: false
        schema:
          type: string
          enum:
          - enabled
        example: enabled
        description: 'Optional moderation passthrough header. Default is treated as `false`. The server forwards this header
          upstream only when `x-moderation: enabled` is sent to the Seedance upstream.'
      operationId: createImaProVideoTask
      x-playground-portrait-asset-models:
        seedance-2.0: seedance-upload
        seedance-2.0-fast: seedance-upload
        seedance-2.0-cn: seedance-upload-cn
        seedance-2.0-fast-cn: seedance-upload-cn
        ima-pro: seedance-upload
        ima-pro-fast: seedance-upload
      x-playground-portrait-asset-required: true
      x-playground-portrait-asset-status-ok: Active
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImaProVideoCreateRequest'
            examples:
              C01_text_fast:
                summary: Text Fast 720p
                description: '`seedance-2.0-fast` text-to-video explicit resolution example. According to actual measurements,
                  `metadata.resolution=1080p` will be returned by the upstream as `Invalid parameters`. Text-to-video recommends
                  using `720p` or `480p`.'
                value:
                  model: seedance-2.0-fast
                  prompt: Time-lapse photography of the city in the early morning, with warm colors and a cinematic feel.
                  duration: 5
                  metadata:
                    resolution: 720p
              C01b_text_pro_1080p:
                summary: Text Pro 1080p
                description: '`seedance-2.0` text-to-video explicit 1080p resolution example. The actual measurement is created
                  successfully and enters `in_progress`.'
                value:
                  model: seedance-2.0
                  prompt: Time-lapse photography of the city in the early morning, with warm colors and a cinematic feel.
                  duration: 5
                  metadata:
                    resolution: 1080p
              C01c_invalid_size_854x480:
                summary: Invalid 854x480
                description: '`854x480` would be normalized to `427:240`, not exactly `16:9`, and the expected commit failed:
                  `ratio is invalid: 427:240`. For 480p 16:9, use `848x480` or `metadata.resolution=480p`.'
                value:
                  model: seedance-2.0
                  prompt: Time-lapse photography of the city in the early morning, with warm colors and a cinematic feel.
                  duration: 4
                  size: 854x480
                  metadata:
                    audio: false
              C02_text_image_pro:
                summary: Single image
                value:
                  model: seedance-2.0
                  prompt: C02 single-image basic example (1 image)
                  images:
                  - https://file.fashionlabs.cn/doc_image/r2v_tea_pic1.jpg
                  duration: 10
                  metadata:
                    aspect_ratio: '16:9'
                    audio: true
                    role_mode: reference
              C03_single_image_ref_pro:
                summary: Reference image
                description: If `role_mode` is not passed, the default `reference_image` will be used.
                value:
                  model: seedance-2.0
                  prompt: C03 single-image reference example (1 image)
                  images:
                  - https://file.fashionlabs.cn/doc_image/r2v_tea_pic1.jpg
                  duration: 5
                  metadata:
                    aspect_ratio: '9:16'
                    role_mode: reference
              C04_single_image_ref_fast:
                summary: First frame Fast
                description: '`role_mode=frame`, single image is processed according to `first_frame`.'
                value:
                  model: seedance-2.0-fast
                  prompt: C04 single image as first frame (1 image, fast)
                  images:
                  - https://file.fashionlabs.cn/doc_image/r2v_tea_pic1.jpg
                  duration: 10
                  metadata:
                    role_mode: frame
                    aspect_ratio: '21:9'
              C05_two_images_ref_pro:
                summary: Two reference images
                description: '`role_mode` is not passed, the two images are processed according to `reference_image + reference_image`.'
                value:
                  model: seedance-2.0
                  prompt: C05 two reference images (2 images)
                  images:
                  - https://dev-jiman.oss-cn-hangzhou.aliyuncs.com/jm/20260316/ac5fe9ec6640426bafd6200b254b4b5f.png
                  - https://dev-jiman.oss-cn-hangzhou.aliyuncs.com/jm/20260316/321175f98af24025b835debeb18002cc.png
                  duration: 5
                  metadata:
                    aspect_ratio: '16:9'
                    role_mode: reference
              C06_two_images_ref_fast:
                summary: First/last Fast
                description: '`role_mode=frame`, the two images are processed according to `first_frame + last_frame`.'
                value:
                  model: seedance-2.0-fast
                  prompt: C06 two images as first and last frames (2 images, fast)
                  images:
                  - https://dev-jiman.oss-cn-hangzhou.aliyuncs.com/jm/20260316/ac5fe9ec6640426bafd6200b254b4b5f.png
                  - https://dev-jiman.oss-cn-hangzhou.aliyuncs.com/jm/20260316/321175f98af24025b835debeb18002cc.png
                  duration: 15
                  metadata:
                    role_mode: frame
                    aspect_ratio: '4:3'
              C07_text_video_pro:
                summary: Reference video
                value:
                  model: seedance-2.0
                  duration: 10
                  metadata:
                    aspect_ratio: '16:9'
                    reference_video_urls:
                    - https://file.fashionlabs.cn/doc_video/r2v_tea_video1.mp4
              C08_text_image_audio_pro:
                summary: Image + audio
                value:
                  model: seedance-2.0
                  images:
                  - https://file.fashionlabs.cn/doc_image/r2v_tea_pic1.jpg
                  duration: 10
                  metadata:
                    aspect_ratio: '16:9'
                    audio: true
                    reference_audio_urls:
                    - https://file.fashionlabs.cn/doc_audio/r2v_tea_audio1.mp3
              C09_text_image_video_pro:
                summary: Image + video
                value:
                  model: seedance-2.0
                  images:
                  - https://file.fashionlabs.cn/doc_image/r2v_tea_pic1.jpg
                  duration: 10
                  metadata:
                    aspect_ratio: '16:9'
                    reference_video_urls:
                    - https://file.fashionlabs.cn/doc_video/r2v_tea_video1.mp4
              C10_text_video_audio_pro:
                summary: Video + audio
                value:
                  model: seedance-2.0
                  duration: 10
                  metadata:
                    aspect_ratio: '16:9'
                    audio: true
                    reference_video_urls:
                    - https://file.fashionlabs.cn/doc_video/r2v_tea_video1.mp4
                    reference_audio_urls:
                    - https://file.fashionlabs.cn/doc_audio/r2v_tea_audio1.mp3
              C11_text_image_video_audio_pro:
                summary: Image + video + audio
                value:
                  model: seedance-2.0
                  images:
                  - https://file.fashionlabs.cn/doc_image/r2v_tea_pic1.jpg
                  duration: 10
                  metadata:
                    aspect_ratio: '16:9'
                    audio: true
                    reference_video_urls:
                    - https://file.fashionlabs.cn/doc_video/r2v_tea_video1.mp4
                    reference_audio_urls:
                    - https://file.fashionlabs.cn/doc_audio/r2v_tea_audio1.mp3
              C12_text_portrait_video_audio_pro:
                summary: Portrait + video + audio
                description: 'Portrait reference image scene example:

                  - The first item is a normal public reference image URL (non-portrait image)

                  - The second item is the asset-library portrait protocol `asset://asset-20260319150455-wmb65`

                  - Reference audio usage 15 second sample (maximum 15 seconds)

                  - Maximum of 3 reference videos, and the total length does not exceed 15 seconds

                  - Serious reminder: Before using the `asset://...` portrait protocol, you must confirm that the `model`
                  used when creating the material is in the same channel as the current video model; domestic video models
                  are equipped with `ima-pro-upload-cn`, and overseas video models are equipped with `seedance-upload`. Mixed
                  use will cause the protocol call to fail.

                  Both images are processed according to `reference_image` semantics.'
                value:
                  model: seedance-2.0
                  prompt: A 15-second movie-level global travel MV, with the two protagonists facing the camera throughout,
                    and smooth transitions connecting multiple landmarks.
                  images:
                  - https://ima-ga.esxscloud.com/aiagent/src/d/20260209/in/1770621940910426538_0.png
                  - asset://asset-20260319150455-wmb65
                  duration: 15
                  metadata:
                    aspect_ratio: '16:9'
                    audio: true
                    role_mode: reference
                    reference_video_urls:
                    - https://file2.fashionlabs.cn/aiagent/src/d/20260319/in/ac45807a51f68c21556b7872827a4569.mp4
                    reference_audio_urls:
                    - https://file2.fashionlabs.cn/aiagent/src/d510cae243c24eafcfadf3a9e3b6c6ad_%5Bcut_15sec%5D.mp3
              C13_ref_video_pixel_too_low_negative_case:
                summary: Invalid video pixels
                description: 'This example demonstrates common failure scenarios (parameter errors):

                  - The reference video frame pixels (width x height) must be within the range of `[409600,927408]`

                  - When the reference video pixels are lower than `409600` (for example, lower than `640x640`), the task
                  will fail with error code `601300`

                  - There are a maximum of 3 reference videos, and the total duration is `<=15s`'
                value:
                  model: seedance-2.0
                  prompt: 'Counterexample demonstration: Insufficient pixels in the reference video will trigger 601300'
                  images:
                  - asset://asset-20260319150455-wmb65
                  duration: 10
                  metadata:
                    aspect_ratio: '16:9'
                    audio: true
                    role_mode: reference
                    reference_video_urls:
                    - https://dev-jiman.oss-cn-hangzhou.aliyuncs.com/jm/20260323/6788a25956614761b77f99005080cbe0.mp4
                    reference_audio_urls:
                    - https://file2.fashionlabs.cn/aiagent/src/d510cae243c24eafcfadf3a9e3b6c6ad_%5Bcut_15sec%5D.mp3
              C14_music_copyright_risk_no_bgm:
                summary: No background music
                description: 'When the material/claim may trigger a music copyright dispute, it is recommended to use the
                  "no background music" solution for verification first:

                  - `metadata.audio=false` (do not add background music first)

                  - The prompt word is clear "No subtitles, no background music"

                  - Only the plot vocals, environmental sound effects, and action sound effects are retained'
                value:
                  model: seedance-2.0
                  prompt: There are no subtitles or background music throughout the entire process, and only three types of
                    clear sounds are retained - storyline vocals (clearly identifiable, no noise, no distortion), environmental
                    sound effects (fitting the scene, natural and not obtrusive), and action sound effects (fitting the subtle
                    movements of the characters, real and delicate).
                  images:
                  - https://ark-project.tos-cn-beijing.volces.com/doc_image/r2v_tea_pic2.jpg
                  duration: 10
                  metadata:
                    aspect_ratio: '16:9'
                    audio: false
              C15_text_asset_video_pro:
                summary: Video portrait asset
                description: 'Video portrait protocol example:

                  - `metadata.reference_video_urls` can directly transfer the material library video portrait protocol `asset://asset-20260416161659-z97x5`

                  - The asset should first be created and approved through `/v1/assets/create` with `asset_type=Video`

                  - Video portrait materials are processed according to the reference video semantics and are not placed in
                  `images`

                  - Serious reminder: Before using the `asset://...` portrait protocol, you must confirm that the `model`
                  used when creating the material is in the same channel as the current video model; domestic video models
                  are equipped with `ima-pro-upload-cn`, and overseas video models are equipped with `seedance-upload`. Mixed
                  use will cause the protocol call to fail.

                  - The material protocol is only used for reference when submitting. Please confirm that the `asset://...`
                  belongs to the corresponding user currently calling SK and is accessible when submitting.'
                value:
                  model: seedance-2.0
                  prompt: Use video material as a reference to generate a cinematic short film in the same style, keeping
                    the rhythm of the shot natural.
                  duration: 10
                  metadata:
                    aspect_ratio: '16:9'
                    audio: true
                    reference_video_urls:
                    - asset://asset-20260416161659-z97x5
              C16_text_image_asset_audio_pro:
                summary: Audio portrait asset
                description: 'Audio portrait protocol example:

                  - `metadata.reference_audio_urls` can directly pass the asset-library audio portrait protocol `asset://asset-20260409133902-bz4kq`

                  - The material should first be created through `/v1/assets/create` with `asset_type=Audio`, approved, and
                  belongs to the user currently calling SK

                  - Audio portrait materials are processed according to reference audio semantics; image references are still
                  placed in `images`

                  - Note: When using the audio portrait protocol, at least one of `images` or `metadata.reference_video_urls`
                  needs to be provided

                  - This example uses the combination of "text + image + audio" to avoid illegal upstream parameters caused
                  by text-only + audio

                  - Serious reminder: Before using the `asset://...` portrait protocol, you must confirm that the `model`
                  used when creating the material is in the same channel as the current video model; domestic video models
                  are equipped with `ima-pro-upload-cn`, and overseas video models are equipped with `seedance-upload`. Mixed
                  use will cause the protocol call to fail.

                  - The material protocol is only used for reference when submitting. Please confirm that the `asset://...`
                  belongs to the corresponding user currently calling SK and is accessible when submitting.'
                value:
                  model: seedance-2.0
                  prompt: Use the audio material as a reference to generate a cinematic short film with matching rhythm and
                    consistent atmosphere.
                  images:
                  - https://ima-ga.esxscloud.com/upload/1775559248448_433.png
                  duration: 10
                  metadata:
                    aspect_ratio: '16:9'
                    audio: true
                    reference_audio_urls:
                    - asset://asset-20260409133902-bz4kq
      responses:
        '200':
          description: Task submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaProCreateResponse'
              examples:
                Created successfully:
                  value:
                    id: task_202603131631387ETKUBM91MTD72X9
                    task_id: task_202603131631387ETKUBM91MTD72X9
                    object: video
                    model: seedance-2.0-fast
                    status: ''
                    progress: 0
                    created_at: 1773395498
                Role graph scene graph_Created successfully:
                  summary: Corresponding to the request of "two images (character + scene), not first/last-frame mode"
                  value:
                    id: task_kfOFFyhQAA1kGTnfdvhcMvhq7K1zIfZ4
                    task_id: task_kfOFFyhQAA1kGTnfdvhcMvhq7K1zIfZ4
                    object: video
                    model: seedance-2.0
                    status: in_progress
                    progress: 0
                    created_at: 1773561120
        '400':
          description: Incorrect parameters or illegal task creation request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
              examples:
                Missing model:
                  value:
                    code: missing_model
                    message: model field is required
                    data: null
                Text combination is missing prompt words:
                  value:
                    code: invalid_request
                    message: prompt is required
                    data: null
                Text content is required: Text content is required
                Task ID is empty:
                  value:
                    code: '500'
                    message: status_code=500, task_id is empty
                    data: null
                role_mode is illegal:
                  value:
                    code: invalid_request
                    message: metadata.role_mode must be one of [reference, frame]
                    data: null
                Image model misuses video endpoint:
                  value:
                    code: invalid_model_endpoint
                    message: image generation models are not supported on /v1/videos
                    data: null
                frame mode conflicts with reference media:
                  value:
                    code: invalid_request
                    message: frame mode cannot be mixed with reference video/audio
                    data: null
                Video pixels exceed limit:
                  value:
                    code: '500'
                    message: the parameter video pixel count specified in the request must be less than or equal to 927408
                    data: null
                Portraits are not supported yet:
                  value:
                    code: '500'
                    message: Portraits are not supported yet
                    data: null
                Reference audio timeout length:
                  value:
                    code: invalid_request
                    message: reference audio duration must be <= 15s
                    data: null
                The total duration of the three reference videos exceeds the limit:
                  value:
                    code: invalid_request
                    message: total duration of reference videos must be <= 15s
                    data: null
                MiniMaxFast resolution does not support 720p:
                  value:
                    code: '2013'
                    message: 'hailuo api error: invalid params, model MiniMax-Hailuo-2.3-Fast does not support resolution
                      720P, supported resolutions: 768P, 1080P'
                    data: null
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                No token provided:
                  value:
                    error:
                      code: ''
                      message: token not provided
                      type: new_api_error
                token is not available:
                  value:
                    error:
                      code: ''
                      message: token status is unavailable
                      type: new_api_error
        '500':
          description: Upstream creation task failed or service internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
              examples:
                Task creation failed: Task creation failed
                Task creation failed_taskid is empty: Task creation failed_taskid is empty
                Task creation failed_pixel limit exceeded: Task creation failed_pixel limit exceeded
                Task creation failed_portraits are not supported yet: Task creation failed_portraits are not supported yet
      x-codeSamples:
      - lang: curl-c01-text-fast
        label: Text Fast 720p
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0-fast\",\n  \"prompt\"\
          : \"Time-lapse photography of the city in the early morning, with warm colors and a cinematic feel.\",\n  \"duration\"\
          : 5,\n  \"metadata\": {\n    \"resolution\": \"720p\"\n  }\n}'"
      - lang: curl-c01b-text-pro-1080p
        label: Text Pro 1080p
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\",\n  \"prompt\"\
          : \"Time-lapse photography of the city in the early morning, with warm colors and a cinematic feel.\",\n  \"duration\"\
          : 5,\n  \"metadata\": {\n    \"resolution\": \"1080p\"\n  }\n}'"
      - lang: curl-c01c-invalid-size-854x480
        label: Invalid 854x480
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\",\n  \"prompt\"\
          : \"Time-lapse photography of the city in the early morning, with warm colors and a cinematic feel.\",\n  \"duration\"\
          : 4,\n  \"size\": \"854x480\",\n  \"metadata\": {\n    \"audio\": false\n  }\n}'"
      - lang: curl-c02-text-image-pro
        label: Single image
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\",\n  \"prompt\"\
          : \"C02 single-image basic example (1 image)\",\n  \"images\": [\n    \"https://file.fashionlabs.cn/doc_image/r2v_tea_pic1.jpg\"\
          \n  ],\n  \"duration\": 10,\n  \"metadata\": {\n    \"aspect_ratio\": \"16:9\",\n    \"audio\": true,\n    \"role_mode\"\
          : \"reference\"\n  }\n}'"
      - lang: curl-c03-single-image-ref-pro
        label: Reference image
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\",\n  \"prompt\"\
          : \"C03 single-image reference example (1 image)\",\n  \"images\": [\n    \"https://file.fashionlabs.cn/doc_image/r2v_tea_pic1.jpg\"\
          \n  ],\n  \"duration\": 5,\n  \"metadata\": {\n    \"aspect_ratio\": \"9:16\",\n    \"role_mode\": \"reference\"\
          \n  }\n}'"
      - lang: curl-c04-single-image-ref-fast
        label: First frame Fast
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0-fast\",\n  \"prompt\"\
          : \"C04 single image as first frame (1 image, fast)\",\n  \"images\": [\n    \"https://file.fashionlabs.cn/doc_image/r2v_tea_pic1.jpg\"\
          \n  ],\n  \"duration\": 10,\n  \"metadata\": {\n    \"role_mode\": \"frame\",\n    \"aspect_ratio\": \"21:9\"\n\
          \  }\n}'"
      - lang: curl-c05-two-images-ref-pro
        label: Two reference images
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\",\n  \"prompt\"\
          : \"C05 two reference images (2 images)\",\n  \"images\": [\n    \"https://dev-jiman.oss-cn-hangzhou.aliyuncs.com/jm/20260316/ac5fe9ec6640426bafd6200b254b4b5f.png\"\
          ,\n    \"https://dev-jiman.oss-cn-hangzhou.aliyuncs.com/jm/20260316/321175f98af24025b835debeb18002cc.png\"\n  ],\n\
          \  \"duration\": 5,\n  \"metadata\": {\n    \"aspect_ratio\": \"16:9\",\n    \"role_mode\": \"reference\"\n  }\n\
          }'"
      - lang: curl-c06-two-images-ref-fast
        label: First/last Fast
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0-fast\",\n  \"prompt\"\
          : \"C06 two images as first and last frames (2 images, fast)\",\n  \"images\": [\n    \"https://dev-jiman.oss-cn-hangzhou.aliyuncs.com/jm/20260316/ac5fe9ec6640426bafd6200b254b4b5f.png\"\
          ,\n    \"https://dev-jiman.oss-cn-hangzhou.aliyuncs.com/jm/20260316/321175f98af24025b835debeb18002cc.png\"\n  ],\n\
          \  \"duration\": 15,\n  \"metadata\": {\n    \"role_mode\": \"frame\",\n    \"aspect_ratio\": \"4:3\"\n  }\n}'"
      - lang: curl-c07-text-video-pro
        label: Reference video
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\",\n  \"duration\"\
          : 10,\n  \"metadata\": {\n    \"aspect_ratio\": \"16:9\",\n    \"reference_video_urls\": [\n      \"https://file.fashionlabs.cn/doc_video/r2v_tea_video1.mp4\"\
          \n    ]\n  }\n}'"
      - lang: curl-c08-text-image-audio-pro
        label: Image + audio
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\",\n  \"images\"\
          : [\n    \"https://file.fashionlabs.cn/doc_image/r2v_tea_pic1.jpg\"\n  ],\n  \"duration\": 10,\n  \"metadata\":\
          \ {\n    \"aspect_ratio\": \"16:9\",\n    \"audio\": true,\n    \"reference_audio_urls\": [\n      \"https://file.fashionlabs.cn/doc_audio/r2v_tea_audio1.mp3\"\
          \n    ]\n  }\n}'"
      - lang: curl-c09-text-image-video-pro
        label: Image + video
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\",\n  \"images\"\
          : [\n    \"https://file.fashionlabs.cn/doc_image/r2v_tea_pic1.jpg\"\n  ],\n  \"duration\": 10,\n  \"metadata\":\
          \ {\n    \"aspect_ratio\": \"16:9\",\n    \"reference_video_urls\": [\n      \"https://file.fashionlabs.cn/doc_video/r2v_tea_video1.mp4\"\
          \n    ]\n  }\n}'"
      - lang: curl-c10-text-video-audio-pro
        label: Video + audio
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\",\n  \"duration\"\
          : 10,\n  \"metadata\": {\n    \"aspect_ratio\": \"16:9\",\n    \"audio\": true,\n    \"reference_video_urls\": [\n\
          \      \"https://file.fashionlabs.cn/doc_video/r2v_tea_video1.mp4\"\n    ],\n    \"reference_audio_urls\": [\n \
          \     \"https://file.fashionlabs.cn/doc_audio/r2v_tea_audio1.mp3\"\n    ]\n  }\n}'"
      - lang: curl-c11-text-image-video-audio-pro
        label: Image + video + audio
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\",\n  \"images\"\
          : [\n    \"https://file.fashionlabs.cn/doc_image/r2v_tea_pic1.jpg\"\n  ],\n  \"duration\": 10,\n  \"metadata\":\
          \ {\n    \"aspect_ratio\": \"16:9\",\n    \"audio\": true,\n    \"reference_video_urls\": [\n      \"https://file.fashionlabs.cn/doc_video/r2v_tea_video1.mp4\"\
          \n    ],\n    \"reference_audio_urls\": [\n      \"https://file.fashionlabs.cn/doc_audio/r2v_tea_audio1.mp3\"\n\
          \    ]\n  }\n}'"
      - lang: curl-c12-text-portrait-video-audio-pro
        label: Portrait + video + audio
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\",\n  \"prompt\"\
          : \"A 15-second movie-level global travel MV, with the two protagonists facing the camera throughout, and smooth\
          \ transitions connecting multiple landmarks.\",\n  \"images\": [\n    \"https://ima-ga.esxscloud.com/aiagent/src/d/20260209/in/1770621940910426538_0.png\"\
          ,\n    \"asset://asset-20260319150455-wmb65\"\n  ],\n  \"duration\": 15,\n  \"metadata\": {\n    \"aspect_ratio\"\
          : \"16:9\",\n    \"audio\": true,\n    \"role_mode\": \"reference\",\n    \"reference_video_urls\": [\n      \"\
          https://file2.fashionlabs.cn/aiagent/src/d/20260319/in/ac45807a51f68c21556b7872827a4569.mp4\"\n    ],\n    \"reference_audio_urls\"\
          : [\n      \"https://file2.fashionlabs.cn/aiagent/src/d510cae243c24eafcfadf3a9e3b6c6ad_%5Bcut_15sec%5D.mp3\"\n \
          \   ]\n  }\n}'"
      - lang: curl-c13-ref-video-pixel-too-low-negative-case
        label: Invalid video pixels
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\",\n  \"prompt\"\
          : \"Counterexample demonstration: Insufficient pixels in the reference video will trigger 601300\",\n  \"images\"\
          : [\n    \"asset://asset-20260319150455-wmb65\"\n  ],\n  \"duration\": 10,\n  \"metadata\": {\n    \"aspect_ratio\"\
          : \"16:9\",\n    \"audio\": true,\n    \"role_mode\": \"reference\",\n    \"reference_video_urls\": [\n      \"\
          https://dev-jiman.oss-cn-hangzhou.aliyuncs.com/jm/20260323/6788a25956614761b77f99005080cbe0.mp4\"\n    ],\n    \"\
          reference_audio_urls\": [\n      \"https://file2.fashionlabs.cn/aiagent/src/d510cae243c24eafcfadf3a9e3b6c6ad_%5Bcut_15sec%5D.mp3\"\
          \n    ]\n  }\n}'"
      - lang: curl-c14-music-copyright-risk-no-bgm
        label: No background music
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\",\n  \"prompt\"\
          : \"There are no subtitles or background music throughout the entire process, and only three types of clear sounds\
          \ are retained - storyline vocals (clearly identifiable, no noise, no distortion), environmental sound effects (fitting\
          \ the scene, natural and not obtrusive), and action sound effects (fitting the subtle movements of the characters,\
          \ real and delicate).\",\n  \"images\": [\n    \"https://ark-project.tos-cn-beijing.volces.com/doc_image/r2v_tea_pic2.jpg\"\
          \n  ],\n  \"duration\": 10,\n  \"metadata\": {\n    \"aspect_ratio\": \"16:9\",\n    \"audio\": false\n  }\n}'"
      - lang: curl-c15-text-asset-video-pro
        label: Video portrait asset
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\",\n  \"prompt\"\
          : \"Use video material as a reference to generate a cinematic short film in the same style, keeping the rhythm of\
          \ the shot natural.\",\n  \"duration\": 10,\n  \"metadata\": {\n    \"aspect_ratio\": \"16:9\",\n    \"audio\":\
          \ true,\n    \"reference_video_urls\": [\n      \"asset://asset-20260416161659-z97x5\"\n    ]\n  }\n}'"
      - lang: curl-c16-text-image-asset-audio-pro
        label: Audio portrait asset
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\",\n  \"prompt\"\
          : \"Use the audio material as a reference to generate a cinematic short film with matching rhythm and consistent\
          \ atmosphere.\",\n  \"images\": [\n    \"https://ima-ga.esxscloud.com/upload/1775559248448_433.png\"\n  ],\n  \"\
          duration\": 10,\n  \"metadata\": {\n    \"aspect_ratio\": \"16:9\",\n    \"audio\": true,\n    \"reference_audio_urls\"\
          : [\n      \"asset://asset-20260409133902-bz4kq\"\n    ]\n  }\n}'"
  /v1/videos#wan26:
    post:
      tags:
      - Wan2.6 Video
      summary: Create Wan2.6 video task
      description: 'Use the real endpoint `POST /v1/videos`.


        Supported models:

        - `wan2.6-t2v`: text-to-video

        - `wan2.6-i2v`: image-to-video

        - `wan2.6-i2v-flash`: fast image-to-video

        - `wan2.6-r2v`: reference-to-video, supports reference image or reference video input


        After successful submission, the response returns a task ID. Use `GET /v1/videos/{task_id}` to query status and results.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Wan26VideoCreateRequest'
            examples:
              wan26_t2v_720p_5s:
                summary: wan2.6-t2v text-to-video
                value:
                  model: wan2.6-t2v
                  prompt: 清晨城市延时摄影，暖色调，电影感。
                  duration: 5
                  size: 720P
              wan26_i2v_flash_audio:
                summary: wan2.6-i2v-flash image-to-video with audio
                value:
                  model: wan2.6-i2v-flash
                  prompt: 让照片中的猫在草地上奔跑
                  images:
                  - https://example.com/cat.png
                  duration: 10
                  size: 1080P
                  audio: true
              wan26_i2v_audio:
                summary: wan2.6-i2v image-to-video
                value:
                  model: wan2.6-i2v
                  prompt: 让参考图中的人物自然转身看向镜头
                  images:
                  - https://example.com/person.png
                  duration: 5
                  size: 720P
              wan26_r2v_reference_image:
                summary: wan2.6-r2v reference-image-to-video
                value:
                  model: wan2.6-r2v
                  prompt: 按参考图主体生成电影感镜头
                  images:
                  - https://example.com/reference.png
                  duration: 10
                  size: 1080P
              wan26_r2v_reference_video:
                summary: wan2.6-r2v reference-video-to-video
                value:
                  model: wan2.6-r2v
                  prompt: 保持参考视频节奏和风格，生成相似镜头
                  duration: 5
                  size: 720P
                  reference_video_urls:
                  - https://example.com/reference.mp4
      responses:
        '200':
          description: Wan2.6 video task accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaProCreateResponse'
              examples:
                wan26_video_task_submitted:
                  summary: Task accepted
                  value:
                    id: task_wan26_202604250001
                    task_id: task_wan26_202604250001
                    object: video
                    model: wan2.6-t2v
                    status: in_progress
                    progress: 0
                    created_at: 1777100000
        '400':
          description: Parameter error or model configuration unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
              examples:
                invalid_duration:
                  value:
                    code: invalid_request
                    message: duration must be one of [5 10 15] for wan2.6-t2v
                    data: null
                missing_price:
                  value:
                    code: invalid_request
                    message: wan2.6 video pricing sku is not configured
                    data: null
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-wan26-t2v-720p-5s
        label: wan2.6-t2v text-to-video
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"wan2.6-t2v\",\n  \"prompt\": \"\
          清晨城市延时摄影，暖色调，电影感。\",\n  \"duration\": 5,\n  \"size\": \"720P\"\n}'"
      - lang: curl-wan26-i2v-flash-audio
        label: wan2.6-i2v-flash image-to-video with audio
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"wan2.6-i2v-flash\",\n  \"prompt\"\
          : \"让照片中的猫在草地上奔跑\",\n  \"images\": [\n    \"https://example.com/cat.png\"\n  ],\n  \"duration\": 10,\n  \"size\"\
          : \"1080P\",\n  \"audio\": true\n}'"
      - lang: curl-wan26-i2v-audio
        label: wan2.6-i2v image-to-video
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"wan2.6-i2v\",\n  \"prompt\": \"\
          让参考图中的人物自然转身看向镜头\",\n  \"images\": [\n    \"https://example.com/person.png\"\n  ],\n  \"duration\": 5,\n  \"size\"\
          : \"720P\"\n}'"
      - lang: curl-wan26-r2v-reference-image
        label: wan2.6-r2v reference-image-to-video
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"wan2.6-r2v\",\n  \"prompt\": \"\
          按参考图主体生成电影感镜头\",\n  \"images\": [\n    \"https://example.com/reference.png\"\n  ],\n  \"duration\": 10,\n  \"size\"\
          : \"1080P\"\n}'"
      - lang: curl-wan26-r2v-reference-video
        label: wan2.6-r2v reference-video-to-video
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"wan2.6-r2v\",\n  \"prompt\": \"\
          保持参考视频节奏和风格，生成相似镜头\",\n  \"duration\": 5,\n  \"size\": \"720P\",\n  \"reference_video_urls\": [\n    \"https://example.com/reference.mp4\"\
          \n  ]\n}'"
  /v1/videos/{task_id}#wan26:
    get:
      tags:
      - Wan2.6 Video
      summary: Query Wan2.6 video task
      description: Use the real endpoint `GET /v1/videos/{task_id}`. If `amount_usd` appears in a successful response, it
        is the USD amount for the completed task.
      parameters:
      - name: task_id
        in: path
        required: true
        schema:
          type: string
        description: Task ID
      responses:
        '200':
          description: Wan2.6 video task status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaProQueryResponse'
              examples:
                wan26_video_completed:
                  summary: Completed
                  value:
                    id: task_wan26_202604250001
                    task_id: task_wan26_202604250001
                    object: video
                    model: wan2.6-t2v
                    status: completed
                    progress: 100
                    amount_usd: 0.43006
                    created_at: 1777100000
                    completed_at: 1777100060
                    results:
                    - url: https://cdn.example.com/video/wan26.mp4
                      width: 1280
                      height: 720
                      duration: 5
                      content_type: video
        '400':
          description: Parameter error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '404':
          description: Task not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-get-v1-videos-task-id
        label: Query Wan2.6 video task
        source: "curl https://api.imarouter.com/v1/videos/task_202604270001 \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'"
  /v1/videos#happyhorse:
    post:
      tags:
      - HappyHorse Video
      summary: Create HappyHorse video task
      description: 'Use the real endpoint `POST /v1/videos` to submit a HappyHorse 1.0 video task.


        Supported models:

        - `happyhorse-1.0-t2v`: text-to-video, category `text_to_video`

        - `happyhorse-1.0-i2v`: image-to-video, category `image_to_video`

        - `happyhorse-1.0-r2v`: reference-image-to-video, category `reference_image_to_video`

        - `happyhorse-1.0-video-edit`: video-to-video edit, category `video_to_video`


        Common parameters:

        - Resolution: `720P`, `1080P`

        - One output video is returned per task

        - `watermark` is not supported and returns 400 if submitted


        `t2v` / `i2v` / `r2v` duration:

        - Duration: `3~15s`


        `video-edit`:

        - Duration is not submitted directly for this model


        `t2v` parameters:

        - Required: `model`, `prompt`

        - Optional: `duration` / `seconds`, `size`, `aspect_ratio`, `seed`

        - `image`, `images`, `video_url`, and `reference_video_urls` are not supported


        `i2v` parameters:

        - Required: `model`, plus exactly one first-frame image source

        - Supported image sources: `image`, `images[0]`, `first_frame_url`, or `media[0].url`

        - `media[0].type` only supports `first_frame`

        - At most one image is allowed; reference video input is not supported

        - `prompt` is optional


        `r2v` parameters:

        - Required: `model`, `prompt`, plus 1 to 9 reference images

        - Supported reference image sources: `image`, `images`, `reference_image_urls`, `media[].url`, or `metadata.reference_image_urls`

        - `media[].type` only supports `reference_image`

        - Supports `aspect_ratio`, `duration` / `seconds`, `size`, and `seed`

        - Reference video input is not supported


        `video-edit` parameters:

        - Required: `model`, `prompt`, plus one source video

        - Supported video sources: `video_url`, `media[].type=video`, or `metadata.video_url`

        - Optional reference images: `reference_image_urls` or `media[].type=reference_image`, at most 5 reference images

        - Supports `size`, `audio_setting`, and `seed`'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Happyhorse10VideoCreateRequest'
            examples:
              happyhorse_t2v_8s_720p:
                summary: HappyHorse text-to-video (8s / 720P)
                value:
                  model: happyhorse-1.0-t2v
                  prompt: A luminous futuristic horse runs through a neon city street with cinematic motion.
                  duration: 8
                  size: 720P
                  aspect_ratio: '1:1'
                  seed: 42
              happyhorse_t2v_15s_1080p:
                summary: HappyHorse text-to-video (15s / 1080P)
                value:
                  model: happyhorse-1.0-t2v
                  prompt: A white horse races along a sunset coastline in slow motion with dramatic light.
                  duration: 15
                  size: 1080P
                  aspect_ratio: '16:9'
              happyhorse_i2v_first_frame_8s_720p:
                summary: HappyHorse image-to-video (image / 8s / 720P)
                value:
                  model: happyhorse-1.0-i2v
                  image: https://cdn.example.com/input/horse.png
                  prompt: Animate the horse with subtle cinematic forward motion and natural mane movement.
                  duration: 8
                  size: 720P
                  seed: 42
              happyhorse_i2v_media_5s_1080p:
                summary: HappyHorse image-to-video (media / 5s / 1080P)
                value:
                  model: happyhorse-1.0-i2v
                  media:
                  - type: first_frame
                    url: https://cdn.example.com/input/horse-first-frame.png
                  duration: 5
                  size: 1080P
              happyhorse_r2v_references_8s_720p:
                summary: HappyHorse reference-image-to-video (reference_image_urls / 8s / 720P)
                value:
                  model: happyhorse-1.0-r2v
                  prompt: Animate the same character references into a cinematic running shot.
                  reference_image_urls:
                  - https://cdn.example.com/input/horse-reference-a.png
                  - https://cdn.example.com/input/horse-reference-b.png
                  duration: 8
                  size: 720P
                  aspect_ratio: '9:16'
                  seed: 42
              happyhorse_r2v_media_5s_1080p:
                summary: HappyHorse reference-image-to-video (media / 5s / 1080P)
                value:
                  model: happyhorse-1.0-r2v
                  prompt: Keep the character identity consistent while changing the background to a studio scene.
                  media:
                  - type: reference_image
                    url: https://cdn.example.com/input/horse-reference.png
                  duration: 5
                  size: 1080P
              happyhorse_video_edit_video_url_1080p:
                summary: HappyHorse video edit (video_url / 1080P)
                value:
                  model: happyhorse-1.0-video-edit
                  prompt: Keep the main subject while replacing the scene with a clean studio background.
                  video_url: https://cdn.example.com/input/happyhorse-source.mp4
                  reference_image_urls:
                  - https://cdn.example.com/input/happyhorse-reference.png
                  size: 1080P
                  audio_setting: auto
                  seed: 42
              happyhorse_video_edit_media_720p:
                summary: HappyHorse video edit (media / 720P)
                value:
                  model: happyhorse-1.0-video-edit
                  prompt: Preserve the main subject and apply a clean editorial color grade.
                  media:
                  - type: video
                    url: https://cdn.example.com/input/happyhorse-source.mp4
                  - type: reference_image
                    url: https://cdn.example.com/input/happyhorse-reference.png
                  size: 720P
                  audio_setting: origin
      responses:
        '200':
          description: HappyHorse video task accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaProCreateResponse'
              examples:
                happyhorse_video_task_submitted:
                  summary: Task accepted
                  value:
                    id: task_happyhorse_202604270001
                    task_id: task_happyhorse_202604270001
                    object: video
                    model: happyhorse-1.0-t2v
                    status: in_progress
                    progress: 0
                    created_at: 1777200000
                happyhorse_i2v_task_submitted:
                  summary: Image-to-video task accepted
                  value:
                    id: task_happyhorse_i2v_202604270001
                    task_id: task_happyhorse_i2v_202604270001
                    object: video
                    model: happyhorse-1.0-i2v
                    status: in_progress
                    progress: 0
                    created_at: 1777200000
                happyhorse_r2v_task_submitted:
                  summary: Reference-image-to-video task accepted
                  value:
                    id: task_happyhorse_r2v_202604270001
                    task_id: task_happyhorse_r2v_202604270001
                    object: video
                    model: happyhorse-1.0-r2v
                    status: in_progress
                    progress: 0
                    created_at: 1777200000
                happyhorse_video_edit_task_submitted:
                  summary: Video edit task accepted
                  value:
                    id: task_happyhorse_video_edit_202604270001
                    task_id: task_happyhorse_video_edit_202604270001
                    object: video
                    model: happyhorse-1.0-video-edit
                    status: in_progress
                    progress: 0
                    created_at: 1777200000
        '400':
          description: Parameter error or model configuration unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
              examples:
                invalid_duration:
                  summary: Unsupported duration
                  value:
                    code: invalid_request
                    message: duration must be one of [3 4 5 6 7 8 9 10 11 12 13 14 15] for happyhorse-1.0-t2v
                    data: null
                invalid_i2v_media:
                  summary: Invalid image-to-video image input
                  value:
                    code: invalid_request
                    message: happyhorse-1.0-i2v supports at most 1 image input
                    data: null
                invalid_r2v_media:
                  summary: Invalid reference image input
                  value:
                    code: invalid_request
                    message: happyhorse-1.0-r2v supports at most 9 reference images
                    data: null
                invalid_video_edit_media:
                  summary: Invalid video edit input
                  value:
                    code: invalid_request
                    message: happyhorse-1.0-video-edit supports at most 5 reference images
                    data: null
                invalid_video_edit_prompt:
                  summary: Missing video edit prompt
                  value:
                    code: invalid_request
                    message: prompt is required for happyhorse-1.0-video-edit
                    data: null
                invalid_watermark:
                  summary: Watermark parameter is not exposed
                  value:
                    code: invalid_request
                    message: happyhorse-1.0-r2v watermark is not supported
                    data: null
                missing_price:
                  summary: Missing model configuration
                  value:
                    code: invalid_request
                    message: happyhorse video configuration is unavailable
                    data: null
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-happyhorse-t2v-8s-720p
        label: HappyHorse text-to-video (8s / 720P)
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"happyhorse-1.0-t2v\",\n  \"prompt\"\
          : \"A luminous futuristic horse runs through a neon city street with cinematic motion.\",\n  \"duration\": 8,\n\
          \  \"size\": \"720P\",\n  \"aspect_ratio\": \"1:1\",\n  \"seed\": 42\n}'"
      - lang: curl-happyhorse-t2v-15s-1080p
        label: HappyHorse text-to-video (15s / 1080P)
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"happyhorse-1.0-t2v\",\n  \"prompt\"\
          : \"A white horse races along a sunset coastline in slow motion with dramatic light.\",\n  \"duration\": 15,\n \
          \ \"size\": \"1080P\",\n  \"aspect_ratio\": \"16:9\"\n}'"
      - lang: curl-happyhorse-i2v-first-frame-8s-720p
        label: HappyHorse image-to-video (image / 8s / 720P)
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"happyhorse-1.0-i2v\",\n  \"image\"\
          : \"https://cdn.example.com/input/horse.png\",\n  \"prompt\": \"Animate the horse with subtle cinematic forward\
          \ motion and natural mane movement.\",\n  \"duration\": 8,\n  \"size\": \"720P\",\n  \"seed\": 42\n}'"
      - lang: curl-happyhorse-i2v-media-5s-1080p
        label: HappyHorse image-to-video (media / 5s / 1080P)
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"happyhorse-1.0-i2v\",\n  \"media\"\
          : [\n    {\n      \"type\": \"first_frame\",\n      \"url\": \"https://cdn.example.com/input/horse-first-frame.png\"\
          \n    }\n  ],\n  \"duration\": 5,\n  \"size\": \"1080P\"\n}'"
      - lang: curl-happyhorse-r2v-references-8s-720p
        label: HappyHorse reference-image-to-video (reference_image_urls / 8s / 720P)
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"happyhorse-1.0-r2v\",\n  \"prompt\"\
          : \"Animate the same character references into a cinematic running shot.\",\n  \"reference_image_urls\": [\n   \
          \ \"https://cdn.example.com/input/horse-reference-a.png\",\n    \"https://cdn.example.com/input/horse-reference-b.png\"\
          \n  ],\n  \"duration\": 8,\n  \"size\": \"720P\",\n  \"aspect_ratio\": \"9:16\",\n  \"seed\": 42\n}'"
      - lang: curl-happyhorse-r2v-media-5s-1080p
        label: HappyHorse reference-image-to-video (media / 5s / 1080P)
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"happyhorse-1.0-r2v\",\n  \"prompt\"\
          : \"Keep the character identity consistent while changing the background to a studio scene.\",\n  \"media\": [\n\
          \    {\n      \"type\": \"reference_image\",\n      \"url\": \"https://cdn.example.com/input/horse-reference.png\"\
          \n    }\n  ],\n  \"duration\": 5,\n  \"size\": \"1080P\"\n}'"
      - lang: curl-happyhorse-video-edit-video-url-1080p
        label: HappyHorse video edit (video_url / 1080P)
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"happyhorse-1.0-video-edit\",\n\
          \  \"prompt\": \"Keep the main subject while replacing the scene with a clean studio background.\",\n  \"video_url\"\
          : \"https://cdn.example.com/input/happyhorse-source.mp4\",\n  \"reference_image_urls\": [\n    \"https://cdn.example.com/input/happyhorse-reference.png\"\
          \n  ],\n  \"size\": \"1080P\",\n  \"audio_setting\": \"auto\",\n  \"seed\": 42\n}'"
      - lang: curl-happyhorse-video-edit-media-720p
        label: HappyHorse video edit (media / 720P)
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"happyhorse-1.0-video-edit\",\n\
          \  \"prompt\": \"Preserve the main subject and apply a clean editorial color grade.\",\n  \"media\": [\n    {\n\
          \      \"type\": \"video\",\n      \"url\": \"https://cdn.example.com/input/happyhorse-source.mp4\"\n    },\n  \
          \  {\n      \"type\": \"reference_image\",\n      \"url\": \"https://cdn.example.com/input/happyhorse-reference.png\"\
          \n    }\n  ],\n  \"size\": \"720P\",\n  \"audio_setting\": \"origin\"\n}'"
  /v1/videos/{task_id}#happyhorse:
    get:
      tags:
      - HappyHorse Video
      summary: Query HappyHorse video task
      description: Use the real endpoint `GET /v1/videos/{task_id}` to query the task status of `happyhorse-1.0-t2v`, `happyhorse-1.0-i2v`,
        `happyhorse-1.0-r2v`, or `happyhorse-1.0-video-edit`. If `amount_usd` appears in a successful response, it is the
        USD amount for the completed task.
      parameters:
      - name: task_id
        in: path
        required: true
        schema:
          type: string
        description: Task ID
      responses:
        '200':
          description: HappyHorse video task status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaProQueryResponse'
              examples:
                happyhorse_video_completed:
                  summary: Completed
                  value:
                    id: task_happyhorse_202604270001
                    task_id: task_happyhorse_202604270001
                    object: video
                    model: happyhorse-1.0-t2v
                    status: completed
                    progress: 100
                    amount_usd: 0.986301
                    created_at: 1777200000
                    completed_at: 1777200060
                    results:
                    - url: https://cdn.example.com/video/happyhorse.mp4
                      width: 1280
                      height: 720
                      duration: 8
                      content_type: video
                happyhorse_i2v_video_completed:
                  summary: Image-to-video completed
                  value:
                    id: task_happyhorse_i2v_202604270001
                    task_id: task_happyhorse_i2v_202604270001
                    object: video
                    model: happyhorse-1.0-i2v
                    status: completed
                    progress: 100
                    amount_usd: 0.986301
                    created_at: 1777200000
                    completed_at: 1777200060
                    results:
                    - url: https://cdn.example.com/video/happyhorse-i2v.mp4
                      width: 1280
                      height: 720
                      duration: 8
                      content_type: video
                happyhorse_r2v_video_completed:
                  summary: Reference-image-to-video completed
                  value:
                    id: task_happyhorse_r2v_202604270001
                    task_id: task_happyhorse_r2v_202604270001
                    object: video
                    model: happyhorse-1.0-r2v
                    status: completed
                    progress: 100
                    amount_usd: 0.986301
                    created_at: 1777200000
                    completed_at: 1777200060
                    results:
                    - url: https://cdn.example.com/video/happyhorse-r2v.mp4
                      width: 1280
                      height: 720
                      duration: 8
                      content_type: video
                happyhorse_video_edit_completed:
                  summary: Video edit completed
                  value:
                    id: task_happyhorse_video_edit_202604270001
                    task_id: task_happyhorse_video_edit_202604270001
                    object: video
                    model: happyhorse-1.0-video-edit
                    status: completed
                    progress: 100
                    amount_usd: 0.739726
                    created_at: 1777200000
                    completed_at: 1777200060
                    results:
                    - url: https://cdn.example.com/video/happyhorse-video-edit.mp4
                      width: 1280
                      height: 720
                      duration: 6
                      content_type: video
                    usage:
                      input_video_duration: 6
                      output_video_duration: 6
        '400':
          description: Parameter error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '404':
          description: Task not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-get-v1-videos-task-id
        label: Query HappyHorse video task
        source: "curl https://api.imarouter.com/v1/videos/task_202604270001 \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'"
  /v1/videos#kling-v3-video:
    post:
      tags:
      - Kling Video
      summary: Create Kling v3 Video task
      description: 'Use the real endpoint `POST /v1/videos` to submit a `kling-v3-video` task.


        Supported categories:

        - `text_to_video`

        - `image_to_video`

        - `first_last_frame_to_video`

        - `reference_image_to_video`


        Parameters:

        - Duration: `3~15s`

        - `mode`: `std` or `pro`

        - `sound`: `on` or `off`

        - `aspect_ratio`: `16:9`, `9:16`, or `1:1`

        - `shot_type`: `customize` or `intelligence`

        - URL image inputs use `image`, `images`, `first_frame_url`, or `last_frame_url` and select image-to-video / first-last-frame
        modes

        - The `reference_image_to_video` category supports subject references shaped as `element_list: [{"element_id": 12345}]`

        - `camera_control` is supported for `kling-v3-video`

        - One output video is returned per task'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KlingV3VideoCreateRequest'
            examples:
              kling_v3_video_text_std_noaudio:
                summary: Kling v3 Video text-to-video std/no audio
                value:
                  model: kling-v3-video
                  prompt: A cinematic tracking shot of a horse running through rain at night.
                  duration: 5
                  aspect_ratio: '16:9'
                  mode: std
                  sound: 'off'
              kling_v3_video_image_pro_audio:
                summary: Kling v3 Video image-to-video pro/audio
                value:
                  model: kling-v3-video
                  prompt: Animate this reference into a smooth camera push-in.
                  image: https://cdn.example.com/input/kling-reference.png
                  duration: 8
                  aspect_ratio: '9:16'
                  mode: pro
                  sound: 'on'
              kling_v3_video_first_last_frame:
                summary: Kling v3 Video first and last frame
                value:
                  model: kling-v3-video
                  prompt: Create a fluid transition from the first frame to the last frame.
                  images:
                  - https://cdn.example.com/input/kling-first-frame.png
                  - https://cdn.example.com/input/kling-last-frame.png
                  duration: 6
                  aspect_ratio: '16:9'
                  mode: std
                  sound: 'off'
              kling_v3_video_reference_images:
                summary: Kling v3 Video subject element reference
                value:
                  model: kling-v3-video
                  prompt: Keep the same subject identity and generate a cinematic action shot.
                  element_list:
                  - element_id: 12345
                  duration: 10
                  aspect_ratio: '1:1'
                  mode: pro
                  sound: 'off'
      responses:
        '200':
          description: Kling v3 Video task accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaProCreateResponse'
              examples:
                kling_v3_video_task_submitted:
                  summary: Task accepted
                  value:
                    id: task_kling_v3_video_202604270001
                    task_id: task_kling_v3_video_202604270001
                    object: video
                    model: kling-v3-video
                    status: in_progress
                    progress: 0
                    created_at: 1777200000
        '400':
          description: Parameter error or model configuration unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
              examples:
                invalid_duration:
                  summary: Unsupported duration
                  value:
                    code: invalid_request
                    message: duration must be one of [3 4 5 6 7 8 9 10 11 12 13 14 15] for kling-v3-video
                    data: null
                invalid_mode:
                  summary: Unsupported mode
                  value:
                    code: invalid_request
                    message: kling-v3-video mode must be one of [pro std]
                    data: null
                missing_price:
                  summary: Missing model configuration
                  value:
                    code: invalid_request
                    message: model configuration is unavailable
                    data: null
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-kling-v3-video-text-std-noaudio
        label: Kling v3 Video text-to-video std/no audio
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"kling-v3-video\",\n  \"prompt\"\
          : \"A cinematic tracking shot of a horse running through rain at night.\",\n  \"duration\": 5,\n  \"aspect_ratio\"\
          : \"16:9\",\n  \"mode\": \"std\",\n  \"sound\": \"off\"\n}'"
      - lang: curl-kling-v3-video-image-pro-audio
        label: Kling v3 Video image-to-video pro/audio
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"kling-v3-video\",\n  \"prompt\"\
          : \"Animate this reference into a smooth camera push-in.\",\n  \"image\": \"https://cdn.example.com/input/kling-reference.png\"\
          ,\n  \"duration\": 8,\n  \"aspect_ratio\": \"9:16\",\n  \"mode\": \"pro\",\n  \"sound\": \"on\"\n}'"
      - lang: curl-kling-v3-video-first-last-frame
        label: Kling v3 Video first and last frame
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"kling-v3-video\",\n  \"prompt\"\
          : \"Create a fluid transition from the first frame to the last frame.\",\n  \"images\": [\n    \"https://cdn.example.com/input/kling-first-frame.png\"\
          ,\n    \"https://cdn.example.com/input/kling-last-frame.png\"\n  ],\n  \"duration\": 6,\n  \"aspect_ratio\": \"\
          16:9\",\n  \"mode\": \"std\",\n  \"sound\": \"off\"\n}'"
      - lang: curl-kling-v3-video-reference-images
        label: Kling v3 Video subject element reference
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"kling-v3-video\",\n  \"prompt\"\
          : \"Keep the same subject identity and generate a cinematic action shot.\",\n  \"element_list\": [\n    {\n    \
          \  \"element_id\": 12345\n    }\n  ],\n  \"duration\": 10,\n  \"aspect_ratio\": \"1:1\",\n  \"mode\": \"pro\",\n\
          \  \"sound\": \"off\"\n}'"
  /v1/videos/{task_id}#kling-v3-video:
    get:
      tags:
      - Kling Video
      summary: Query Kling v3 Video task
      description: Use the real endpoint `GET /v1/videos/{task_id}` to query a `kling-v3-video` task. If `amount_usd` appears
        in a successful response, it is the USD amount for the completed task.
      parameters:
      - name: task_id
        in: path
        required: true
        schema:
          type: string
        description: Task ID
      responses:
        '200':
          description: Kling v3 Video task status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaProQueryResponse'
              examples:
                kling_v3_video_completed:
                  summary: Completed
                  value:
                    id: task_kling_v3_video_202604270001
                    task_id: task_kling_v3_video_202604270001
                    object: video
                    model: kling-v3-video
                    status: completed
                    progress: 100
                    amount_usd: 0.410959
                    created_at: 1777200000
                    completed_at: 1777200060
                    results:
                    - url: https://cdn.example.com/video/kling-v3-video.mp4
                      width: 1280
                      height: 720
                      duration: 5
                      content_type: video
        '400':
          description: Parameter error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '404':
          description: Task not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-get-v1-videos-task-id
        label: Query Kling v3 Video task
        source: "curl https://api.imarouter.com/v1/videos/task_202604270001 \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'"
  /v1/videos#kling-v3-omni-video:
    post:
      tags:
      - Kling Video
      summary: Create Kling v3 Omni Video task
      description: 'Use the real endpoint `POST /v1/videos` to submit a `kling-v3-omni-video` task.


        Supported categories:

        - `text_to_video`

        - `image_to_video`

        - `first_last_frame_to_video`

        - `reference_image_to_video`


        Parameters:

        - Duration: `3~15s`

        - `mode`: `std` or `pro`

        - `sound`: `on` or `off`

        - `aspect_ratio`: `16:9`, `9:16`, or `1:1`

        - `shot_type`: only `customize` is supported

        - `video_url` / `video_list` indicate video input; this shape only supports `3~10s`, and `sound=on` with `video_url`
        / `video_list` returns 400

        - `image_list` uses `image_url` with optional `type` of only `first_frame` or `end_frame`

        - `element_list` supports subject references shaped as `{ element_id }`; media URLs must use `image_list` or `video_list`

        - `image`, `images`, and reference-image compatibility fields are accepted as image inputs

        - One output video is returned per task'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KlingV3OmniVideoCreateRequest'
            examples:
              kling_v3_omni_text_std_noaudio:
                summary: Kling v3 Omni Video text-to-video std/no audio
                value:
                  model: kling-v3-omni-video
                  prompt: A cinematic shot of a glass sculpture forming from light.
                  duration: 5
                  aspect_ratio: '16:9'
                  mode: std
                  sound: 'off'
              kling_v3_omni_text_pro_audio_no_voice:
                summary: Kling v3 Omni Video text-to-video pro/audio-no-voice
                value:
                  model: kling-v3-omni-video
                  prompt: A neon city sequence with ambient rain and distant traffic sound.
                  duration: 8
                  aspect_ratio: '16:9'
                  mode: pro
                  sound: 'on'
              kling_v3_omni_reference_images:
                summary: Kling v3 Omni Video reference images
                value:
                  model: kling-v3-omni-video
                  prompt: Preserve the character identity and generate a polished product-style clip.
                  image_list:
                  - https://cdn.example.com/input/kling-ref-a.png
                  - https://cdn.example.com/input/kling-ref-b.png
                  duration: 10
                  mode: pro
                  sound: 'off'
              kling_v3_omni_reference_video:
                summary: Kling v3 Omni Video reference video std/no audio
                value:
                  model: kling-v3-omni-video
                  prompt: Use the source video as motion reference and generate a cleaner cinematic version.
                  video_list:
                  - video_url: https://cdn.example.com/input/kling-reference-video.mp4
                  duration: 7
                  mode: std
                  sound: 'off'
      responses:
        '200':
          description: Kling v3 Omni Video task accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaProCreateResponse'
              examples:
                kling_v3_omni_task_submitted:
                  summary: Task accepted
                  value:
                    id: task_kling_v3_omni_202604270001
                    task_id: task_kling_v3_omni_202604270001
                    object: video
                    model: kling-v3-omni-video
                    status: in_progress
                    progress: 0
                    created_at: 1777200000
        '400':
          description: Parameter error or model configuration unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
              examples:
                invalid_duration:
                  summary: Unsupported duration
                  value:
                    code: invalid_request
                    message: duration must be one of [3 4 5 6 7 8 9 10 11 12 13 14 15] for kling-v3-omni-video
                    data: null
                invalid_sound_reference_video:
                  summary: Audio conflicts with reference video
                  value:
                    code: invalid_request
                    message: kling-v3-omni-video sound=on cannot be combined with video_list or video_url reference video
                    data: null
                invalid_motion_control_duration:
                  summary: Reference video duration too long
                  value:
                    code: invalid_request
                    message: kling-v3-omni-video video_url or video_list motion_control duration must not exceed 10 seconds
                    data: null
                missing_price:
                  summary: Missing model configuration
                  value:
                    code: invalid_request
                    message: exact per-call pricing sku is not configured
                    data: null
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-kling-v3-omni-text-std-noaudio
        label: Kling v3 Omni Video text-to-video std/no audio
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"kling-v3-omni-video\",\n  \"prompt\"\
          : \"A cinematic shot of a glass sculpture forming from light.\",\n  \"duration\": 5,\n  \"aspect_ratio\": \"16:9\"\
          ,\n  \"mode\": \"std\",\n  \"sound\": \"off\"\n}'"
      - lang: curl-kling-v3-omni-text-pro-audio-no-voice
        label: Kling v3 Omni Video text-to-video pro/audio-no-voice
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"kling-v3-omni-video\",\n  \"prompt\"\
          : \"A neon city sequence with ambient rain and distant traffic sound.\",\n  \"duration\": 8,\n  \"aspect_ratio\"\
          : \"16:9\",\n  \"mode\": \"pro\",\n  \"sound\": \"on\"\n}'"
      - lang: curl-kling-v3-omni-reference-images
        label: Kling v3 Omni Video reference images
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"kling-v3-omni-video\",\n  \"prompt\"\
          : \"Preserve the character identity and generate a polished product-style clip.\",\n  \"image_list\": [\n    \"\
          https://cdn.example.com/input/kling-ref-a.png\",\n    \"https://cdn.example.com/input/kling-ref-b.png\"\n  ],\n\
          \  \"duration\": 10,\n  \"mode\": \"pro\",\n  \"sound\": \"off\"\n}'"
      - lang: curl-kling-v3-omni-reference-video
        label: Kling v3 Omni Video reference video std/no audio
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"kling-v3-omni-video\",\n  \"prompt\"\
          : \"Use the source video as motion reference and generate a cleaner cinematic version.\",\n  \"video_list\": [\n\
          \    {\n      \"video_url\": \"https://cdn.example.com/input/kling-reference-video.mp4\"\n    }\n  ],\n  \"duration\"\
          : 7,\n  \"mode\": \"std\",\n  \"sound\": \"off\"\n}'"
  /v1/videos/{task_id}#kling-v3-omni-video:
    get:
      tags:
      - Kling Video
      summary: Query Kling v3 Omni Video task
      description: Use the real endpoint `GET /v1/videos/{task_id}` to query a `kling-v3-omni-video` task. If `amount_usd`
        appears in a successful response, it is the USD amount for the completed task.
      parameters:
      - name: task_id
        in: path
        required: true
        schema:
          type: string
        description: Task ID
      responses:
        '200':
          description: Kling v3 Omni Video task status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaProQueryResponse'
              examples:
                kling_v3_omni_completed:
                  summary: Completed
                  value:
                    id: task_kling_v3_omni_202604270001
                    task_id: task_kling_v3_omni_202604270001
                    object: video
                    model: kling-v3-omni-video
                    status: completed
                    progress: 100
                    amount_usd: 0.42
                    created_at: 1777200000
                    completed_at: 1777200060
                    results:
                    - url: https://cdn.example.com/video/kling-v3-omni-video.mp4
                      width: 1280
                      height: 720
                      duration: 5
                      content_type: video
        '400':
          description: Parameter error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '404':
          description: Task not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-get-v1-videos-task-id
        label: Query Kling v3 Omni Video task
        source: "curl https://api.imarouter.com/v1/videos/task_202604270001 \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'"
  /v1/videos#kling:
    post:
      tags:
      - Kling Video
      summary: Submit Kling video task (OpenAI compatible endpoint)
      operationId: createKlingOpenAIVideoTask
      description: 'OpenAI compatible submission endpoint for legacy Kling video models. This document only shows the Kling
        model-family request body under `POST /v1/videos`; do not merge other video model families into this page.


        **Actual request path:** `POST /v1/videos`


        **Supported models:**

        - `kling-v1`

        - `kling-v1-6`

        - `kling-v2-master`

        - `kling-v2-1-master`

        - `kling-v2-5-turbo`

        - `kling-v2-6`

        - `kling-video-o1`


        **Parameters:**

        - `prompt`: text prompt.

        - `image`: optional first-frame or reference image URL.

        - `image_tail`: optional last-frame URL for first/last-frame mode.

        - `duration`: duration, 5 or 10 seconds.

        - `aspect_ratio`: `1:1`, `16:9`, or `9:16`.

        - `mode`: `std` or `pro`.


        **Endpoint-family note:** This is the Kling family documentation page for `/v1/videos`. The import OpenAPI materializes
        it with the other families on the same real endpoint into one sendable contract.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KlingVideoRequest'
            examples:
              kling_v1_6_text2video:
                summary: Kling v1.6 text-to-video
                value:
                  model: kling-v1-6
                  prompt: A cat playing with a ball of yarn in a sunny room
                  duration: 5
                  aspect_ratio: '16:9'
                  mode: std
                  cfg_scale: 0.5
              kling_v2_5_image2video:
                summary: Kling v2.5 image-to-video first/last-frame
                value:
                  model: kling-v2-5-turbo
                  prompt: Smooth transition between two scenes
                  image: https://example.com/first_frame.jpg
                  image_tail: https://example.com/last_frame.jpg
                  duration: 5
                  aspect_ratio: '16:9'
                  mode: pro
                  cfg_scale: 0.5
      responses:
        '200':
          description: Kling video task accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaProCreateResponse'
              examples:
                kling_task_submitted:
                  summary: Task accepted
                  value:
                    id: task_kling_202605220001
                    task_id: task_kling_202605220001
                    object: video
                    model: kling-v1-6
                    status: in_progress
                    progress: 0
                    created_at: 1779400000
        '400':
          description: Parameter error or upstream validation failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
              examples:
                image_pixel_invalid:
                  summary: Invalid input image pixels
                  value:
                    code: '500'
                    message: Image pixel is invalid
                    data: null
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-kling-v1-6-text2video
        label: Kling v1.6 text-to-video
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"kling-v1-6\",\n  \"prompt\": \"\
          A cat playing with a ball of yarn in a sunny room\",\n  \"duration\": 5,\n  \"aspect_ratio\": \"16:9\",\n  \"mode\"\
          : \"std\",\n  \"cfg_scale\": 0.5\n}'"
      - lang: curl-kling-v2-5-image2video
        label: Kling v2.5 image-to-video first/last-frame
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"kling-v2-5-turbo\",\n  \"prompt\"\
          : \"Smooth transition between two scenes\",\n  \"image\": \"https://example.com/first_frame.jpg\",\n  \"image_tail\"\
          : \"https://example.com/last_frame.jpg\",\n  \"duration\": 5,\n  \"aspect_ratio\": \"16:9\",\n  \"mode\": \"pro\"\
          ,\n  \"cfg_scale\": 0.5\n}'"
  /v1/videos#vidu:
    post:
      tags:
      - Vidu Video
      summary: Submit Vidu video task (OpenAI compatible endpoint)
      operationId: createViduOpenAIVideoTask
      description: 'OpenAI compatible submission endpoint for Vidu video models. This document only shows the Vidu model-family
        request body under `POST /v1/videos`; do not merge other video model families into this page.


        **Actual request path:** `POST /v1/videos`


        **Supported models:**

        - `viduq1` (fixed 1080P/5s)

        - `viduq2` (text-to-video, supports 540P-1080P)

        - `viduq2-pro` (image-to-video only, supports 540P-1080P)

        - `viduq2-turbo` (image-to-video only, supports 540P-1080P)

        - `viduq3-pro` (text-to-video / image-to-video, billed per second)

        - `viduq3-turbo` (text-to-video / image-to-video, billed per second)


        **Parameters:**

        - `prompt`: required for text-to-video.

        - `images`: image URL array for image-to-video. Single image = reference image; two images = first and last frames.

        - `duration`: duration, default 5. viduq1 is fixed to 5s; viduq3 supports 1-16s.

        - `metadata.resolution`: resolution: `540p`, `720p`, or `1080p`.


        **Endpoint-family note:** This is the Vidu family documentation page for `/v1/videos`. The import OpenAPI materializes
        it with the other families on the same real endpoint into one sendable contract.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ViduVideoRequest'
            examples:
              viduq1_text2video:
                summary: viduq1 text-to-video (1080P/5s)
                value:
                  model: viduq1
                  prompt: A golden retriever running on a sunny beach with waves crashing in the background
              viduq2_text2video_720p:
                summary: viduq2 text-to-video (720P/5s)
                value:
                  model: viduq2
                  prompt: A cinematic drone shot above a quiet lake at sunrise
                  duration: 5
                  metadata:
                    resolution: 720p
              viduq2pro_img2video:
                summary: viduq2-pro image-to-video (single reference)
                value:
                  model: viduq2-pro
                  prompt: The person slowly turns and smiles
                  images:
                  - https://example.com/reference.jpg
                  duration: 5
              viduq3pro_text2video:
                summary: viduq3-pro text-to-video (720P/10s)
                value:
                  model: viduq3-pro
                  prompt: A cat playing with a ball of yarn in a cozy room with warm lighting
                  duration: 10
                  metadata:
                    resolution: 720p
      responses:
        '200':
          description: Vidu video task accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaProCreateResponse'
              examples:
                vidu_task_submitted:
                  summary: Task accepted
                  value:
                    id: task_vidu_202605220001
                    task_id: task_vidu_202605220001
                    object: video
                    model: viduq3-pro
                    status: in_progress
                    progress: 0
                    created_at: 1779400000
        '400':
          description: Parameter error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
              examples:
                model_not_supported:
                  summary: Text-only request sent to an image-to-video-only model
                  value:
                    code: invalid_request
                    message: model viduq2-pro only supports image-to-video, please provide images
                    data: null
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-viduq1-text2video
        label: viduq1 text-to-video (1080P/5s)
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"viduq1\",\n  \"prompt\": \"A golden\
          \ retriever running on a sunny beach with waves crashing in the background\"\n}'"
      - lang: curl-viduq2-text2video-720p
        label: viduq2 text-to-video (720P/5s)
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"viduq2\",\n  \"prompt\": \"A cinematic\
          \ drone shot above a quiet lake at sunrise\",\n  \"duration\": 5,\n  \"metadata\": {\n    \"resolution\": \"720p\"\
          \n  }\n}'"
      - lang: curl-viduq2pro-img2video
        label: viduq2-pro image-to-video (single reference)
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"viduq2-pro\",\n  \"prompt\": \"\
          The person slowly turns and smiles\",\n  \"images\": [\n    \"https://example.com/reference.jpg\"\n  ],\n  \"duration\"\
          : 5\n}'"
      - lang: curl-viduq3pro-text2video
        label: viduq3-pro text-to-video (720P/10s)
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"viduq3-pro\",\n  \"prompt\": \"\
          A cat playing with a ball of yarn in a cozy room with warm lighting\",\n  \"duration\": 10,\n  \"metadata\": {\n\
          \    \"resolution\": \"720p\"\n  }\n}'"
  /v1/videos#pixverse:
    post:
      tags:
      - Pixverse Video
      summary: Create Pixverse video task (OpenAI compatible endpoint)
      operationId: createPixverseOpenAIVideoTask
      description: 'OpenAI-compatible submission endpoint for Pixverse video models. This page only shows the Pixverse model
        family request body under `POST /v1/videos`.


        **Actual request path:** `POST /v1/videos`


        **Supported models:**

        - `pixverse-c1`

        - `pixverse-v6`


        **Parameters:**

        - `prompt`: required.

        - `duration`: duration in seconds, default 5.

        - `size`: aspect ratio, default `16:9`; also supports `9:16` and `1:1`.

        - `quality`: resolution tier, one of `360p`, `540p`, `720p`, `1080p`.

        - `metadata.audio` or `metadata.generate_audio_switch`: whether to generate audio.

        - `metadata.img_id`: Pixverse image ID; when present, the task is submitted as image-to-video.


        After successful submission, the response returns a task ID. Use `GET /v1/videos/{task_id}` to query status and results.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PixverseVideoCreateRequest'
            examples:
              pixverse_c1_text_720p:
                summary: Pixverse C1 text 720p
                value:
                  model: pixverse-c1
                  prompt: A cinematic city street at night with neon reflections
                  duration: 5
                  size: '16:9'
                  quality: 720p
              pixverse_v6_text_audio:
                summary: Pixverse V6 text 1080p with audio
                value:
                  model: pixverse-v6
                  prompt: A slow push-in shot of a product on a clean studio table
                  duration: 5
                  size: '9:16'
                  quality: 1080p
                  metadata:
                    audio: true
      responses:
        '200':
          description: Pixverse video task accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaProCreateResponse'
              examples:
                pixverse_task_submitted:
                  summary: Pixverse returns task ID
                  value:
                    id: task_pixverse_202605220001
                    task_id: task_pixverse_202605220001
                    object: video
                    model: pixverse-v6
                    status: in_progress
                    progress: 0
                    created_at: 1779400000
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-pixverse-c1-text-720p
        label: Pixverse C1 text 720p
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"pixverse-c1\",\n  \"prompt\":\
          \ \"A cinematic city street at night with neon reflections\",\n  \"duration\": 5,\n  \"size\": \"16:9\",\n  \"quality\"\
          : \"720p\"\n}'"
      - lang: curl-pixverse-v6-text-audio
        label: Pixverse V6 text 1080p with audio
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"pixverse-v6\",\n  \"prompt\":\
          \ \"A slow push-in shot of a product on a clean studio table\",\n  \"duration\": 5,\n  \"size\": \"9:16\",\n  \"\
          quality\": \"1080p\",\n  \"metadata\": {\n    \"audio\": true\n  }\n}'"
  /v1/videos#veo:
    post:
      tags:
      - Veo Video
      summary: Create Veo video task (OpenAI compatible endpoint)
      operationId: createVeoOpenAIVideoTask
      description: 'OpenAI-compatible submission endpoint for Veo video models. This page only shows the Veo model family
        request body under `POST /v1/videos`.


        **Actual request path:** `POST /v1/videos`


        **Supported models:**

        - `veo-3.0-generate-001`

        - `veo-3.1-fast-generate-001`


        **Parameters:**

        - `prompt`: required.

        - `duration` / `seconds` / `durationSeconds`: video duration. The current public contract supports only 4 or 8 seconds.

        - `resolution`: `veo-3.0-generate-001` supports `720p` and `1080p`; `veo-3.1-fast-generate-001` also supports `4k`.

        - `aspectRatio` / `aspect_ratio`: supports `16:9` and `9:16`.

        - `image` / `images`: image inputs. For `veo-3.1-fast-generate-001`, pass reference images through `images` (1 to
        3 URLs). Two images default to `reference_image_to_video`; set `metadata.role_mode=frame` when the two images are
        first and last frames. `reference_image_urls` is not read by the Veo 3.1 public request contract.


        **Endpoint family note:** this is the Veo family page for `/v1/videos`. Import-oriented OpenAPI merges it with other
        families on the same real endpoint.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VeoVideoCreateRequest'
            examples:
              veo30_text_720p:
                summary: Veo 3.0 text 720p
                value:
                  model: veo-3.0-generate-001
                  prompt: A cinematic drone shot over a coastal city at sunrise
                  duration: 4
                  resolution: 720p
                  aspectRatio: '16:9'
              veo31_fast_text_1080p:
                summary: Veo 3.1 Fast text 1080p
                value:
                  model: veo-3.1-fast-generate-001
                  prompt: A vertical fashion runway clip with smooth camera motion
                  durationSeconds: 8
                  resolution: 1080p
                  aspectRatio: '9:16'
      responses:
        '200':
          description: Veo video task accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaProCreateResponse'
              examples:
                veo_task_submitted:
                  summary: Veo returns task ID
                  value:
                    id: task_veo_202605220001
                    task_id: task_veo_202605220001
                    object: video
                    model: veo-3.1-fast-generate-001
                    status: in_progress
                    progress: 0
                    created_at: 1779400000
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-veo30-text-720p
        label: Veo 3.0 text 720p
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"veo-3.0-generate-001\",\n  \"\
          prompt\": \"A cinematic drone shot over a coastal city at sunrise\",\n  \"duration\": 4,\n  \"resolution\": \"720p\"\
          ,\n  \"aspectRatio\": \"16:9\"\n}'"
      - lang: curl-veo31-fast-text-1080p
        label: Veo 3.1 Fast text 1080p
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"veo-3.1-fast-generate-001\",\n\
          \  \"prompt\": \"A vertical fashion runway clip with smooth camera motion\",\n  \"durationSeconds\": 8,\n  \"resolution\"\
          : \"1080p\",\n  \"aspectRatio\": \"9:16\"\n}'"
  /v1/videos/subtitle-erase:
    post:
      tags:
      - Doubao Subtitle Erase
      summary: Create Doubao subtitle erase task
      description: "Standalone submit endpoint: `POST /v1/videos/subtitle-erase`.\nUsed to submit a Doubao video subtitle\
        \ erase task. Request parameters:\n- `model`: model name (required)\n  - `doubao-video-subtitle-erase-cn`: domestic\
        \ model\n  - `doubao-video-subtitle-erase`: overseas model\n- `video_url`: video URL to be processed (required, `http/https`)\n\
        This capability does not reuse the `POST /v1/videos` generic video generation endpoint. Choose the domestic or overseas\
        \ model according to the caller's group and available channel.\nQuery methods:\n- Dedicated fetch endpoint: `GET /v1/videos/subtitle-erase/{task_id}`\n\
        - The same `task_id` can also be queried by the generic video endpoint: `GET /v1/videos/{task_id}`"
      operationId: createImaProSubtitleEraseTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImaProSubtitleEraseRequest'
            examples:
              domestic_model:
                summary: Domestic model
                value:
                  model: doubao-video-subtitle-erase-cn
                  video_url: https://example.com/input.mp4
      responses:
        '200':
          description: Accepted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaProCreateResponse'
              examples:
                Accepted:
                  value:
                    id: task_202604220001
                    task_id: task_202604220001
                    object: video
                    model: doubao-video-subtitle-erase
                    status: in_progress
                    progress: 0
                    created_at: 1776816000
        '400':
          description: Parameter error or model unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
              examples:
                Parameter error:
                  value:
                    code: invalid_request
                    message: video_url must be http or https
                    data: null
                Price is not configured:
                  value:
                    code: model_price_not_configured
                    message: model price not configured for doubao-video-subtitle-erase-cn
                    data: null
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
      - lang: curl-domestic-model
        label: Domestic model
        source: "curl https://api.imarouter.com/v1/videos/subtitle-erase \\\n  --request POST \\\n  --header 'Authorization:\
          \ Bearer YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"doubao-video-subtitle-erase-cn\"\
          ,\n  \"video_url\": \"https://example.com/input.mp4\"\n}'"
  /v1/videos/subtitle-erase/{task_id}:
    get:
      tags:
      - Doubao Subtitle Erase
      summary: Query Doubao subtitle erase task
      description: 'Dedicated fetch endpoint: `GET /v1/videos/subtitle-erase/{task_id}`.

        The response shape is aligned with the generic video task fetch response (OpenAI-style video object).

        This dedicated fetch endpoint is already online; the same `task_id` can also be queried with `GET /v1/videos/{task_id}`.

        **IMPORTANT NOTICE (MUST READ)**

        - If result resource URLs such as `results.url` or `metadata.url` are returned, download and persist them immediately.

        - The platform does not guarantee long-term availability of result URLs; they typically expire after about 30 days.'
      operationId: getImaProSubtitleEraseTask
      parameters:
      - name: task_id
        in: path
        required: true
        schema:
          type: string
        description: '`task_id` returned when creating a subtitle erase task'
      responses:
        '200':
          description: Query successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaProQueryResponse'
              examples:
                处理中: Processing
                已完成: Completed
        '400':
          description: task_id is invalid or the request parameter is wrong
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '404':
          description: Task does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '500':
          description: Query task failed (upstream or service internal exception)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
      - lang: curl-get-v1-videos-subtitle-erase-task-id
        label: Query Doubao subtitle erase task
        source: "curl https://api.imarouter.com/v1/videos/subtitle-erase/task_202604270001 \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN'"
  /v1/videos/{task_id}:
    get:
      tags:
      - Seedance Video
      summary: Query Seedance video task
      description: 'Poll task results using the public `task_id` returned by the creation interface (OpenAI video object style).

        Universal query endpoint for all video tasks (Seedance, MiniMax Hailuo, etc.).

        Authentication: The request header must contain `Authorization: Bearer sk-...`.

        When the upstream returns, the response will reveal:

        - `results` (array of video results)

        - `usage` (token usage)

        - `error` (error object on failure)

        **Serious Notice (Must Read)**

        - If the result resource URL such as `results.url`, `metadata.url` is returned after the query is successful, please
        download it immediately and persist it yourself.

        - The platform does not guarantee that the result resource URL will be accessible for a long time, and it will expire
        after about 30 days by default; do not treat the URL in the query result as a permanent storage address.'
      operationId: getImaProVideoTask
      parameters:
      - name: task_id
        in: path
        required: true
        schema:
          type: string
        description: '`task_id` returned when creating a task'
      responses:
        '200':
          description: Query successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaProQueryResponse'
              examples:
                Processing:
                  value:
                    id: task_202603131631387ETKUBM91MTD72X9
                    task_id: task_202603131631387ETKUBM91MTD72X9
                    object: video
                    model: seedance-2.0-fast
                    status: in_progress
                    progress: 42
                    created_at: 1773395498
                Completed:
                  value:
                    id: task_202603131631387ETKUBM91MTD72X9
                    task_id: task_202603131631387ETKUBM91MTD72X9
                    object: video
                    model: seedance-2.0-fast
                    status: completed
                    progress: 100
                    amount_usd: 2.2743
                    created_at: 1773395498
                    completed_at: 1773395600
                    results:
                    - url: https://file.fashionlabs.cn/aiagent/src/d/20260313/in/742dd3d75edb57c57d70f62e2f94059e.mp4
                      size: 4444046
                      content_type: video
                    usage:
                      completion_tokens: 324900
                      total_tokens: 324900
                Character Image Scene Image_Completed:
                  summary: Query corresponding to the task "two images (character + scene), not first/last-frame mode" was
                    successful
                  description: 'This task is created by combining `images[2]`. Images are processed on the server side according
                    to `reference_image` semantics.

                    `first_frame + last_frame` is not automatically inferred.'
                  value:
                    id: task_kfOFFyhQAA1kGTnfdvhcMvhq7K1zIfZ4
                    task_id: task_kfOFFyhQAA1kGTnfdvhcMvhq7K1zIfZ4
                    object: video
                    model: seedance-2.0
                    status: completed
                    progress: 100
                    amount_usd: 2.2743
                    created_at: 1773561120
                    completed_at: 1773562786
                    metadata:
                      url: https://file2.fashionlabs.cn/aiagent/src/d/20260316/in/e0a3e95679cf76ae58827854a7a0e74a.mp4
                    results:
                    - url: https://file2.fashionlabs.cn/aiagent/src/d/20260316/in/e0a3e95679cf76ae58827854a7a0e74a.mp4
                      width: 1280
                      height: 720
                      duration: 10
                      size: 4053581
                      content_type: video
                    usage:
                      completion_tokens: 324900
                      total_tokens: 324900
                Single image_reference_image_completed:
                  summary: The query corresponding to the "single image reference_image" task was successful.
                  description: 'This task is created from a single graph. Images are processed on the server side according
                    to `reference_image` semantics.

                    `first_frame` is not automatically inferred.'
                  value:
                    id: task_single_ref_image_demo_20260317
                    task_id: task_single_ref_image_demo_20260317
                    object: video
                    model: seedance-2.0-fast
                    status: completed
                    progress: 100
                    amount_usd: 1.13715
                    created_at: 1773666000
                    completed_at: 1773666120
                    results:
                    - url: https://file.fashionlabs.cn/aiagent/src/d/20260317/in/single_ref_image_demo.mp4
                      width: 720
                      height: 1280
                      duration: 5
                      size: 1987654
                      content_type: video
                    usage:
                      completion_tokens: 162450
                      total_tokens: 162450
                Single image_frame_completed:
                  summary: Query corresponding to the "single image frame mode" task successfully
                  description: 'Set `metadata.role_mode=frame` when submitting the task,

                    Single images are processed according to `first_frame` semantics.'
                  value:
                    id: task_single_frame_demo_20260317
                    task_id: task_single_frame_demo_20260317
                    object: video
                    model: seedance-2.0-fast
                    status: completed
                    progress: 100
                    amount_usd: 1.13715
                    created_at: 1773667000
                    completed_at: 1773667130
                    results:
                    - url: https://file.fashionlabs.cn/aiagent/src/d/20260317/in/single_frame_demo.mp4
                      width: 720
                      height: 1280
                      duration: 5
                      size: 2065432
                      content_type: video
                    usage:
                      completion_tokens: 162450
                      total_tokens: 162450
                fail:
                  value:
                    id: task_Qx7xsV8zGQHf5xz7xePS0m4B4fLrmtlp
                    task_id: task_Qx7xsV8zGQHf5xz7xePS0m4B4fLrmtlp
                    object: video
                    model: seedance-2.0
                    status: failed
                    progress: 100
                    created_at: 1773494530
                    completed_at: 1773508363
                    metadata:
                      url: 'video generation failed: internal error: 601300'
                    error:
                      code: task_failed
                      message: 'video generation failed: internal error: 601300'
                Failed_The reference video has insufficient pixels of 601300:
                  summary: The reference video has insufficient pixels (wrong parameters)
                  description: 'Common trigger conditions:

                    - There are substandard videos in `metadata.reference_video_urls`

                    - Doubao seedance-2-0 r2v requires reference video pixels (width × height) `>=409600`

                    - For example, less than `640x640` will trigger error code `601300`'
                  value:
                    id: task_6HwrcAuc83ypDhrNQA5k2s9kM4uFVRz
                    task_id: task_6HwrcAuc83ypDhrNQA5k2s9kM4uFVRz
                    object: video
                    model: seedance-2.0
                    status: failed
                    progress: 100
                    created_at: 1774300000
                    completed_at: 1774300120
                    metadata:
                      url: 'video generation failed: reference video pixel count too low (code: 601300)'
                    error:
                      code: task_failed
                      message: '601300: reference video pixel count must be >= 409600 (at least 640x640)'
        '400':
          description: task_id is invalid or the request parameter is wrong
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
              examples:
                task_id is empty:
                  value:
                    code: invalid_request
                    message: task_id is required
                    data: null
        '404':
          description: Task does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
              examples:
                task does not exist:
                  value:
                    code: task_not_exist
                    message: task_not_exist
                    data: null
        '500':
          description: Query task failed (upstream or service internal exception)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
              examples:
                Query failed:
                  value:
                    code: get_task_failed
                    message: failed to fetch task from upstream
                    data: null
      x-codeSamples:
      - lang: curl-get-v1-videos-task-id
        label: Query Seedance video task
        source: "curl https://api.imarouter.com/v1/videos/task_202604270001 \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'"
  /api/v1/contents/generations/tasks:
    post:
      tags:
      - Seedance Video
      summary: Create Seedance contents video task
      description: 'Submit a Seedance 2.0 video task with the contents task request body.


        **Request path:** `POST /api/v1/contents/generations/tasks`


        **Supported models:**

        - `seedance-2.0`

        - `seedance-2.0-fast`

        - `seedance-2.0-cn`

        - `seedance-2.0-fast-cn`


        **Public inputs:** Image, video, and audio fields must use public `https://...` URLs. A successful submission returns
        a task ID; poll results with `GET /api/v1/contents/generations/tasks/{task_id}`.


        **Case grouping:** Examples are grouped by official request shape: text-to-video, first frame, first/last frame, and
        multimodal reference, with both audio-video and silent-video variants. Example keys start with `seedance_` so Playground
        and SDK consumers can pick by scenario.'
      operationId: createSeedanceContentsGenerationTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SeedanceContentsGenerationTaskRequest'
            examples:
              seedance_text_audio:
                summary: Text audio video
                value:
                  model: seedance-2.0
                  content:
                  - type: text
                    text: A cinematic city skyline at sunrise, warm light, smooth camera motion.
                  resolution: 720p
                  ratio: '16:9'
                  duration: 5
                  generate_audio: true
              seedance_text_silent:
                summary: Text silent video
                value:
                  model: seedance-2.0
                  content:
                  - type: text
                    text: A quiet cinematic city skyline at sunrise with smooth camera motion.
                  resolution: 720p
                  ratio: '16:9'
                  duration: 5
                  generate_audio: false
              seedance_fast_text_silent:
                summary: Fast text silent
                value:
                  model: seedance-2.0-fast
                  content:
                  - type: text
                    text: A quiet cinematic city skyline at sunrise with smooth camera motion.
                  resolution: 720p
                  ratio: '16:9'
                  duration: 5
                  generate_audio: false
              seedance_first_frame_audio:
                summary: First-frame audio video
                value:
                  model: seedance-2.0
                  content:
                  - type: text
                    text: The subject turns toward warm light while ambient sound follows the motion.
                  - type: image_url
                    image_url:
                      url: https://ima-ga.esxscloud.com/aiagent/src/d/20260209/in/1770621940910426538_0.png
                    role: first_frame
                  resolution: 720p
                  ratio: adaptive
                  duration: 5
                  generate_audio: true
              seedance_first_frame_silent:
                summary: First-frame silent video
                value:
                  model: seedance-2.0
                  content:
                  - type: text
                    text: The camera slowly pushes in while the subject turns toward the light.
                  - type: image_url
                    image_url:
                      url: https://ima-ga.esxscloud.com/aiagent/src/d/20260209/in/1770621940910426538_0.png
                    role: first_frame
                  resolution: 720p
                  ratio: adaptive
                  duration: 5
                  generate_audio: false
                  return_last_frame: true
              seedance_first_last_audio:
                summary: First/last-frame audio video
                value:
                  model: seedance-2.0
                  content:
                  - type: text
                    text: Animate a gentle transition between the first and last frame with natural sound.
                  - type: image_url
                    image_url:
                      url: https://ima-ga.esxscloud.com/aiagent/src/d/20260209/in/1770621940910426538_0.png
                    role: first_frame
                  - type: image_url
                    image_url:
                      url: https://ima-ga.esxscloud.com/upload/1775559248448_433.png
                    role: last_frame
                  resolution: 720p
                  ratio: adaptive
                  duration: 6
                  generate_audio: true
              seedance_first_last_silent:
                summary: First/last-frame silent
                value:
                  model: seedance-2.0
                  content:
                  - type: text
                    text: Animate a gentle transition between the first frame and last frame.
                  - type: image_url
                    image_url:
                      url: https://ima-ga.esxscloud.com/aiagent/src/d/20260209/in/1770621940910426538_0.png
                    role: first_frame
                  - type: image_url
                    image_url:
                      url: https://ima-ga.esxscloud.com/upload/1775559248448_433.png
                    role: last_frame
                  resolution: 720p
                  ratio: adaptive
                  duration: 6
                  generate_audio: false
              seedance_multimodal_https_audio:
                summary: Multimodal HTTPS audio video
                value:
                  model: seedance-2.0
                  content:
                  - type: text
                    text: Create a smooth product reveal video with matching motion and sound.
                  - type: image_url
                    image_url:
                      url: https://ima-ga.esxscloud.com/aiagent/src/d/20260209/in/1770621940910426538_0.png
                    role: reference_image
                  - type: video_url
                    video_url:
                      url: https://file2.fashionlabs.cn/aiagent/src/d/20260319/in/ac45807a51f68c21556b7872827a4569.mp4
                    role: reference_video
                  - type: audio_url
                    audio_url:
                      url: https://file2.fashionlabs.cn/aiagent/src/d510cae243c24eafcfadf3a9e3b6c6ad_%5Bcut_15sec%5D.mp3
                    role: reference_audio
                  resolution: 720p
                  ratio: '16:9'
                  duration: 10
                  generate_audio: true
              seedance_multimodal_https_silent:
                summary: Multimodal HTTPS silent video
                value:
                  model: seedance-2.0
                  content:
                  - type: text
                    text: Create a smooth product reveal video using the reference image and video motion.
                  - type: image_url
                    image_url:
                      url: https://ima-ga.esxscloud.com/aiagent/src/d/20260209/in/1770621940910426538_0.png
                    role: reference_image
                  - type: video_url
                    video_url:
                      url: https://file2.fashionlabs.cn/aiagent/src/d/20260319/in/ac45807a51f68c21556b7872827a4569.mp4
                    role: reference_video
                  resolution: 720p
                  ratio: '16:9'
                  duration: 10
                  generate_audio: false
      responses:
        '200':
          description: Submission successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaProCreateResponse'
              examples:
                task_submitted:
                  summary: Return task ID
                  value:
                    id: task_v1VZnoqtCP9tD6eFIqbqqSZKnMHtg9fp
                    task_id: task_v1VZnoqtCP9tD6eFIqbqqSZKnMHtg9fp
                    object: video
                    model: seedance-2.0
                    status: in_progress
                    progress: 0
                    created_at: 1780390610
        '400':
          description: Parameter error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
              examples:
                unsupported_model:
                  summary: Unsupported model
                  value:
                    code: invalid_request
                    message: unsupported contents generation task model "seedance-1.5-pro"; only seedance-2.0, seedance-2.0-fast,
                      seedance-2.0-cn and seedance-2.0-fast-cn are supported
                    data: null
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Task creation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
      x-codeSamples:
      - lang: curl-seedance-text-audio
        label: Text audio video
        source: "curl https://api.imarouter.com/api/v1/contents/generations/tasks \\\n  --request POST \\\n  --header 'Authorization:\
          \ Bearer YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\"\
          ,\n  \"content\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"A cinematic city skyline at sunrise, warm\
          \ light, smooth camera motion.\"\n    }\n  ],\n  \"resolution\": \"720p\",\n  \"ratio\": \"16:9\",\n  \"duration\"\
          : 5,\n  \"generate_audio\": true\n}'"
      - lang: curl-seedance-text-silent
        label: Text silent video
        source: "curl https://api.imarouter.com/api/v1/contents/generations/tasks \\\n  --request POST \\\n  --header 'Authorization:\
          \ Bearer YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\"\
          ,\n  \"content\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"A quiet cinematic city skyline at sunrise\
          \ with smooth camera motion.\"\n    }\n  ],\n  \"resolution\": \"720p\",\n  \"ratio\": \"16:9\",\n  \"duration\"\
          : 5,\n  \"generate_audio\": false\n}'"
      - lang: curl-seedance-fast-text-silent
        label: Fast text silent
        source: "curl https://api.imarouter.com/api/v1/contents/generations/tasks \\\n  --request POST \\\n  --header 'Authorization:\
          \ Bearer YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0-fast\"\
          ,\n  \"content\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"A quiet cinematic city skyline at sunrise\
          \ with smooth camera motion.\"\n    }\n  ],\n  \"resolution\": \"720p\",\n  \"ratio\": \"16:9\",\n  \"duration\"\
          : 5,\n  \"generate_audio\": false\n}'"
      - lang: curl-seedance-first-frame-audio
        label: First-frame audio video
        source: "curl https://api.imarouter.com/api/v1/contents/generations/tasks \\\n  --request POST \\\n  --header 'Authorization:\
          \ Bearer YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\"\
          ,\n  \"content\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"The subject turns toward warm light while\
          \ ambient sound follows the motion.\"\n    },\n    {\n      \"type\": \"image_url\",\n      \"image_url\": {\n \
          \       \"url\": \"https://ima-ga.esxscloud.com/aiagent/src/d/20260209/in/1770621940910426538_0.png\"\n      },\n\
          \      \"role\": \"first_frame\"\n    }\n  ],\n  \"resolution\": \"720p\",\n  \"ratio\": \"adaptive\",\n  \"duration\"\
          : 5,\n  \"generate_audio\": true\n}'"
      - lang: curl-seedance-first-frame-silent
        label: First-frame silent video
        source: "curl https://api.imarouter.com/api/v1/contents/generations/tasks \\\n  --request POST \\\n  --header 'Authorization:\
          \ Bearer YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\"\
          ,\n  \"content\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"The camera slowly pushes in while the subject\
          \ turns toward the light.\"\n    },\n    {\n      \"type\": \"image_url\",\n      \"image_url\": {\n        \"url\"\
          : \"https://ima-ga.esxscloud.com/aiagent/src/d/20260209/in/1770621940910426538_0.png\"\n      },\n      \"role\"\
          : \"first_frame\"\n    }\n  ],\n  \"resolution\": \"720p\",\n  \"ratio\": \"adaptive\",\n  \"duration\": 5,\n  \"\
          generate_audio\": false,\n  \"return_last_frame\": true\n}'"
      - lang: curl-seedance-first-last-audio
        label: First/last-frame audio video
        source: "curl https://api.imarouter.com/api/v1/contents/generations/tasks \\\n  --request POST \\\n  --header 'Authorization:\
          \ Bearer YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\"\
          ,\n  \"content\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"Animate a gentle transition between the\
          \ first and last frame with natural sound.\"\n    },\n    {\n      \"type\": \"image_url\",\n      \"image_url\"\
          : {\n        \"url\": \"https://ima-ga.esxscloud.com/aiagent/src/d/20260209/in/1770621940910426538_0.png\"\n   \
          \   },\n      \"role\": \"first_frame\"\n    },\n    {\n      \"type\": \"image_url\",\n      \"image_url\": {\n\
          \        \"url\": \"https://ima-ga.esxscloud.com/upload/1775559248448_433.png\"\n      },\n      \"role\": \"last_frame\"\
          \n    }\n  ],\n  \"resolution\": \"720p\",\n  \"ratio\": \"adaptive\",\n  \"duration\": 6,\n  \"generate_audio\"\
          : true\n}'"
      - lang: curl-seedance-first-last-silent
        label: First/last-frame silent
        source: "curl https://api.imarouter.com/api/v1/contents/generations/tasks \\\n  --request POST \\\n  --header 'Authorization:\
          \ Bearer YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\"\
          ,\n  \"content\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"Animate a gentle transition between the\
          \ first frame and last frame.\"\n    },\n    {\n      \"type\": \"image_url\",\n      \"image_url\": {\n       \
          \ \"url\": \"https://ima-ga.esxscloud.com/aiagent/src/d/20260209/in/1770621940910426538_0.png\"\n      },\n    \
          \  \"role\": \"first_frame\"\n    },\n    {\n      \"type\": \"image_url\",\n      \"image_url\": {\n        \"\
          url\": \"https://ima-ga.esxscloud.com/upload/1775559248448_433.png\"\n      },\n      \"role\": \"last_frame\"\n\
          \    }\n  ],\n  \"resolution\": \"720p\",\n  \"ratio\": \"adaptive\",\n  \"duration\": 6,\n  \"generate_audio\"\
          : false\n}'"
      - lang: curl-seedance-multimodal-https-audio
        label: Multimodal HTTPS audio video
        source: "curl https://api.imarouter.com/api/v1/contents/generations/tasks \\\n  --request POST \\\n  --header 'Authorization:\
          \ Bearer YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\"\
          ,\n  \"content\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"Create a smooth product reveal video with\
          \ matching motion and sound.\"\n    },\n    {\n      \"type\": \"image_url\",\n      \"image_url\": {\n        \"\
          url\": \"https://ima-ga.esxscloud.com/aiagent/src/d/20260209/in/1770621940910426538_0.png\"\n      },\n      \"\
          role\": \"reference_image\"\n    },\n    {\n      \"type\": \"video_url\",\n      \"video_url\": {\n        \"url\"\
          : \"https://file2.fashionlabs.cn/aiagent/src/d/20260319/in/ac45807a51f68c21556b7872827a4569.mp4\"\n      },\n  \
          \    \"role\": \"reference_video\"\n    },\n    {\n      \"type\": \"audio_url\",\n      \"audio_url\": {\n    \
          \    \"url\": \"https://file2.fashionlabs.cn/aiagent/src/d510cae243c24eafcfadf3a9e3b6c6ad_%5Bcut_15sec%5D.mp3\"\n\
          \      },\n      \"role\": \"reference_audio\"\n    }\n  ],\n  \"resolution\": \"720p\",\n  \"ratio\": \"16:9\"\
          ,\n  \"duration\": 10,\n  \"generate_audio\": true\n}'"
      - lang: curl-seedance-multimodal-https-silent
        label: Multimodal HTTPS silent video
        source: "curl https://api.imarouter.com/api/v1/contents/generations/tasks \\\n  --request POST \\\n  --header 'Authorization:\
          \ Bearer YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-2.0\"\
          ,\n  \"content\": [\n    {\n      \"type\": \"text\",\n      \"text\": \"Create a smooth product reveal video using\
          \ the reference image and video motion.\"\n    },\n    {\n      \"type\": \"image_url\",\n      \"image_url\": {\n\
          \        \"url\": \"https://ima-ga.esxscloud.com/aiagent/src/d/20260209/in/1770621940910426538_0.png\"\n      },\n\
          \      \"role\": \"reference_image\"\n    },\n    {\n      \"type\": \"video_url\",\n      \"video_url\": {\n  \
          \      \"url\": \"https://file2.fashionlabs.cn/aiagent/src/d/20260319/in/ac45807a51f68c21556b7872827a4569.mp4\"\n\
          \      },\n      \"role\": \"reference_video\"\n    }\n  ],\n  \"resolution\": \"720p\",\n  \"ratio\": \"16:9\"\
          ,\n  \"duration\": 10,\n  \"generate_audio\": false\n}'"
  /api/v1/contents/generations/tasks/{task_id}:
    get:
      tags:
      - Seedance Video
      summary: Query Seedance contents video task
      description: 'Query the Seedance contents video task submitted through `POST /api/v1/contents/generations/tasks`.


        The successful response includes fields such as `id`, `task_id`, `status`, `progress`, `results`, `usage`, and `amount_usd`.
        For this endpoint, `status` uses Seedance task states: `queued`, `running`, `succeeded`, and `failed`. Clients should
        poll new contents tasks through this endpoint.'
      operationId: getSeedanceContentsGenerationTask
      parameters:
      - name: task_id
        in: path
        required: true
        schema:
          type: string
        description: Task ID returned by the create endpoint.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaProQueryResponse'
              examples:
                in_progress:
                  summary: In progress
                  value:
                    id: task_v1VZnoqtCP9tD6eFIqbqqSZKnMHtg9fp
                    task_id: task_v1VZnoqtCP9tD6eFIqbqqSZKnMHtg9fp
                    object: video
                    model: seedance-2.0
                    status: running
                    progress: 42
                    created_at: 1780390610
                completed:
                  summary: Completed
                  value:
                    id: task_v1VZnoqtCP9tD6eFIqbqqSZKnMHtg9fp
                    task_id: task_v1VZnoqtCP9tD6eFIqbqqSZKnMHtg9fp
                    object: video
                    model: seedance-2.0
                    status: succeeded
                    progress: 100
                    amount_usd: 1.007748
                    created_at: 1780390610
                    completed_at: 1780390720
                    metadata:
                      url: https://file.fashionlabs.cn/aiagent/src/d/20260602/in/seedance_contents_demo.mp4
                    results:
                    - url: https://file.fashionlabs.cn/aiagent/src/d/20260602/in/seedance_contents_demo.mp4
                      width: 1280
                      height: 720
                      duration: 10
                      content_type: video
                    usage:
                      total_tokens: 195300
        '400':
          description: Parameter error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
              examples:
                task_id_empty:
                  summary: task_id is empty
                  value:
                    code: invalid_request
                    message: task_id is required
                    data: null
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Task not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
              examples:
                task_not_found:
                  summary: Task not found
                  value:
                    code: task_not_exist
                    message: task_not_exist
                    data: null
        '500':
          description: Query failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
      x-codeSamples:
      - lang: curl-get-api-v1-contents-generations-tasks-task-id
        label: Query Seedance contents video task
        source: "curl https://api.imarouter.com/api/v1/contents/generations/tasks/task_202604270001 \\\n  --header 'Authorization:\
          \ Bearer YOUR_SECRET_TOKEN'"
  /v1/videos/{task_id}#pixverse:
    get:
      tags:
      - Pixverse Video
      summary: Query Pixverse video task
      operationId: getPixverseOpenAIVideoTaskStatus
      description: 'Query a Pixverse video task submitted through `POST /v1/videos`.


        **Actual request path:** `GET /v1/videos/{task_id}`


        If `amount_usd` appears in a successful response, it is the USD amount for the completed task. Video result URLs are
        short-term platform-hosted links; download and persist them promptly.'
      parameters:
      - name: task_id
        in: path
        required: true
        schema:
          type: string
        description: Task ID returned by the create endpoint.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaProQueryResponse'
              examples:
                pixverse_completed:
                  summary: Pixverse success
                  value:
                    id: task_pixverse_202605220001
                    task_id: task_pixverse_202605220001
                    object: video
                    model: pixverse-v6
                    status: completed
                    progress: 100
                    created_at: 1779400000
                    completed_at: 1779400060
                    results:
                    - url: https://cdn.example.com/video/pixverse-v6.mp4
                      width: 1920
                      height: 1080
                      duration: 5
                      content_type: video
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '404':
          description: Task not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-get-v1-videos-task-id
        label: Query Pixverse video task
        source: "curl https://api.imarouter.com/v1/videos/task_202604270001 \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'"
  /v1/videos/{task_id}#veo:
    get:
      tags:
      - Veo Video
      summary: Query Veo video task
      operationId: getVeoOpenAIVideoTaskStatus
      description: 'Query a Veo video task submitted through `POST /v1/videos`.


        **Actual request path:** `GET /v1/videos/{task_id}`


        If `amount_usd` appears in a successful response, it is the USD amount for the completed task. Video result URLs are
        short-term platform-hosted links; download and persist them promptly.'
      parameters:
      - name: task_id
        in: path
        required: true
        schema:
          type: string
        description: Task ID returned by the create endpoint.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImaProQueryResponse'
              examples:
                veo_completed:
                  summary: Veo success
                  value:
                    id: task_veo_202605220001
                    task_id: task_veo_202605220001
                    object: video
                    model: veo-3.1-fast-generate-001
                    status: completed
                    progress: 100
                    amount_usd: 0.72
                    created_at: 1779400000
                    completed_at: 1779400090
                    results:
                    - url: https://cdn.example.com/video/veo-3.1-fast.mp4
                      width: 1080
                      height: 1920
                      duration: 8
                      content_type: video
                    usage:
                      durationSeconds: 8
                      resolution: 1080p
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '404':
          description: Task not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-get-v1-videos-task-id
        label: Query Veo video task
        source: "curl https://api.imarouter.com/v1/videos/task_202604270001 \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'"
  /v1/assets/group/create:
    post:
      summary: Create asset group
      description: 'Create material groups (no charge).

        Authentication: The request header must contain `Authorization: Bearer sk-...`.


        Field description:

        - `name`: Group name (required, <=64 characters)

        - `description`: Group description (optional, <=300 characters)

        - `group_type`: Grouping type (optional; default `AIGC`)

        - `project_name`: project name (optional; default `default`)

        - `model`: optional, asset model name (it is recommended to pass it explicitly to avoid mismatch between the default
        model and group permissions)'
      operationId: createAssetGroup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssetGroupCreateRequest'
            examples:
              minimal:
                summary: Minimum available request
                value:
                  name: marketing-assets
              full:
                summary: Request with optional fields
                value:
                  name: marketing-assets
                  description: Material grouping-marketing
                  group_type: AIGC
                  project_name: default
                  model: ima-pro-upload-cn
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetGroupResponse'
      tags:
      - Portrait
      x-codeSamples:
      - lang: curl-minimal
        label: Minimum available request
        source: "curl https://api.imarouter.com/v1/assets/group/create \\\n  --request POST \\\n  --header 'Authorization:\
          \ Bearer YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"name\": \"marketing-assets\"\
          \n}'"
      - lang: curl-full
        label: Request with optional fields
        source: "curl https://api.imarouter.com/v1/assets/group/create \\\n  --request POST \\\n  --header 'Authorization:\
          \ Bearer YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"name\": \"marketing-assets\"\
          ,\n  \"description\": \"Material grouping-marketing\",\n  \"group_type\": \"AIGC\",\n  \"project_name\": \"default\"\
          ,\n  \"model\": \"ima-pro-upload-cn\"\n}'"
  /v1/assets/group/list:
    post:
      summary: List asset groups
      description: 'Query the group list (no deduction).

        Strict verification of sorting parameters:

        - `sort_by`: `CreateTime|UpdateTime`

        - `sort_order`: `Asc|Desc`

        - `model`: optional, it is recommended to pass it explicitly to filter by model permissions.'
      operationId: listAssetGroups
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssetGroupListRequest'
            examples:
              default_page:
                summary: Default paging query
                value:
                  page_number: 1
                  page_size: 20
                  model: ima-pro-upload-cn
              with_filter:
                summary: Filter by name and sort by reverse time
                value:
                  filters:
                    name: marketing
                    group_type: AIGC
                  sort_by: CreateTime
                  sort_order: Desc
                  page_number: 1
                  page_size: 20
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetGroupListResponse'
      tags:
      - Portrait
      x-codeSamples:
      - lang: curl-default-page
        label: Default paging query
        source: "curl https://api.imarouter.com/v1/assets/group/list \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"page_number\": 1,\n  \"\
          page_size\": 20,\n  \"model\": \"ima-pro-upload-cn\"\n}'"
      - lang: curl-with-filter
        label: Filter by name and sort by reverse time
        source: "curl https://api.imarouter.com/v1/assets/group/list \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"filters\": {\n    \"name\"\
          : \"marketing\",\n    \"group_type\": \"AIGC\"\n  },\n  \"sort_by\": \"CreateTime\",\n  \"sort_order\": \"Desc\"\
          ,\n  \"page_number\": 1,\n  \"page_size\": 20\n}'"
  /v1/assets/group/get:
    post:
      summary: Get asset group
      operationId: getAssetGroup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - id
              properties:
                id:
                  type: string
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetGroupResponse'
      tags:
      - Portrait
      x-codeSamples:
      - lang: curl-post-v1-assets-group-get
        label: Get asset group
        source: "curl https://api.imarouter.com/v1/assets/group/get \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN'"
  /v1/assets/group/update:
    post:
      summary: Update asset group
      operationId: updateAssetGroup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - id
              properties:
                id:
                  type: string
                name:
                  type: string
                description:
                  type: string
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetIdResponse'
      tags:
      - Portrait
      x-codeSamples:
      - lang: curl-post-v1-assets-group-update
        label: Update asset group
        source: "curl https://api.imarouter.com/v1/assets/group/update \\\n  --request POST \\\n  --header 'Authorization:\
          \ Bearer YOUR_SECRET_TOKEN'"
  /v1/assets/create:
    post:
      summary: Upload asset (create asset)
      description: 'Upload the material URL to the material library.

        Billing instructions: Only this endpoint is charged. The billing model takes the request body `model` (if not passed,
        the default is `ima-pro-upload`, pay-per-view).

        Default deduction token: SK corresponding to the current request header `Authorization`.

        The optional field `billing_token_id` is only used to override the default billing token (must be current user and
        enabled).

        `asset_type` represents the asset type, the default value is `Image`, and supports `Image|Video|Audio` (if not passed,
        press `Image`).

        When `asset_type=Audio`, the audio duration is verified by the upstream service and must be within the closed range
        from `1.8s` to `15.2s`. If it exceeds the limit, it will report: `InvalidParameter.DurationTooLong: Duration must
        be between 1.8s and 15.2s`.

        **Serious reminder (must read)**

        - When creating portrait material/material agreement, be sure to explicitly pass `model` to distinguish between domestic
        and overseas channels.

        - Domestic video models (`seedance-2.0-cn`, `seedance-2.0-fast-cn`) should use `ima-pro-upload-cn` (or historically
        compatible `ima-pro-upload`) to create materials.

        - Overseas video models (`seedance-2.0`, `seedance-2.0-fast`) should use `seedance-upload` to create materials.

        - Do not mix domestic/overseas material protocols; otherwise, although `asset://...` is created successfully, subsequent
        video tasks may fail to be called due to protocol channel mismatch.

        **IMPORTANT NOTICE (MUST READ)**

        - `url` is the source address for material upload. Please confirm that it is accessible before calling. It is recommended
        to persist the original material by yourself.

        - The 30-day expiration rule only applies to the result resource URL returned by the interface; please save the uploaded
        source materials for a long time.'
      operationId: createAsset
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssetCreateRequest'
            examples:
              video_create_success:
                summary: Video material upload example (successful)
                value:
                  group_id: group-20260403210537-6v56x
                  url: https://ws.esxscloud.com/aiagent/src/d/20260407/in/1a2011e98a41847d70a49b570995d379.mp4
                  name: verify-overseas-video-check
                  asset_type: Video
                  model: ima-pro-upload-cn
              image_create_success:
                summary: Image material upload example (successful)
                value:
                  group_id: group-20260403210537-6v56x
                  url: https://dxii5p4krscl5.cloudfront.net/resource/image/dd40f8e8-9296-4daf-9277-4a842d79fbee.jpg
                  name: verify-overseas-image-check
                  asset_type: Image
                  model: ima-pro-upload-cn
              audio_create_success:
                summary: Audio material upload example (successful)
                value:
                  group_id: group-20260403210537-6v56x
                  url: https://ima-ga.esxscloud.com/drama_pro/privite/2026/04/02/1775124683350_1930188605918449664_35ae6ccc808744e5bcb2fc2354bf9c1c.mp3
                  name: verify-overseas-audio-check
                  asset_type: Audio
                  model: ima-pro-upload-cn
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetIdResponse'
              examples:
                create_success:
                  value:
                    success: true
                    message: ''
                    data:
                      Id: asset-20260409110407-jpbr5
        '400':
          description: 'Parameter error. Common error examples: - `InvalidParameter.DurationTooLong: Duration must be between
            1.8s and 15.2s` - `doubao asset request failed: InvalidParameter.DownloadFailed`'
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                properties:
                  message:
                    type: string
                  success:
                    type: boolean
              examples:
                invalid_audio_duration:
                  value:
                    success: false
                    message: 'doubao asset request failed: InvalidParameter.DurationTooLong: Duration must be between 1.8s
                      and 15.2s'
      tags:
      - Portrait
      x-codeSamples:
      - lang: curl-video-create-success
        label: Video material upload example (successful)
        source: "curl https://api.imarouter.com/v1/assets/create \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"group_id\": \"group-20260403210537-6v56x\"\
          ,\n  \"url\": \"https://ws.esxscloud.com/aiagent/src/d/20260407/in/1a2011e98a41847d70a49b570995d379.mp4\",\n  \"\
          name\": \"verify-overseas-video-check\",\n  \"asset_type\": \"Video\",\n  \"model\": \"ima-pro-upload-cn\"\n}'"
      - lang: curl-image-create-success
        label: Image material upload example (successful)
        source: "curl https://api.imarouter.com/v1/assets/create \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"group_id\": \"group-20260403210537-6v56x\"\
          ,\n  \"url\": \"https://dxii5p4krscl5.cloudfront.net/resource/image/dd40f8e8-9296-4daf-9277-4a842d79fbee.jpg\",\n\
          \  \"name\": \"verify-overseas-image-check\",\n  \"asset_type\": \"Image\",\n  \"model\": \"ima-pro-upload-cn\"\n\
          }'"
      - lang: curl-audio-create-success
        label: Audio material upload example (successful)
        source: "curl https://api.imarouter.com/v1/assets/create \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"group_id\": \"group-20260403210537-6v56x\"\
          ,\n  \"url\": \"https://ima-ga.esxscloud.com/drama_pro/privite/2026/04/02/1775124683350_1930188605918449664_35ae6ccc808744e5bcb2fc2354bf9c1c.mp3\"\
          ,\n  \"name\": \"verify-overseas-audio-check\",\n  \"asset_type\": \"Audio\",\n  \"model\": \"ima-pro-upload-cn\"\
          \n}'"
  /v1/assets/list:
    post:
      summary: List assets
      description: 'Check the material list (no deduction).

        Strict verification of sorting parameters:

        - `sort_by`: `CreateTime|UpdateTime|GroupId`

        - `sort_order`: `Asc|Desc`

        - `model`: optional, it is recommended to pass it explicitly to filter by model permissions.'
      operationId: listAssets
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssetListRequest'
            examples:
              ima_pro_upload_list:
                summary: ima-pro-upload asset list (default sort)
                value:
                  model: ima-pro-upload
                  page_number: 1
                  page_size: 20
                  sort_by: CreateTime
                  sort_order: Desc
              ima_pro_upload_cn_list:
                summary: ima-pro-upload-cn filtered by status
                value:
                  model: ima-pro-upload-cn
                  filters:
                    group_type: AIGC
                    statuses:
                    - Active
                  page_number: 1
                  page_size: 50
              seedance_upload_list:
                summary: seedance-upload asset list
                value:
                  model: seedance-upload
                  page_number: 1
                  page_size: 20
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetListResponse'
      tags:
      - Portrait
      x-codeSamples:
      - lang: curl-ima-pro-upload-list
        label: ima-pro-upload asset list (default sort)
        source: "curl https://api.imarouter.com/v1/assets/list \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"ima-pro-upload\",\n  \"page_number\"\
          : 1,\n  \"page_size\": 20,\n  \"sort_by\": \"CreateTime\",\n  \"sort_order\": \"Desc\"\n}'"
      - lang: curl-ima-pro-upload-cn-list
        label: ima-pro-upload-cn filtered by status
        source: "curl https://api.imarouter.com/v1/assets/list \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"ima-pro-upload-cn\",\n  \"filters\"\
          : {\n    \"group_type\": \"AIGC\",\n    \"statuses\": [\n      \"Active\"\n    ]\n  },\n  \"page_number\": 1,\n\
          \  \"page_size\": 50\n}'"
      - lang: curl-seedance-upload-list
        label: seedance-upload asset list
        source: "curl https://api.imarouter.com/v1/assets/list \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seedance-upload\",\n  \"page_number\"\
          : 1,\n  \"page_size\": 20\n}'"
  /v1/assets/get:
    post:
      summary: Get asset
      operationId: getAsset
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - id
              properties:
                id:
                  type: string
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetGetResponse'
      tags:
      - Portrait
      x-codeSamples:
      - lang: curl-post-v1-assets-get
        label: Get asset
        source: "curl https://api.imarouter.com/v1/assets/get \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'"
  /v1/assets/update:
    post:
      summary: Update asset name
      operationId: updateAsset
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - id
              - name
              properties:
                id:
                  type: string
                name:
                  type: string
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetIdResponse'
      tags:
      - Portrait
      x-codeSamples:
      - lang: curl-post-v1-assets-update
        label: Update asset name
        source: "curl https://api.imarouter.com/v1/assets/update \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN'"
  /v1/assets/quota:
    post:
      summary: Query asset quota
      operationId: getAssetQuota
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetQuotaResponse'
      tags:
      - Portrait
      x-codeSamples:
      - lang: curl-post-v1-assets-quota
        label: Query asset quota
        source: "curl https://api.imarouter.com/v1/assets/quota \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN'"
  /mj/submit/imagine:
    post:
      tags:
      - Midjourney
      summary: Submit Midjourney imagine / blend
      description: 'Midjourney async task entry (imagine + blend).


        **Models:**

        - `mj_imagine`: text-to-image, requires `prompt`.

        - `mj_blend`: multi-image blend, requires `base64Array` (2~5 images) + `dimensions`.


        **Prompt flags used in the examples:**

        - `--ar`: aspect ratio.

        - `--niji`: Niji profile, for example `--niji 7`.

        - `--stylize`: stylization strength.

        - `--sref`: style reference URL or style code.

        - `--sw`: style-reference weight; use with `--sref`.

        - `--p`: personalization/profile code. Keep the main prompt short when using it with a detailed character prompt.

        - `--iw`: image weight; the prompt must start with an image URL.

        - `--c`: chaos value.

        - `--w`: weird value.


        **Stability notes:** long character prompts with `--p` and `--sref` can fail on the current channel with a prompt-format
        error. For detailed character prompts, prefer the `--sref` example without `--p`; if `--p` is required, use a shorter
        main prompt.


        **Polling:** `GET /mj/task/{task_id}/fetch`.

        '
      operationId: mjSubmitImagine
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MidjourneyImagineRequest'
            examples:
              mj_imagine_basic:
                summary: Basic imagine request
                value:
                  model: mj_imagine
                  prompt: A cinematic portrait of a fox in autumn forest --ar 16:9 --v 6
                  botType: MID_JOURNEY
                  state: openapi-mj-basic
              mj_niji_sref_long_character:
                summary: Niji long character prompt with style reference
                value:
                  model: mj_imagine
                  prompt: 'solo character, Pink long straight hair with blunt bangs, cat ears, red eyes, a small white flower
                    in hair, cute cheerful expression, bright sparkling eyes, soft smile, playful wink, hands near face, heart-shaped
                    hand gesture, fluffy pastel outfit, oversized ribbon, frilly short skirt, white thigh-high socks, soft
                    pink and cream color palette. Negative: grin, open_mouth, lips --sref 32944651::1 --niji 7 --stylize 100
                    --ar 1:1'
                  botType: NIJI_JOURNEY
                  state: openapi-mj-niji-sref-long
              mj_niji_personalization_short:
                summary: Niji short prompt with personalization and style reference
                value:
                  model: mj_imagine
                  prompt: 'solo character, pink long straight hair, cat ears, red eyes, white flower hair ornament, cute soft
                    smile, pastel fluffy outfit, kawaii style, warm soft colors. Negative: grin, open_mouth, lips --p dnnc2d9
                    --sref 32944651::1 --niji 7 --stylize 100 --ar 1:1'
                  botType: NIJI_JOURNEY
                  state: openapi-mj-p-short
              mj_niji_image_weight:
                summary: Niji image prompt with personalization and image weight
                value:
                  model: mj_imagine
                  prompt: https://ws.esxscloud.com/ima/1947258201498259457/gateway_resource_1777257207877278629_3/c07d2f2953c124e45d633753c99d2612.png
                    cute cat girl, cozy room, warm lighting --p dnnc2d9 --iw 0.8 --niji 7 --ar 1:1
                  botType: NIJI_JOURNEY
                  state: openapi-mj-image-weight
              mj_niji_style_reference_image_weight:
                summary: Niji image prompt with style reference and image weight
                value:
                  model: mj_imagine
                  prompt: https://ws.esxscloud.com/ima/1947258201498259457/gateway_resource_1777257207877278629_3/c07d2f2953c124e45d633753c99d2612.png
                    cute cat girl, cozy room, warm lighting --sref https://ws.esxscloud.com/ima/1947258201498259457/gateway_resource_1776855857398177126_0/1776856029653793645_0.png
                    --sw 430 --iw 0.8 --niji 7 --stylize 100 --ar 1:1
                  botType: NIJI_JOURNEY
                  state: openapi-mj-sref-iw
              mj_niji_chaos_weird:
                summary: Niji chaos and weird parameters
                value:
                  model: mj_imagine
                  prompt: cute cat girl, cozy room, warm lighting --niji 7 --ar 1:1 --c 10 --w 430
                  botType: NIJI_JOURNEY
                  state: openapi-mj-chaos-weird
              mj_blend_two:
                summary: mj_blend two-image blend
                value:
                  model: mj_blend
                  base64Array:
                  - data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA...
                  - data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB...
                  dimensions: SQUARE
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MidjourneySubmitResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-mj-imagine-basic
        label: Basic imagine request
        source: "curl https://api.imarouter.com/mj/submit/imagine \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"mj_imagine\"\
          ,\n  \"prompt\": \"A cinematic portrait of a fox in autumn forest --ar 16:9 --v 6\",\n  \"botType\": \"MID_JOURNEY\"\
          ,\n  \"state\": \"openapi-mj-basic\"\n}'"
      - lang: curl-mj-niji-sref-long-character
        label: Niji long character prompt with style reference
        source: "curl https://api.imarouter.com/mj/submit/imagine \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"mj_imagine\"\
          ,\n  \"prompt\": \"solo character, Pink long straight hair with blunt bangs, cat ears, red eyes, a small white flower\
          \ in hair, cute cheerful expression, bright sparkling eyes, soft smile, playful wink, hands near face, heart-shaped\
          \ hand gesture, fluffy pastel outfit, oversized ribbon, frilly short skirt, white thigh-high socks, soft pink and\
          \ cream color palette. Negative: grin, open_mouth, lips --sref 32944651::1 --niji 7 --stylize 100 --ar 1:1\",\n\
          \  \"botType\": \"NIJI_JOURNEY\",\n  \"state\": \"openapi-mj-niji-sref-long\"\n}'"
      - lang: curl-mj-niji-personalization-short
        label: Niji short prompt with personalization and style reference
        source: "curl https://api.imarouter.com/mj/submit/imagine \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"mj_imagine\"\
          ,\n  \"prompt\": \"solo character, pink long straight hair, cat ears, red eyes, white flower hair ornament, cute\
          \ soft smile, pastel fluffy outfit, kawaii style, warm soft colors. Negative: grin, open_mouth, lips --p dnnc2d9\
          \ --sref 32944651::1 --niji 7 --stylize 100 --ar 1:1\",\n  \"botType\": \"NIJI_JOURNEY\",\n  \"state\": \"openapi-mj-p-short\"\
          \n}'"
      - lang: curl-mj-niji-image-weight
        label: Niji image prompt with personalization and image weight
        source: "curl https://api.imarouter.com/mj/submit/imagine \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"mj_imagine\"\
          ,\n  \"prompt\": \"https://ws.esxscloud.com/ima/1947258201498259457/gateway_resource_1777257207877278629_3/c07d2f2953c124e45d633753c99d2612.png\
          \ cute cat girl, cozy room, warm lighting --p dnnc2d9 --iw 0.8 --niji 7 --ar 1:1\",\n  \"botType\": \"NIJI_JOURNEY\"\
          ,\n  \"state\": \"openapi-mj-image-weight\"\n}'"
      - lang: curl-mj-niji-style-reference-image-weight
        label: Niji image prompt with style reference and image weight
        source: "curl https://api.imarouter.com/mj/submit/imagine \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"mj_imagine\"\
          ,\n  \"prompt\": \"https://ws.esxscloud.com/ima/1947258201498259457/gateway_resource_1777257207877278629_3/c07d2f2953c124e45d633753c99d2612.png\
          \ cute cat girl, cozy room, warm lighting --sref https://ws.esxscloud.com/ima/1947258201498259457/gateway_resource_1776855857398177126_0/1776856029653793645_0.png\
          \ --sw 430 --iw 0.8 --niji 7 --stylize 100 --ar 1:1\",\n  \"botType\": \"NIJI_JOURNEY\",\n  \"state\": \"openapi-mj-sref-iw\"\
          \n}'"
      - lang: curl-mj-niji-chaos-weird
        label: Niji chaos and weird parameters
        source: "curl https://api.imarouter.com/mj/submit/imagine \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"mj_imagine\"\
          ,\n  \"prompt\": \"cute cat girl, cozy room, warm lighting --niji 7 --ar 1:1 --c 10 --w 430\",\n  \"botType\": \"\
          NIJI_JOURNEY\",\n  \"state\": \"openapi-mj-chaos-weird\"\n}'"
      - lang: curl-mj-blend-two
        label: mj_blend two-image blend
        source: "curl https://api.imarouter.com/mj/submit/imagine \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"mj_blend\"\
          ,\n  \"base64Array\": [\n    \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA...\",\n    \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB...\"\
          \n  ],\n  \"dimensions\": \"SQUARE\"\n}'"
  /mj/submit/blend:
    post:
      tags:
      - Midjourney
      summary: Submit Midjourney blend task
      description: 'Upload 2-5 images for fusion generation and return the task ID (asynchronous).

        Authentication: The request header must contain `Authorization: Bearer sk-...`.

        **IMPORTANT NOTICE (MUST READ)**

        - `base64Array` is currently processed according to the image URL input. Please confirm that the URL is accessible
        before calling, and it is recommended to persist the original image by yourself.

        - The generated result URL is a short-term link hosted by the platform, which will expire after about 30 days by default;
        please be sure to complete the download and archive within 30 days.'
      operationId: submitMidjourneyBlend
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - base64Array
              properties:
                base64Array:
                  type: array
                  minItems: 2
                  maxItems: 5
                  description: '2-5 image URL array (currently implemented as URL input processing).

                    **IMPORTANT**: Please confirm that the input URL is accessible before calling; the 30-day expiration rule
                    only applies to the result resource URL returned by the interface.'
                  items:
                    type: string
                prompt:
                  type: string
                  description: Optionally, append a text description.
            examples:
              blend_two_images:
                summary: Fusion of two images
                value:
                  base64Array:
                  - https://example.com/a.png
                  - https://example.com/b.png
              blend_two_images_with_prompt:
                summary: Fusion of two images + text
                value:
                  base64Array:
                  - https://example.com/a.png
                  - https://example.com/b.png
                  prompt: cinematic style
      responses:
        '200':
          description: Task has been submitted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MjSubmitResponse'
              examples:
                success:
                  value:
                    code: 1
                    result: task_id_blend_123
                    description: submitted
      x-codeSamples:
      - lang: curl-blend-two-images
        label: Fusion of two images
        source: "curl https://api.imarouter.com/mj/submit/blend \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"base64Array\": [\n   \
          \ \"https://example.com/a.png\",\n    \"https://example.com/b.png\"\n  ]\n}'"
      - lang: curl-blend-two-images-with-prompt
        label: Fusion of two images + text
        source: "curl https://api.imarouter.com/mj/submit/blend \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"base64Array\": [\n   \
          \ \"https://example.com/a.png\",\n    \"https://example.com/b.png\"\n  ],\n  \"prompt\": \"cinematic style\"\n}'"
  /mj/submit/change:
    post:
      tags:
      - Midjourney
      summary: Submit Midjourney variation / upscale / zoom etc.
      description: 'Run a follow-up operation on an existing task (U/V/zoom/pan etc.). **Required:** `taskId` (parent) + `customId`
        (button customId).


        **Models:**

        - `mj_upscale`, `mj_variation`, `mj_low_variation`, `mj_high_variation`, `mj_reroll`

        - `mj_zoom`, `mj_custom_zoom`, `mj_pan`


        `customId` must come from the previous task''s `buttons[].customId`; otherwise upstream rejects.

        '
      operationId: mjSubmitChange
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MidjourneyChangeRequest'
            examples:
              mj_upscale:
                summary: Upscale (U)
                value:
                  model: mj_upscale
                  taskId: '1751234567890'
                  customId: MJ::JOB::upsample::1::abc123
              mj_variation:
                summary: Variation (V)
                value:
                  model: mj_variation
                  taskId: '1751234567890'
                  customId: MJ::JOB::variation::2::abc123
              mj_low_variation:
                summary: Low variation
                value:
                  model: mj_low_variation
                  taskId: '1751234567890'
                  customId: MJ::JOB::low_variation::1::abc123
              mj_high_variation:
                summary: High variation
                value:
                  model: mj_high_variation
                  taskId: '1751234567890'
                  customId: MJ::JOB::high_variation::1::abc123
              mj_reroll:
                summary: Reroll
                value:
                  model: mj_reroll
                  taskId: '1751234567890'
                  customId: MJ::JOB::reroll::0::abc123::SOLO
              mj_zoom:
                summary: Zoom out
                value:
                  model: mj_zoom
                  taskId: '1751234567890'
                  customId: MJ::Outpaint::50::1::abc123
              mj_custom_zoom:
                summary: Custom zoom
                value:
                  model: mj_custom_zoom
                  taskId: '1751234567890'
                  customId: MJ::CustomZoom::1::abc123
                  prompt: --ar 16:9 --zoom 1.5
              mj_pan:
                summary: Pan
                value:
                  model: mj_pan
                  taskId: '1751234567890'
                  customId: MJ::JOB::pan_left::1::abc123::SOLO
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MidjourneySubmitResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-mj-upscale
        label: Upscale (U)
        source: "curl https://api.imarouter.com/mj/submit/change \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"mj_upscale\"\
          ,\n  \"taskId\": \"1751234567890\",\n  \"customId\": \"MJ::JOB::upsample::1::abc123\"\n}'"
      - lang: curl-mj-variation
        label: Variation (V)
        source: "curl https://api.imarouter.com/mj/submit/change \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"mj_variation\"\
          ,\n  \"taskId\": \"1751234567890\",\n  \"customId\": \"MJ::JOB::variation::2::abc123\"\n}'"
      - lang: curl-mj-low-variation
        label: Low variation
        source: "curl https://api.imarouter.com/mj/submit/change \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"mj_low_variation\"\
          ,\n  \"taskId\": \"1751234567890\",\n  \"customId\": \"MJ::JOB::low_variation::1::abc123\"\n}'"
      - lang: curl-mj-high-variation
        label: High variation
        source: "curl https://api.imarouter.com/mj/submit/change \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"mj_high_variation\"\
          ,\n  \"taskId\": \"1751234567890\",\n  \"customId\": \"MJ::JOB::high_variation::1::abc123\"\n}'"
      - lang: curl-mj-reroll
        label: Reroll
        source: "curl https://api.imarouter.com/mj/submit/change \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"mj_reroll\"\
          ,\n  \"taskId\": \"1751234567890\",\n  \"customId\": \"MJ::JOB::reroll::0::abc123::SOLO\"\n}'"
      - lang: curl-mj-zoom
        label: Zoom out
        source: "curl https://api.imarouter.com/mj/submit/change \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"mj_zoom\",\n\
          \  \"taskId\": \"1751234567890\",\n  \"customId\": \"MJ::Outpaint::50::1::abc123\"\n}'"
      - lang: curl-mj-custom-zoom
        label: Custom zoom
        source: "curl https://api.imarouter.com/mj/submit/change \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"mj_custom_zoom\"\
          ,\n  \"taskId\": \"1751234567890\",\n  \"customId\": \"MJ::CustomZoom::1::abc123\",\n  \"prompt\": \"--ar 16:9 --zoom\
          \ 1.5\"\n}'"
      - lang: curl-mj-pan
        label: Pan
        source: "curl https://api.imarouter.com/mj/submit/change \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"mj_pan\",\n\
          \  \"taskId\": \"1751234567890\",\n  \"customId\": \"MJ::JOB::pan_left::1::abc123::SOLO\"\n}'"
  /mj/task/{task_id}/fetch:
    get:
      tags:
      - Midjourney
      summary: Get Midjourney task status
      description: 'Poll the status, progress, result image URL, and available buttons for a Midjourney task (imagine/change/modal)
        by `task_id`.


        **Terminal states:** `SUCCESS` / `FAILURE` / `CANCEL`. Non-terminal: `NOT_START` / `SUBMITTED` / `MODAL` / `IN_PROGRESS`.

        '
      operationId: mjFetchTask
      parameters:
      - name: task_id
        in: path
        required: true
        schema:
          type: string
        description: Task ID returned by the submit call (the `result` field).
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MidjourneyTaskResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-get-mj-task-task-id-fetch
        label: Get Midjourney task status
        source: "curl https://api.imarouter.com/mj/task/task_202604270001/fetch \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'"
  /mj/image/{task_id}:
    get:
      tags:
      - Midjourney
      summary: Midjourney image proxy (first image)
      description: 'The agent obtains the first image of the MJ task (corresponding to `imageUrl`).

        If you need the complete gallery, please read the `urls` of `/mj/task/{task_id}/fetch` first.

        **Serious Notice (Must Read)**

        - The proxy image still comes from the query result resource, please download it immediately and save it persistently.

        - The platform does not guarantee that the proxy image URL will be accessible for a long time and will expire after
        about 30 days by default; do not treat this URL as a permanent storage address.'
      operationId: fetchMidjourneyImage
      parameters:
      - name: task_id
        in: path
        required: true
        schema:
          type: string
        description: MJ task ID.
      responses:
        '200':
          description: Image binary stream
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
                description: Image binary stream (usually `image/png` or `image/jpeg`).
      x-codeSamples:
      - lang: curl-get-mj-image-task-id
        label: Midjourney image proxy (first image)
        source: "curl https://api.imarouter.com/mj/image/task_202604270001 \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'"
  /v1/chat/completions:
    post:
      tags:
      - Chat
      summary: Create conversation completion
      description: 'Compatible with OpenAI Chat Completions API format. Supports both streaming and non-streaming responses.


        **Available models (47):**


        | Suppliers | Models |

        |--------|------|

        | OpenAI | `gpt-4.1`, `gpt-4.1-mini`, `gpt-4.1-nano`, `gpt-4o`, `gpt-4o-mini`, `gpt-5`, `gpt-5-mini`, `gpt-5.1`, `gpt-5.2`,
        `gpt-5.3-codex`, `gpt-5.4-mini` |

        | Google | `gemini-3.1-pro-preview`, `gemini-3-pro-preview`, `gemini-3-flash-preview`, `gemini-3-pro-image-preview`⚡,
        `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-2.5-flash-lite`, `gemini-2.5-flash-image`⚡, `gemini-2.0-flash`, `g3-pro-image-preview`⚡,
        `g2.5-flash-image`⚡ |

        | Anthropic | `claude-3-haiku-20240307`, `claude-3-5-haiku-20241022`, `claude-sonnet-4-20250514`, `claude-sonnet-4-5-20250929`,
        `claude-sonnet-4-6`, `claude-haiku-4-5-20251001`, `claude-opus-4-1-20250805`, `claude-opus-4-5-20251101`, `claude-opus-4-6`
        |

        | ByteDance | `seed-1-8-251228`, `seed-2-0-mini-260215`, `seed-1-6-flash-250715`, `seed-1-6-250915`, `seed-sc-260215`,
        `gpt-oss-120b-250805` |

        | DeepSeek | `deepseek-v4-pro`, `deepseek-v4-flash` |

        | MiniMax | `MiniMax-Text-01`, `MiniMax-M1`, `MiniMax-M2`, `MiniMax-M2.1`, `MiniMax-M2.1-highspeed`, `MiniMax-M2.5`,
        `MiniMax-M2.5-highspeed` |

        | Moonshot | `kimi-for-coding` |


        **Model endpoint capabilities (verified on 2026-05-22):**

        | Endpoint ID | Gateway path | Currently available models |

        |---------|---------|-------------|

        | `openai` | `/v1/chat/completions` | General chat models, including `deepseek-v4-pro`, `deepseek-v4-flash`, `gpt-5.4-mini`,
        `seed-sc-260215` |

        | `openai-response` | `/v1/responses` | `gpt-5.2`, `gpt-5.3-codex`, `gpt-5.5` |

        | `anthropic` | `/v1/messages` | `claude-sonnet-4-6`, `claude-opus-4-6`, `deepseek-v4-flash` |


        > ⚡ Models marked with ⚡ support conversational image generation and return inline base64 images. `deepseek-v4-pro`
        and `deepseek-v4-flash` are currently exposed as text-only chat models. MiniMax M series and `kimi-for-coding` are
        reasoning models whose responses include chain-of-thought content. The Anthropic Claude family is accessed through
        AWS Bedrock.


        > ⚠️ **Notes on reasoning models**: MiniMax M series (`MiniMax-M2` to `MiniMax-M2.5-highspeed`) and `kimi-for-coding`
        will output a thinking chain (`reasoning_content` field) before generating a formal answer, and the thinking chain
        itself will consume a lot of tokens. **It is recommended that `max_tokens` be set to no less than 1000**, otherwise
        the token quota may be exhausted during the inference phase, causing `content` to be empty.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
            examples:
              basic:
                summary: basic conversation
                value:
                  model: gpt-4.1-mini
                  messages:
                  - role: user
                    content: Hello, how are you?
              stream:
                summary: streaming conversation
                value:
                  model: claude-sonnet-4-6
                  messages:
                  - role: user
                    content: Write a short poem about AI
              claude:
                summary: Claude dialogue
                value:
                  model: claude-sonnet-4-6
                  messages:
                  - role: user
                    content: Hello, what can you help me with?
              claude_opus_4_7:
                summary: Claude Opus 4.7 flagship chat
                value:
                  model: claude-opus-4-7
                  messages:
                  - role: user
                    content: Plan a 3-day Tokyo itinerary for first-time visitors
              deepseek_text:
                summary: DeepSeek text chat
                value:
                  model: deepseek-v4-pro
                  messages:
                  - role: user
                    content: Summarize the benefits of API gateways in one sentence
              deepseek_flash_text:
                summary: DeepSeek Flash text chat
                value:
                  model: deepseek-v4-flash
                  messages:
                  - role: user
                    content: Summarize this paragraph in one sentence
              gpt_5_4_mini_text:
                summary: gpt-5.4-mini text chat
                value:
                  model: gpt-5.4-mini
                  messages:
                  - role: user
                    content: List three practical API design tips
              seed_sc_text:
                summary: seed-sc Chinese chat
                value:
                  model: seed-sc-260215
                  messages:
                  - role: user
                    content: 用一句话总结 API 网关的作用
              minimax_reasoning:
                summary: MiniMax inference model
                value:
                  model: MiniMax-M2.5
                  messages:
                  - role: user
                    content: Explain the difference between recursion and iteration
                  max_tokens: 2000
              function_tools:
                summary: Function Tools (OpenAI format)
                value:
                  model: gpt-5.1
                  messages:
                  - role: user
                    content: What's weather in Shanghai? Use tool.
                  tools:
                  - type: function
                    function:
                      name: get_weather
                      description: Get weather by city
                      parameters:
                        type: object
                        properties:
                          city:
                            type: string
                        required:
                        - city
                  tool_choice: auto
              gpt-4.1_default:
                summary: gpt-4.1 默认预设
                value:
                  model: gpt-4.1
                  messages:
                  - role: system
                    content: You are a helpful assistant.
                  temperature: 1
                  max_tokens: 4096
              gpt-4.1-mini_default:
                summary: gpt-4.1-mini 默认预设
                value:
                  model: gpt-4.1-mini
                  messages:
                  - role: system
                    content: You are a helpful assistant.
                  temperature: 1
                  max_tokens: 4096
              gpt-4.1-nano_default:
                summary: gpt-4.1-nano 默认预设
                value:
                  model: gpt-4.1-nano
                  messages:
                  - role: system
                    content: You are a helpful assistant.
                  temperature: 1
                  max_tokens: 2048
              gpt-4o_default:
                summary: gpt-4o 默认预设
                value:
                  model: gpt-4o
                  messages:
                  - role: system
                    content: You are a helpful assistant.
                  temperature: 1
                  max_tokens: 4096
              gpt-4o-mini_default:
                summary: gpt-4o-mini 默认预设
                value:
                  model: gpt-4o-mini
                  messages:
                  - role: system
                    content: You are a helpful assistant.
                  temperature: 1
                  max_tokens: 4096
              gpt-5_default:
                summary: gpt-5 默认预设
                value:
                  model: gpt-5
                  messages:
                  - role: system
                    content: You are a helpful assistant.
                  temperature: 1
                  max_tokens: 8192
              gpt-5-mini_default:
                summary: gpt-5-mini 默认预设
                value:
                  model: gpt-5-mini
                  messages:
                  - role: system
                    content: You are a helpful assistant.
                  temperature: 1
                  max_tokens: 8192
              gpt-5.1_default:
                summary: gpt-5.1 默认预设
                value:
                  model: gpt-5.1
                  messages:
                  - role: system
                    content: You are a helpful assistant.
                  temperature: 1
                  max_tokens: 8192
              MiniMax-Text-01_default:
                summary: MiniMax-Text-01 默认预设
                value:
                  model: MiniMax-Text-01
                  messages:
                  - role: system
                    content: You are a helpful assistant.
                  temperature: 0.9
                  max_tokens: 4096
              MiniMax-M1_default:
                summary: MiniMax-M1 默认预设
                value:
                  model: MiniMax-M1
                  messages:
                  - role: user
                    content: Explain how a transformer attention head works in 3 short bullet points.
                  temperature: 0.7
                  max_tokens: 4096
              MiniMax-M2_default:
                summary: MiniMax-M2 默认预设
                value:
                  model: MiniMax-M2
                  messages:
                  - role: user
                    content: Explain the difference between recursion and iteration.
                  temperature: 0.7
                  max_tokens: 4096
              MiniMax-M2.1_default:
                summary: MiniMax-M2.1 默认预设
                value:
                  model: MiniMax-M2.1
                  messages:
                  - role: user
                    content: Explain the difference between recursion and iteration.
                  temperature: 0.7
                  max_tokens: 4096
              MiniMax-M2.1-highspeed_default:
                summary: MiniMax-M2.1-highspeed 默认预设
                value:
                  model: MiniMax-M2.1-highspeed
                  messages:
                  - role: user
                    content: Explain the difference between recursion and iteration.
                  temperature: 0.7
                  max_tokens: 4096
              MiniMax-M2.5_default:
                summary: MiniMax-M2.5 默认预设
                value:
                  model: MiniMax-M2.5
                  messages:
                  - role: user
                    content: Explain the difference between recursion and iteration.
                  temperature: 0.7
                  max_tokens: 4096
              MiniMax-M2.5-highspeed_default:
                summary: MiniMax-M2.5-highspeed 默认预设
                value:
                  model: MiniMax-M2.5-highspeed
                  messages:
                  - role: user
                    content: Explain the difference between recursion and iteration.
                  temperature: 0.7
                  max_tokens: 4096
              claude-sonnet-4-5-20250929_default:
                summary: claude-sonnet-4-5 默认预设
                value:
                  model: claude-sonnet-4-5-20250929
                  messages:
                  - role: user
                    content: Hello, what can you help me with?
                  temperature: 1
                  max_tokens: 4096
              claude-sonnet-4-6_default:
                summary: claude-sonnet-4-6 默认预设
                value:
                  model: claude-sonnet-4-6
                  messages:
                  - role: user
                    content: Hello, what can you help me with?
                  temperature: 1
                  max_tokens: 4096
              claude-haiku-4-5-20251001_default:
                summary: claude-haiku-4-5 默认预设
                value:
                  model: claude-haiku-4-5-20251001
                  messages:
                  - role: user
                    content: Summarize this paragraph in one sentence.
                  temperature: 1
                  max_tokens: 2048
              claude-opus-4-5-20251101_default:
                summary: claude-opus-4-5 默认预设
                value:
                  model: claude-opus-4-5-20251101
                  messages:
                  - role: user
                    content: Plan a 3-day Tokyo itinerary for first-time visitors.
                  temperature: 1
                  max_tokens: 8192
              claude-opus-4-6_default:
                summary: claude-opus-4-6 默认预设
                value:
                  model: claude-opus-4-6
                  messages:
                  - role: user
                    content: Plan a 3-day Tokyo itinerary for first-time visitors.
                  temperature: 1
                  max_tokens: 8192
              claude-opus-4-7_default:
                summary: claude-opus-4-7 默认预设
                value:
                  model: claude-opus-4-7
                  messages:
                  - role: user
                    content: Plan a 3-day Tokyo itinerary for first-time visitors.
                  temperature: 1
                  max_tokens: 8192
              kimi-for-coding_default:
                summary: kimi-for-coding 编程默认预设
                value:
                  model: kimi-for-coding
                  messages:
                  - role: system
                    content: You are an expert programmer. Output concise, correct code with minimal explanation.
                  - role: user
                    content: Write a Python function that returns the nth Fibonacci number using memoization.
                  temperature: 0.2
                  max_tokens: 8192
              deepseek-v4-pro_default:
                summary: deepseek-v4-pro 默认预设
                value:
                  model: deepseek-v4-pro
                  messages:
                  - role: user
                    content: Summarize the benefits of API gateways in one sentence.
                  temperature: 0.7
                  max_tokens: 4096
              deepseek-v4-flash_default:
                summary: deepseek-v4-flash 默认预设
                value:
                  model: deepseek-v4-flash
                  messages:
                  - role: user
                    content: Summarize the benefits of API gateways in one sentence.
                  temperature: 0.7
                  max_tokens: 4096
              gpt-5.4-mini_default:
                summary: gpt-5.4-mini 默认预设
                value:
                  model: gpt-5.4-mini
                  messages:
                  - role: system
                    content: You are a helpful assistant.
                  - role: user
                    content: List three practical API design tips.
                  temperature: 1
                  max_tokens: 8192
              seed-sc-260215_default:
                summary: seed-sc-260215 默认预设
                value:
                  model: seed-sc-260215
                  messages:
                  - role: user
                    content: 用一句话总结 API 网关的作用。
                  temperature: 0.7
                  max_tokens: 4096
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-basic
        label: basic conversation
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gpt-4.1-mini\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Hello, how are you?\"\n    }\n  ]\n\
          }'"
      - lang: curl-stream
        label: streaming conversation
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"claude-sonnet-4-6\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Write a short poem about AI\"\n   \
          \ }\n  ]\n}'"
      - lang: curl-claude
        label: Claude dialogue
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"claude-sonnet-4-6\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Hello, what can you help me with?\"\
          \n    }\n  ]\n}'"
      - lang: curl-claude-opus-4-7
        label: Claude Opus 4.7 flagship chat
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"claude-opus-4-7\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Plan a 3-day Tokyo itinerary for first-time\
          \ visitors\"\n    }\n  ]\n}'"
      - lang: curl-deepseek-text
        label: DeepSeek text chat
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"deepseek-v4-pro\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Summarize the benefits of API gateways\
          \ in one sentence\"\n    }\n  ]\n}'"
      - lang: curl-deepseek-flash-text
        label: DeepSeek Flash text chat
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"deepseek-v4-flash\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Summarize this paragraph in one sentence\"\
          \n    }\n  ]\n}'"
      - lang: curl-gpt-5-4-mini-text
        label: gpt-5.4-mini text chat
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gpt-5.4-mini\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"List three practical API design tips\"\
          \n    }\n  ]\n}'"
      - lang: curl-seed-sc-text
        label: seed-sc Chinese chat
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seed-sc-260215\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"用一句话总结 API 网关的作用\"\n    }\n  ]\n}'"
      - lang: curl-minimax-reasoning
        label: MiniMax inference model
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"MiniMax-M2.5\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Explain the difference between recursion\
          \ and iteration\"\n    }\n  ],\n  \"max_tokens\": 2000\n}'"
      - lang: curl-function-tools
        label: Function Tools (OpenAI format)
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gpt-5.1\",\n\
          \  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"What'\"'\"'s weather in Shanghai? Use\
          \ tool.\"\n    }\n  ],\n  \"tools\": [\n    {\n      \"type\": \"function\",\n      \"function\": {\n        \"\
          name\": \"get_weather\",\n        \"description\": \"Get weather by city\",\n        \"parameters\": {\n       \
          \   \"type\": \"object\",\n          \"properties\": {\n            \"city\": {\n              \"type\": \"string\"\
          \n            }\n          },\n          \"required\": [\n            \"city\"\n          ]\n        }\n      }\n\
          \    }\n  ],\n  \"tool_choice\": \"auto\"\n}'"
      - lang: curl-gpt-4-1-default
        label: gpt-4.1 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gpt-4.1\",\n\
          \  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"You are a helpful assistant.\"\n  \
          \  }\n  ],\n  \"temperature\": 1,\n  \"max_tokens\": 4096\n}'"
      - lang: curl-gpt-4-1-mini-default
        label: gpt-4.1-mini 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gpt-4.1-mini\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"You are a helpful assistant.\"\n\
          \    }\n  ],\n  \"temperature\": 1,\n  \"max_tokens\": 4096\n}'"
      - lang: curl-gpt-4-1-nano-default
        label: gpt-4.1-nano 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gpt-4.1-nano\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"You are a helpful assistant.\"\n\
          \    }\n  ],\n  \"temperature\": 1,\n  \"max_tokens\": 2048\n}'"
      - lang: curl-gpt-4o-default
        label: gpt-4o 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gpt-4o\",\n\
          \  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"You are a helpful assistant.\"\n  \
          \  }\n  ],\n  \"temperature\": 1,\n  \"max_tokens\": 4096\n}'"
      - lang: curl-gpt-4o-mini-default
        label: gpt-4o-mini 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gpt-4o-mini\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"You are a helpful assistant.\"\n\
          \    }\n  ],\n  \"temperature\": 1,\n  \"max_tokens\": 4096\n}'"
      - lang: curl-gpt-5-default
        label: gpt-5 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gpt-5\",\n\
          \  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"You are a helpful assistant.\"\n  \
          \  }\n  ],\n  \"temperature\": 1,\n  \"max_tokens\": 8192\n}'"
      - lang: curl-gpt-5-mini-default
        label: gpt-5-mini 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gpt-5-mini\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"You are a helpful assistant.\"\n\
          \    }\n  ],\n  \"temperature\": 1,\n  \"max_tokens\": 8192\n}'"
      - lang: curl-gpt-5-1-default
        label: gpt-5.1 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gpt-5.1\",\n\
          \  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"You are a helpful assistant.\"\n  \
          \  }\n  ],\n  \"temperature\": 1,\n  \"max_tokens\": 8192\n}'"
      - lang: curl-minimax-text-01-default
        label: MiniMax-Text-01 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"MiniMax-Text-01\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"You are a helpful assistant.\"\n\
          \    }\n  ],\n  \"temperature\": 0.9,\n  \"max_tokens\": 4096\n}'"
      - lang: curl-minimax-m1-default
        label: MiniMax-M1 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"MiniMax-M1\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Explain how a transformer attention\
          \ head works in 3 short bullet points.\"\n    }\n  ],\n  \"temperature\": 0.7,\n  \"max_tokens\": 4096\n}'"
      - lang: curl-minimax-m2-default
        label: MiniMax-M2 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"MiniMax-M2\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Explain the difference between recursion\
          \ and iteration.\"\n    }\n  ],\n  \"temperature\": 0.7,\n  \"max_tokens\": 4096\n}'"
      - lang: curl-minimax-m2-1-default
        label: MiniMax-M2.1 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"MiniMax-M2.1\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Explain the difference between recursion\
          \ and iteration.\"\n    }\n  ],\n  \"temperature\": 0.7,\n  \"max_tokens\": 4096\n}'"
      - lang: curl-minimax-m2-1-highspeed-default
        label: MiniMax-M2.1-highspeed 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"MiniMax-M2.1-highspeed\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Explain the difference between recursion\
          \ and iteration.\"\n    }\n  ],\n  \"temperature\": 0.7,\n  \"max_tokens\": 4096\n}'"
      - lang: curl-minimax-m2-5-default
        label: MiniMax-M2.5 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"MiniMax-M2.5\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Explain the difference between recursion\
          \ and iteration.\"\n    }\n  ],\n  \"temperature\": 0.7,\n  \"max_tokens\": 4096\n}'"
      - lang: curl-minimax-m2-5-highspeed-default
        label: MiniMax-M2.5-highspeed 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"MiniMax-M2.5-highspeed\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Explain the difference between recursion\
          \ and iteration.\"\n    }\n  ],\n  \"temperature\": 0.7,\n  \"max_tokens\": 4096\n}'"
      - lang: curl-claude-sonnet-4-5-20250929-default
        label: claude-sonnet-4-5 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"claude-sonnet-4-5-20250929\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Hello, what can you help me with?\"\
          \n    }\n  ],\n  \"temperature\": 1,\n  \"max_tokens\": 4096\n}'"
      - lang: curl-claude-sonnet-4-6-default
        label: claude-sonnet-4-6 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"claude-sonnet-4-6\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Hello, what can you help me with?\"\
          \n    }\n  ],\n  \"temperature\": 1,\n  \"max_tokens\": 4096\n}'"
      - lang: curl-claude-haiku-4-5-20251001-default
        label: claude-haiku-4-5 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"claude-haiku-4-5-20251001\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Summarize this paragraph in one sentence.\"\
          \n    }\n  ],\n  \"temperature\": 1,\n  \"max_tokens\": 2048\n}'"
      - lang: curl-claude-opus-4-5-20251101-default
        label: claude-opus-4-5 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"claude-opus-4-5-20251101\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Plan a 3-day Tokyo itinerary for first-time\
          \ visitors.\"\n    }\n  ],\n  \"temperature\": 1,\n  \"max_tokens\": 8192\n}'"
      - lang: curl-claude-opus-4-6-default
        label: claude-opus-4-6 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"claude-opus-4-6\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Plan a 3-day Tokyo itinerary for first-time\
          \ visitors.\"\n    }\n  ],\n  \"temperature\": 1,\n  \"max_tokens\": 8192\n}'"
      - lang: curl-claude-opus-4-7-default
        label: claude-opus-4-7 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"claude-opus-4-7\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Plan a 3-day Tokyo itinerary for first-time\
          \ visitors.\"\n    }\n  ],\n  \"temperature\": 1,\n  \"max_tokens\": 8192\n}'"
      - lang: curl-kimi-for-coding-default
        label: kimi-for-coding 编程默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"kimi-for-coding\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"You are an expert programmer. Output\
          \ concise, correct code with minimal explanation.\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\"\
          : \"Write a Python function that returns the nth Fibonacci number using memoization.\"\n    }\n  ],\n  \"temperature\"\
          : 0.2,\n  \"max_tokens\": 8192\n}'"
      - lang: curl-deepseek-v4-pro-default
        label: deepseek-v4-pro 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"deepseek-v4-pro\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Summarize the benefits of API gateways\
          \ in one sentence.\"\n    }\n  ],\n  \"temperature\": 0.7,\n  \"max_tokens\": 4096\n}'"
      - lang: curl-deepseek-v4-flash-default
        label: deepseek-v4-flash 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"deepseek-v4-flash\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Summarize the benefits of API gateways\
          \ in one sentence.\"\n    }\n  ],\n  \"temperature\": 0.7,\n  \"max_tokens\": 4096\n}'"
      - lang: curl-gpt-5-4-mini-default
        label: gpt-5.4-mini 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gpt-5.4-mini\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"You are a helpful assistant.\"\n\
          \    },\n    {\n      \"role\": \"user\",\n      \"content\": \"List three practical API design tips.\"\n    }\n\
          \  ],\n  \"temperature\": 1,\n  \"max_tokens\": 8192\n}'"
      - lang: curl-seed-sc-260215-default
        label: seed-sc-260215 默认预设
        source: "curl https://api.imarouter.com/v1/chat/completions \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"seed-sc-260215\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"用一句话总结 API 网关的作用。\"\n    }\n  ],\n\
          \  \"temperature\": 0.7,\n  \"max_tokens\": 4096\n}'"
  /v1/responses:
    post:
      tags:
      - Chat
      summary: Create Responses
      description: 'Compatible with OpenAI Responses API format.


        Only models with the `openai-response` endpoint capability enabled are supported.

        **Current verified models (2026-05-04):** `gpt-5.2`, `gpt-5.3-codex`, `gpt-5.5`'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResponsesRequest'
            examples:
              gpt-5.2_default:
                summary: gpt-5.2 默认预设
                value:
                  model: gpt-5.2
                  input: Hello, what can you help me with?
                  max_output_tokens: 8192
                  temperature: 1
              gpt-5.3-codex_default:
                summary: gpt-5.3-codex 编程默认预设
                value:
                  model: gpt-5.3-codex
                  input: Write a Python function that returns the nth Fibonacci number using memoization.
                  max_output_tokens: 16384
                  temperature: 0.3
              gpt-5.4_default:
                summary: gpt-5.4 默认预设
                value:
                  model: gpt-5.4
                  input: List 3 tips for writing clean Python.
                  max_output_tokens: 8192
                  temperature: 1
              gpt-5.5_default:
                summary: gpt-5.5 默认预设
                value:
                  model: gpt-5.5
                  input: Explain agentic coding in 3 sentences.
                  max_output_tokens: 8192
                  temperature: 1
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponsesResponse'
        '400':
          description: Parameter error or model does not support the endpoint
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-gpt-5-2-default
        label: gpt-5.2 默认预设
        source: "curl https://api.imarouter.com/v1/responses \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gpt-5.2\",\n  \"input\": \"Hello,\
          \ what can you help me with?\",\n  \"max_output_tokens\": 8192,\n  \"temperature\": 1\n}'"
      - lang: curl-gpt-5-3-codex-default
        label: gpt-5.3-codex 编程默认预设
        source: "curl https://api.imarouter.com/v1/responses \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gpt-5.3-codex\",\n  \"input\"\
          : \"Write a Python function that returns the nth Fibonacci number using memoization.\",\n  \"max_output_tokens\"\
          : 16384,\n  \"temperature\": 0.3\n}'"
      - lang: curl-gpt-5-4-default
        label: gpt-5.4 默认预设
        source: "curl https://api.imarouter.com/v1/responses \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gpt-5.4\",\n  \"input\": \"List\
          \ 3 tips for writing clean Python.\",\n  \"max_output_tokens\": 8192,\n  \"temperature\": 1\n}'"
      - lang: curl-gpt-5-5-default
        label: gpt-5.5 默认预设
        source: "curl https://api.imarouter.com/v1/responses \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"gpt-5.5\",\n  \"input\": \"Explain\
          \ agentic coding in 3 sentences.\",\n  \"max_output_tokens\": 8192,\n  \"temperature\": 1\n}'"
  /v1/messages:
    post:
      tags:
      - Chat
      summary: Create an Anthropic Messages response
      description: 'Compatible with Anthropic Messages API format.


        Only models with the `anthropic` endpoint capability enabled are supported.

        **Current verified models (2026-05-22):** `claude-sonnet-4-6`, `claude-opus-4-6`, `glm-5.1`, `deepseek-v4-flash`'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnthropicMessagesRequest'
            examples:
              claude-sonnet-4-5-20250929_default:
                summary: claude-sonnet-4-5 默认预设
                value:
                  model: claude-sonnet-4-5-20250929
                  anthropic_version: bedrock-2023-05-31
                  max_tokens: 4096
                  temperature: 1
                  system: You are a helpful assistant.
                  messages:
                  - role: user
                    content: Hello, what can you help me with?
              claude-sonnet-4-6_default:
                summary: claude-sonnet-4-6 默认预设
                value:
                  model: claude-sonnet-4-6
                  anthropic_version: bedrock-2023-05-31
                  max_tokens: 4096
                  temperature: 1
                  system: You are a helpful assistant.
                  messages:
                  - role: user
                    content: Hello, what can you help me with?
              claude-haiku-4-5-20251001_default:
                summary: claude-haiku-4-5 默认预设
                value:
                  model: claude-haiku-4-5-20251001
                  anthropic_version: bedrock-2023-05-31
                  max_tokens: 2048
                  temperature: 1
                  system: You are a concise summarizer.
                  messages:
                  - role: user
                    content: Summarize this paragraph in one sentence.
              claude-opus-4-5-20251101_default:
                summary: claude-opus-4-5 默认预设
                value:
                  model: claude-opus-4-5-20251101
                  anthropic_version: bedrock-2023-05-31
                  max_tokens: 8192
                  temperature: 1
                  system: You are a careful planner.
                  messages:
                  - role: user
                    content: Plan a 3-day Tokyo itinerary for first-time visitors.
              claude-opus-4-6_default:
                summary: claude-opus-4-6 默认预设
                value:
                  model: claude-opus-4-6
                  anthropic_version: bedrock-2023-05-31
                  max_tokens: 8192
                  temperature: 1
                  system: You are a careful planner.
                  messages:
                  - role: user
                    content: Plan a 3-day Tokyo itinerary for first-time visitors.
              claude-opus-4-7_default:
                summary: claude-opus-4-7 默认预设
                value:
                  model: claude-opus-4-7
                  anthropic_version: bedrock-2023-05-31
                  max_tokens: 8192
                  temperature: 1
                  system: You are a careful planner.
                  messages:
                  - role: user
                    content: Plan a 3-day Tokyo itinerary for first-time visitors.
              glm-5.1_default:
                summary: glm-5.1 默认预设
                value:
                  model: glm-5.1
                  anthropic_version: bedrock-2023-05-31
                  max_tokens: 4096
                  temperature: 1
                  system: You are a helpful assistant.
                  messages:
                  - role: user
                    content: Hello, what can you help me with?
              deepseek-v4-flash_default:
                summary: deepseek-v4-flash default preset
                value:
                  model: deepseek-v4-flash
                  anthropic_version: bedrock-2023-05-31
                  max_tokens: 4096
                  temperature: 1
                  system: You are a helpful assistant.
                  messages:
                  - role: user
                    content: Summarize the benefits of API gateways in one sentence.
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicMessagesResponse'
        '400':
          description: Parameter error or model does not support the endpoint
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-claude-sonnet-4-5-20250929-default
        label: claude-sonnet-4-5 默认预设
        source: "curl https://api.imarouter.com/v1/messages \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"claude-sonnet-4-5-20250929\",\n\
          \  \"anthropic_version\": \"bedrock-2023-05-31\",\n  \"max_tokens\": 4096,\n  \"temperature\": 1,\n  \"system\"\
          : \"You are a helpful assistant.\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"\
          Hello, what can you help me with?\"\n    }\n  ]\n}'"
      - lang: curl-claude-sonnet-4-6-default
        label: claude-sonnet-4-6 默认预设
        source: "curl https://api.imarouter.com/v1/messages \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"claude-sonnet-4-6\",\n  \"anthropic_version\"\
          : \"bedrock-2023-05-31\",\n  \"max_tokens\": 4096,\n  \"temperature\": 1,\n  \"system\": \"You are a helpful assistant.\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Hello, what can you help me with?\"\
          \n    }\n  ]\n}'"
      - lang: curl-claude-haiku-4-5-20251001-default
        label: claude-haiku-4-5 默认预设
        source: "curl https://api.imarouter.com/v1/messages \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"claude-haiku-4-5-20251001\",\n\
          \  \"anthropic_version\": \"bedrock-2023-05-31\",\n  \"max_tokens\": 2048,\n  \"temperature\": 1,\n  \"system\"\
          : \"You are a concise summarizer.\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"\
          Summarize this paragraph in one sentence.\"\n    }\n  ]\n}'"
      - lang: curl-claude-opus-4-5-20251101-default
        label: claude-opus-4-5 默认预设
        source: "curl https://api.imarouter.com/v1/messages \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"claude-opus-4-5-20251101\",\n\
          \  \"anthropic_version\": \"bedrock-2023-05-31\",\n  \"max_tokens\": 8192,\n  \"temperature\": 1,\n  \"system\"\
          : \"You are a careful planner.\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Plan\
          \ a 3-day Tokyo itinerary for first-time visitors.\"\n    }\n  ]\n}'"
      - lang: curl-claude-opus-4-6-default
        label: claude-opus-4-6 默认预设
        source: "curl https://api.imarouter.com/v1/messages \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"claude-opus-4-6\",\n  \"anthropic_version\"\
          : \"bedrock-2023-05-31\",\n  \"max_tokens\": 8192,\n  \"temperature\": 1,\n  \"system\": \"You are a careful planner.\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Plan a 3-day Tokyo itinerary for first-time\
          \ visitors.\"\n    }\n  ]\n}'"
      - lang: curl-claude-opus-4-7-default
        label: claude-opus-4-7 默认预设
        source: "curl https://api.imarouter.com/v1/messages \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"claude-opus-4-7\",\n  \"anthropic_version\"\
          : \"bedrock-2023-05-31\",\n  \"max_tokens\": 8192,\n  \"temperature\": 1,\n  \"system\": \"You are a careful planner.\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Plan a 3-day Tokyo itinerary for first-time\
          \ visitors.\"\n    }\n  ]\n}'"
      - lang: curl-glm-5-1-default
        label: glm-5.1 默认预设
        source: "curl https://api.imarouter.com/v1/messages \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"glm-5.1\",\n  \"anthropic_version\"\
          : \"bedrock-2023-05-31\",\n  \"max_tokens\": 4096,\n  \"temperature\": 1,\n  \"system\": \"You are a helpful assistant.\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Hello, what can you help me with?\"\
          \n    }\n  ]\n}'"
      - lang: curl-deepseek-v4-flash-default
        label: deepseek-v4-flash default preset
        source: "curl https://api.imarouter.com/v1/messages \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"deepseek-v4-flash\",\n  \"anthropic_version\"\
          : \"bedrock-2023-05-31\",\n  \"max_tokens\": 4096,\n  \"temperature\": 1,\n  \"system\": \"You are a helpful assistant.\"\
          ,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Summarize the benefits of API gateways\
          \ in one sentence.\"\n    }\n  ]\n}'"
  /v1/embeddings:
    post:
      tags:
      - Chat
      summary: Create text embeddings
      description: 'Convert text into a vector representation suitable for semantic search, clustering, and RAG retrieval.


        **Supported models:**

        - `text-embedding-3-large` (recommended, 3072 dims, supports `dimensions` parameter for truncation)

        - `text-embedding-3-small` (lightweight embedding model for cost-sensitive retrieval)


        **Parameters:**

        - `input`: string or array of strings; batching is more efficient than per-item calls.

        - `dimensions`: optional integer (1 ~ 3072); explicitly truncate the output vector. Omit to use the model default.

        - `encoding_format`: `float` (default) returns a JSON number array; `base64` returns a compact encoded string.

        - `user`: optional end-user identifier for upstream abuse monitoring.

        '
      operationId: createEmbeddings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbeddingRequest'
            examples:
              basic:
                summary: Single string
                value:
                  model: text-embedding-3-large
                  input: API gateways simplify routing, auth, and rate limits.
              batch:
                summary: Batch of strings
                value:
                  model: text-embedding-3-large
                  input:
                  - first sentence to embed
                  - second sentence to embed
                  encoding_format: float
              high_dim:
                summary: Custom dimensions
                value:
                  model: text-embedding-3-large
                  input: keep this short
                  dimensions: 256
              small_model:
                summary: text-embedding-3-small single string
                value:
                  model: text-embedding-3-small
                  input: API gateways simplify routing, auth, and rate limits.
                  encoding_format: float
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbeddingResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-basic
        label: Single string
        source: "curl https://api.imarouter.com/v1/embeddings \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"text-embedding-3-large\",\n  \"\
          input\": \"API gateways simplify routing, auth, and rate limits.\"\n}'"
      - lang: curl-batch
        label: Batch of strings
        source: "curl https://api.imarouter.com/v1/embeddings \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"text-embedding-3-large\",\n  \"\
          input\": [\n    \"first sentence to embed\",\n    \"second sentence to embed\"\n  ],\n  \"encoding_format\": \"\
          float\"\n}'"
      - lang: curl-high-dim
        label: Custom dimensions
        source: "curl https://api.imarouter.com/v1/embeddings \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"text-embedding-3-large\",\n  \"\
          input\": \"keep this short\",\n  \"dimensions\": 256\n}'"
      - lang: curl-small-model
        label: text-embedding-3-small single string
        source: "curl https://api.imarouter.com/v1/embeddings \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"text-embedding-3-small\",\n  \"\
          input\": \"API gateways simplify routing, auth, and rate limits.\",\n  \"encoding_format\": \"float\"\n}'"
  /mj/submit/modal:
    post:
      tags:
      - Midjourney
      summary: Submit Midjourney remix / regional edit
      description: 'Midjourney remix / inpaint operation. Requires parent `taskId` + RemixModal `customId` + new `prompt`.
        Optional `maskBase64` for regional edit.

        '
      operationId: mjSubmitModal
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MidjourneyModalRequest'
            examples:
              mj_remix:
                summary: mj_remix remix
                value:
                  model: mj_remix
                  taskId: '1751234567890'
                  customId: MJ::RemixModal::abc123
                  prompt: a fox wearing a wizard hat, mystic forest backdrop
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MidjourneySubmitResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-mj-remix
        label: mj_remix remix
        source: "curl https://api.imarouter.com/mj/submit/modal \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"mj_remix\"\
          ,\n  \"taskId\": \"1751234567890\",\n  \"customId\": \"MJ::RemixModal::abc123\",\n  \"prompt\": \"a fox wearing\
          \ a wizard hat, mystic forest backdrop\"\n}'"
  /kling/v1/videos/text2video:
    post:
      tags:
      - Kling Video
      summary: Submit Kling text-to-video task
      operationId: klingText2Video
      description: 'Kling text-to-video native endpoint (asynchronous task system). This document only describes the request
        format of `POST /kling/v1/videos/text2video`.


        After submission, `task_id` is returned, which can be queried through `GET /kling/v1/videos/text2video/{task_id}`;
        task query is also compatible with `GET /v1/video/generations/{task_id}` and `GET /v1/videos/{task_id}`.


        To submit tasks using `POST /v1/video/generations` or `POST /v1/videos`, please check the corresponding endpoint documentation;
        they use the Unified Video/OpenAI compatible request format and are not exactly the same as Kling''s native endpoints.


        **Supported models:**

        - `kling-v1`

        - `kling-v1-6`

        - `kling-v2-master` (master version, no std/pro distinction)

        - `kling-v2-1-master` (master version, no std/pro distinction)

        - `kling-v2-5-turbo`

        - `kling-v2-6`

        - `kling-video-o1`


        **Parameter description:**

        - `mode`: quality, `std` (standard, default) or `pro` (high quality). The Master Edition model does not have this
        parameter.

        - `duration`: duration (seconds), default 5, supports 5 or 10.

        - `aspect_ratio`: aspect ratio, `1:1` (default), `16:9`, `9:16`. You can also pass `size` to pass the size for automatic
        mapping.

        - `cfg_scale`: Generate degrees of freedom, 0~1, default 0.5.

        - `negative_prompt`: negative prompt word (optional).

        - `camera_control`: lens control (optional, passed through metadata).

        - `model`: Kling video model name.


        **IMPORTANT NOTICE (MUST READ)**

        - The video URL returned after the task is completed is a short-term link hosted by the platform. It is recommended
        to download and persist it immediately after receiving it.

        - Platform hosting resources expire after about 30 days by default. Please be sure to complete the download and archive
        within 30 days.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KlingText2VideoRequest'
            examples:
              text2video_std_5s:
                summary: Text-to-video std 5s
                value:
                  model: kling-v1-6
                  prompt: A cat playing with a ball of yarn in a sunny room
                  mode: std
                  duration: 5
                  aspect_ratio: '16:9'
              text2video_pro_10s:
                summary: Text-to-video pro 10s
                value:
                  model: kling-v2-5-turbo
                  prompt: A cinematic drone shot above a quiet lake at sunrise
                  mode: pro
                  duration: 10
                  aspect_ratio: '16:9'
              text2video_master:
                summary: Text-to-video (Master Edition)
                value:
                  model: kling-v2-master
                  prompt: Hyper-realistic close-up of a dewdrop on a leaf
                  duration: 5
                  aspect_ratio: '1:1'
      responses:
        '200':
          description: Task submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-text2video-std-5s
        label: Text-to-video std 5s
        source: "curl https://api.imarouter.com/kling/v1/videos/text2video \\\n  --request POST \\\n  --header 'Authorization:\
          \ Bearer YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"kling-v1-6\"\
          ,\n  \"prompt\": \"A cat playing with a ball of yarn in a sunny room\",\n  \"mode\": \"std\",\n  \"duration\": 5,\n\
          \  \"aspect_ratio\": \"16:9\"\n}'"
      - lang: curl-text2video-pro-10s
        label: Text-to-video pro 10s
        source: "curl https://api.imarouter.com/kling/v1/videos/text2video \\\n  --request POST \\\n  --header 'Authorization:\
          \ Bearer YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"kling-v2-5-turbo\"\
          ,\n  \"prompt\": \"A cinematic drone shot above a quiet lake at sunrise\",\n  \"mode\": \"pro\",\n  \"duration\"\
          : 10,\n  \"aspect_ratio\": \"16:9\"\n}'"
      - lang: curl-text2video-master
        label: Text-to-video (Master Edition)
        source: "curl https://api.imarouter.com/kling/v1/videos/text2video \\\n  --request POST \\\n  --header 'Authorization:\
          \ Bearer YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"kling-v2-master\"\
          ,\n  \"prompt\": \"Hyper-realistic close-up of a dewdrop on a leaf\",\n  \"duration\": 5,\n  \"aspect_ratio\": \"\
          1:1\"\n}'"
  /kling/v1/videos/image2video:
    post:
      tags:
      - Kling Video
      summary: Submit Kling image-to-video task
      operationId: klingImage2Video
      description: 'Kling image-to-video native endpoint. This document only describes the request format of `POST /kling/v1/videos/image2video`.


        To submit tasks using `POST /v1/video/generations` or `POST /v1/videos`, please check the corresponding endpoint documentation;
        they use the unified video/OpenAI compatible request format and are not exactly the same as Kling''s native endpoints.


        **Parameters:**

        - `model`: Kling video model name.

        - `image`: required reference image URL.

        - `image_tail`: optional last-frame image URL for first/last frame mode.

        - Other parameters are the same as text-to-video.


        **Input image requirements (important)**

        - `image` and `image_tail` must be directly downloadable image URLs, and the response body must be a recognizable
        image. Do not use expired links, login pages, HTML redirect pages, or corrupted files.

        - The upstream service validates input image dimensions and pixel validity. Images that are too small, have abnormal
        dimensions, invalid pixels, or unreadable dimensions may fail at terminal status.

        - If the task returns `Image pixel is invalid`, replace the input with an original image that has valid dimensions
        and pixels, then resubmit.


        **IMPORTANT NOTICE (MUST READ)**

        - Input URLs such as `image` and `image_tail` are task input references. Please confirm that they are accessible when
        submitting.

        - The video URL returned after the task is completed is a short-term link hosted by the platform and will expire after
        about 30 days by default; please be sure to complete the download and archive within 30 days.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KlingImage2VideoRequest'
            examples:
              image2video:
                summary: Image-to-video
                value:
                  model: kling-v1-6
                  prompt: A gentle camera pan revealing the scene
                  image: https://example.com/reference.jpg
                  mode: std
                  duration: 5
                  aspect_ratio: '16:9'
              image2video_head_tail:
                summary: First/last-frame image-to-video
                value:
                  model: kling-v2-5-turbo
                  prompt: Smooth transition between two scenes
                  image: https://example.com/first_frame.jpg
                  image_tail: https://example.com/last_frame.jpg
                  mode: pro
                  duration: 5
      responses:
        '200':
          description: Task submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskResponse'
        '400':
          description: Parameter error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
              examples:
                image_pixel_invalid:
                  summary: Input image pixels are invalid
                  value:
                    code: '500'
                    message: Image pixel is invalid
                    data: null
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-image2video
        label: Image-to-video
        source: "curl https://api.imarouter.com/kling/v1/videos/image2video \\\n  --request POST \\\n  --header 'Authorization:\
          \ Bearer YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"kling-v1-6\"\
          ,\n  \"prompt\": \"A gentle camera pan revealing the scene\",\n  \"image\": \"https://example.com/reference.jpg\"\
          ,\n  \"mode\": \"std\",\n  \"duration\": 5,\n  \"aspect_ratio\": \"16:9\"\n}'"
      - lang: curl-image2video-head-tail
        label: First/last-frame image-to-video
        source: "curl https://api.imarouter.com/kling/v1/videos/image2video \\\n  --request POST \\\n  --header 'Authorization:\
          \ Bearer YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"kling-v2-5-turbo\"\
          ,\n  \"prompt\": \"Smooth transition between two scenes\",\n  \"image\": \"https://example.com/first_frame.jpg\"\
          ,\n  \"image_tail\": \"https://example.com/last_frame.jpg\",\n  \"mode\": \"pro\",\n  \"duration\": 5\n}'"
  /v1/video/generations#kling:
    post:
      tags:
      - Kling Video
      summary: Submit Kling video task (unified endpoint)
      operationId: klingUnifiedVideoGeneration
      description: 'Universal video submission endpoint for Kling video tasks. This document only covers Kling models to avoid
        affecting other vendors'' video endpoint descriptions.


        **Actual request path:** `POST /v1/video/generations`


        **Compatible path:** The same JSON request body can also be used for `POST /v1/videos`.


        **Differences from Kling native endpoints:**

        - Native endpoints: `POST /kling/v1/videos/text2video`, `POST /kling/v1/videos/image2video`, using Kling native fields
        such as `image_tail`.

        - Generic endpoints: `POST /v1/video/generations` / `POST /v1/videos`, using unified video fields such as `model`,
        `prompt`, `image`, `images`, `size`, `metadata`.


        **Supported models:**

        - `kling-v1`

        - `kling-v1-6`

        - `kling-v2-master`

        - `kling-v2-1-master`

        - `kling-v2-5-turbo`

        - `kling-v2-6`

        - `kling-video-o1`


        **Input image requirements (important)**

        - `image`, `images`, and `metadata.image_tail` must be directly downloadable image URLs, and each response body must
        be a recognizable image. Do not use expired links, login pages, HTML redirect pages, or corrupted files.

        - The upstream service validates input image dimensions and pixel validity. Images that are too small, have abnormal
        dimensions, invalid pixels, or unreadable dimensions may fail at terminal status.

        - If the task returns `Image pixel is invalid`, replace the input with original images that have valid dimensions
        and pixels, then resubmit.


        **IMPORTANT NOTICE (MUST READ)**

        - Input URLs such as `image`, `images`, `metadata.image_tail`, etc. are task input references. Please confirm that
        they are accessible when submitting.

        - The video URL returned after the task is completed is a short-term link hosted by the platform and will expire after
        about 30 days by default; please be sure to complete the download and archive within 30 days.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KlingUnifiedVideoRequest'
            examples:
              text2video:
                summary: Text-to-video
                value:
                  model: kling-v1-6
                  prompt: A cat playing with a ball of yarn in a sunny room
                  duration: 5
                  size: '16:9'
                  metadata:
                    mode: std
                    cfg_scale: 0.5
              image2video:
                summary: Image-to-video
                value:
                  model: kling-v1-6
                  prompt: A gentle camera pan revealing the scene
                  image: https://example.com/reference.jpg
                  duration: 5
                  size: '16:9'
                  metadata:
                    mode: std
                    cfg_scale: 0.5
              image2video_head_tail:
                summary: First/last-frame image-to-video
                value:
                  model: kling-v2-5-turbo
                  prompt: Smooth transition between two scenes
                  image: https://example.com/first_frame.jpg
                  duration: 5
                  size: '16:9'
                  metadata:
                    mode: pro
                    image_tail: https://example.com/last_frame.jpg
      responses:
        '200':
          description: Task submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskResponse'
        '400':
          description: Parameter error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
              examples:
                image_pixel_invalid:
                  summary: Input image pixels are invalid
                  value:
                    code: '500'
                    message: Image pixel is invalid
                    data: null
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-text2video
        label: Text-to-video
        source: "curl https://api.imarouter.com/v1/video/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"kling-v1-6\"\
          ,\n  \"prompt\": \"A cat playing with a ball of yarn in a sunny room\",\n  \"duration\": 5,\n  \"size\": \"16:9\"\
          ,\n  \"metadata\": {\n    \"mode\": \"std\",\n    \"cfg_scale\": 0.5\n  }\n}'"
      - lang: curl-image2video
        label: Image-to-video
        source: "curl https://api.imarouter.com/v1/video/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"kling-v1-6\"\
          ,\n  \"prompt\": \"A gentle camera pan revealing the scene\",\n  \"image\": \"https://example.com/reference.jpg\"\
          ,\n  \"duration\": 5,\n  \"size\": \"16:9\",\n  \"metadata\": {\n    \"mode\": \"std\",\n    \"cfg_scale\": 0.5\n\
          \  }\n}'"
      - lang: curl-image2video-head-tail
        label: First/last-frame image-to-video
        source: "curl https://api.imarouter.com/v1/video/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"kling-v2-5-turbo\"\
          ,\n  \"prompt\": \"Smooth transition between two scenes\",\n  \"image\": \"https://example.com/first_frame.jpg\"\
          ,\n  \"duration\": 5,\n  \"size\": \"16:9\",\n  \"metadata\": {\n    \"mode\": \"pro\",\n    \"image_tail\": \"\
          https://example.com/last_frame.jpg\"\n  }\n}'"
  /kling/v1/videos/text2video/{task_id}:
    get:
      tags:
      - Kling Video
      summary: Query Kling video task status (text/image modes)
      operationId: getKlingVideoTaskStatus
      description: 'Use the `task_id` returned by the Kling text-to-video or image-to-video submission interface to poll the
        task results.


        **Can also be queried via the following endpoint (generic): **

        - `GET /v1/video/generations/{task_id}`

        - `GET /v1/videos/{task_id}`


        **Serious Notice (Must Read)**

        - If the result resource URL such as `results.url`, `metadata.url` is returned after the query is successful, please
        download it immediately and persist it yourself.

        - The platform does not guarantee that the result resource URL will be accessible for a long time, and it will expire
        after about 30 days by default; do not treat the URL in the query result as a permanent storage address.'
      parameters:
      - name: task_id
        in: path
        required: true
        schema:
          type: string
        description: The task ID returned when creating the task.
      responses:
        '200':
          description: Query successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-get-kling-v1-videos-text2video-task-id
        label: Query Kling video task status (text/image modes)
        source: "curl https://api.imarouter.com/kling/v1/videos/text2video/task_202604270001 \\\n  --header 'Authorization:\
          \ Bearer YOUR_SECRET_TOKEN'"
  /kling/v1/videos/image2video/{task_id}:
    get:
      tags:
      - Kling Video
      summary: Get Kling image-to-video task status
      operationId: getKlingImage2VideoTaskStatus
      description: Poll a task created by `POST /kling/v1/videos/image2video` using the returned `task_id`. The response schema
        is shared with the text-to-video poll endpoint. The same task can also be queried via `GET /v1/video/generations/{task_id}`
        or `GET /v1/videos/{task_id}`.
      parameters:
      - name: task_id
        in: path
        required: true
        schema:
          type: string
        description: Task ID returned when the task was created.
      responses:
        '200':
          description: Query succeeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-get-kling-v1-videos-image2video-task-id
        label: Get Kling image-to-video task status
        source: "curl https://api.imarouter.com/kling/v1/videos/image2video/task_202604270001 \\\n  --header 'Authorization:\
          \ Bearer YOUR_SECRET_TOKEN'"
  /v1/video/generations#vidu:
    post:
      tags:
      - Vidu Video
      summary: Submit Vidu video task
      operationId: createViduVideoTask
      description: 'Vidu video generation endpoint (asynchronous task system, delayed settlement). After submission, `task_id`
        is returned, and the results are polled through `GET /v1/video/generations/{task_id}`.


        **Available endpoints (choose one of the two, the parameter format is the same): **

        | endpoint | description |

        |------|------|

        | `POST /v1/video/generations` | Generic video endpoint |

        | `POST /v1/videos` | OpenAI compatible endpoint |


        **Supported models:**

        - `viduq1` (fixed 1080P/5s)

        - `viduq2` (text-to-video, supports 540P-1080P)

        - `viduq2-pro` (image-to-video only, supports 540P-1080P)

        - `viduq2-turbo` (image-to-video only, supports 540P-1080P)

        - `viduq3-pro` (text-to-video / image-to-video, billed per second, supports 540P-1080P)

        - `viduq3-turbo` (text-to-video / image-to-video, billed per second, supports 540P-1080P)


        **Parameter description:**

        - `prompt`: required for text-to-video.

        - `images`: image URL array for image-to-video. Single image = reference image; two images = first and last frames.

        - `duration`: duration (seconds), default 5. viduq1 fixed 5s. viduq3 supports 1-16s.

        - `size`: aspect ratio, such as `16:9` (default), `9:16`, `1:1`.

        - `metadata.resolution`: resolution, `540p`, `720p`, `1080p` (default).


        **Billing Instructions:**

        - Delayed settlement mode: No fees will be deducted when submitting. After the task is completed, the settlement will
        be accurately based on the credits actually consumed by the upstream.

        - 1 credit = $0.005.


        **IMPORTANT NOTICE (MUST READ)**

        - Input URLs such as `images` are task input references, please confirm they are accessible when submitting.

        - The video URL returned after the task is completed is a short-term link hosted by the platform and will expire after
        about 30 days by default; please be sure to complete the download and archive within 30 days.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ViduVideoRequest'
            examples:
              viduq1_text2video:
                summary: viduq1 text-to-video (1080P/5s)
                value:
                  model: viduq1
                  prompt: A golden retriever running on a sunny beach with waves crashing in the background
              viduq2_text2video_720p:
                summary: viduq2 text-to-video (720P/5s)
                value:
                  model: viduq2
                  prompt: A cinematic drone shot above a quiet lake at sunrise
                  duration: 5
                  metadata:
                    resolution: 720p
              viduq2_text2video_1080p:
                summary: viduq2 text-to-video (1080P/8s)
                value:
                  model: viduq2
                  prompt: A time-lapse of clouds moving over a mountain landscape
                  duration: 8
                  metadata:
                    resolution: 1080p
              viduq2pro_img2video:
                summary: viduq2-pro image-to-video (single reference image)
                value:
                  model: viduq2-pro
                  prompt: The person slowly turns and smiles
                  images:
                  - https://example.com/reference.jpg
                  duration: 5
              viduq2pro_img2video_headtail:
                summary: viduq2-pro first and last frame image raw video (double image)
                value:
                  model: viduq2-pro
                  prompt: Smooth transition from day to night
                  images:
                  - https://example.com/first_frame.jpg
                  - https://example.com/last_frame.jpg
                  duration: 5
              viduq3pro_text2video:
                summary: viduq3-pro text-to-video (720P/10s)
                value:
                  model: viduq3-pro
                  prompt: A cat playing with a ball of yarn in a cozy room with warm lighting
                  duration: 10
                  metadata:
                    resolution: 720p
              viduq3turbo_text2video:
                summary: viduq3-turbo text-to-video (1080P/5s)
                value:
                  model: viduq3-turbo
                  prompt: Aerial view of a city skyline at sunset
                  duration: 5
                  metadata:
                    resolution: 1080p
              viduq3pro_img2video:
                summary: viduq3-pro image-to-video
                value:
                  model: viduq3-pro
                  prompt: The flowers gently sway in the breeze
                  images:
                  - https://example.com/garden.jpg
                  duration: 8
                  metadata:
                    resolution: 720p
      responses:
        '200':
          description: Task submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskResponse'
              examples:
                success:
                  summary: Submission successful
                  value:
                    id: task_xxxxxxxxxxxxx
                    task_id: task_xxxxxxxxxxxxx
                    object: video
                    model: viduq3-pro
                    status: ''
                    progress: 0
                    created_at: 1712345678
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '400':
          description: Parameter error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                model_not_supported:
                  summary: Text-only input sent to an image-to-video-only model
                  value:
                    error:
                      code: ''
                      message: model viduq2-pro only supports image-to-video, please provide images
                      type: new_api_error
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-viduq1-text2video
        label: viduq1 text-to-video (1080P/5s)
        source: "curl https://api.imarouter.com/v1/video/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"viduq1\",\n\
          \  \"prompt\": \"A golden retriever running on a sunny beach with waves crashing in the background\"\n}'"
      - lang: curl-viduq2-text2video-720p
        label: viduq2 text-to-video (720P/5s)
        source: "curl https://api.imarouter.com/v1/video/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"viduq2\",\n\
          \  \"prompt\": \"A cinematic drone shot above a quiet lake at sunrise\",\n  \"duration\": 5,\n  \"metadata\": {\n\
          \    \"resolution\": \"720p\"\n  }\n}'"
      - lang: curl-viduq2-text2video-1080p
        label: viduq2 text-to-video (1080P/8s)
        source: "curl https://api.imarouter.com/v1/video/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"viduq2\",\n\
          \  \"prompt\": \"A time-lapse of clouds moving over a mountain landscape\",\n  \"duration\": 8,\n  \"metadata\"\
          : {\n    \"resolution\": \"1080p\"\n  }\n}'"
      - lang: curl-viduq2pro-img2video
        label: viduq2-pro image-to-video (single reference image)
        source: "curl https://api.imarouter.com/v1/video/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"viduq2-pro\"\
          ,\n  \"prompt\": \"The person slowly turns and smiles\",\n  \"images\": [\n    \"https://example.com/reference.jpg\"\
          \n  ],\n  \"duration\": 5\n}'"
      - lang: curl-viduq2pro-img2video-headtail
        label: viduq2-pro first and last frame image raw video (double image)
        source: "curl https://api.imarouter.com/v1/video/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"viduq2-pro\"\
          ,\n  \"prompt\": \"Smooth transition from day to night\",\n  \"images\": [\n    \"https://example.com/first_frame.jpg\"\
          ,\n    \"https://example.com/last_frame.jpg\"\n  ],\n  \"duration\": 5\n}'"
      - lang: curl-viduq3pro-text2video
        label: viduq3-pro text-to-video (720P/10s)
        source: "curl https://api.imarouter.com/v1/video/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"viduq3-pro\"\
          ,\n  \"prompt\": \"A cat playing with a ball of yarn in a cozy room with warm lighting\",\n  \"duration\": 10,\n\
          \  \"metadata\": {\n    \"resolution\": \"720p\"\n  }\n}'"
      - lang: curl-viduq3turbo-text2video
        label: viduq3-turbo text-to-video (1080P/5s)
        source: "curl https://api.imarouter.com/v1/video/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"viduq3-turbo\"\
          ,\n  \"prompt\": \"Aerial view of a city skyline at sunset\",\n  \"duration\": 5,\n  \"metadata\": {\n    \"resolution\"\
          : \"1080p\"\n  }\n}'"
      - lang: curl-viduq3pro-img2video
        label: viduq3-pro image-to-video
        source: "curl https://api.imarouter.com/v1/video/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"viduq3-pro\"\
          ,\n  \"prompt\": \"The flowers gently sway in the breeze\",\n  \"images\": [\n    \"https://example.com/garden.jpg\"\
          \n  ],\n  \"duration\": 8,\n  \"metadata\": {\n    \"resolution\": \"720p\"\n  }\n}'"
  /v1/video/generations#pixverse:
    post:
      tags:
      - Pixverse Video
      summary: Create Pixverse video task
      operationId: createPixverseVideoTask
      description: 'Pixverse video generation endpoint using asynchronous tasks.


        **Actual request path:** `POST /v1/video/generations`


        The same request body is also compatible with `POST /v1/videos`. This page only covers the Pixverse model family to
        avoid mixing it with MiniMax, Vidu, Kling, or other shared endpoint families.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PixverseVideoCreateRequest'
            examples:
              pixverse_c1_text_720p:
                summary: Pixverse C1 text 720p
                value:
                  model: pixverse-c1
                  prompt: A cinematic city street at night with neon reflections
                  duration: 5
                  size: '16:9'
                  quality: 720p
              pixverse_v6_text_audio:
                summary: Pixverse V6 text 1080p with audio
                value:
                  model: pixverse-v6
                  prompt: A slow push-in shot of a product on a clean studio table
                  duration: 5
                  size: '9:16'
                  quality: 1080p
                  metadata:
                    audio: true
      responses:
        '200':
          description: Pixverse video task accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskResponse'
              examples:
                success:
                  summary: Pixverse returns task ID
                  value:
                    id: task_pixverse_202605220001
                    task_id: task_pixverse_202605220001
                    object: video
                    model: pixverse-v6
                    status: in_progress
                    progress: 0
                    created_at: 1779400000
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-pixverse-c1-text-720p
        label: Pixverse C1 text 720p
        source: "curl https://api.imarouter.com/v1/video/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"pixverse-c1\"\
          ,\n  \"prompt\": \"A cinematic city street at night with neon reflections\",\n  \"duration\": 5,\n  \"size\": \"\
          16:9\",\n  \"quality\": \"720p\"\n}'"
      - lang: curl-pixverse-v6-text-audio
        label: Pixverse V6 text 1080p with audio
        source: "curl https://api.imarouter.com/v1/video/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"pixverse-v6\"\
          ,\n  \"prompt\": \"A slow push-in shot of a product on a clean studio table\",\n  \"duration\": 5,\n  \"size\":\
          \ \"9:16\",\n  \"quality\": \"1080p\",\n  \"metadata\": {\n    \"audio\": true\n  }\n}'"
  /v1/video/generations/{task_id}#vidu:
    get:
      tags:
      - Vidu Video
      summary: Query Vidu video task status
      operationId: getViduVideoTaskStatus
      description: 'Poll the task results using the `task_id` returned by the submission interface.


        You can also query via `GET /v1/videos/{task_id}`.


        When `status` is `completed`, `metadata.url` contains the video download link.


        **Serious Notice (Must Read)**

        - If the result resource URL such as `results.url`, `metadata.url` is returned after the query is successful, please
        download it immediately and persist it yourself.

        - The platform does not guarantee that the result resource URL will be accessible for a long time, and it will expire
        after about 30 days by default; do not treat the URL in the query result as a permanent storage address.'
      parameters:
      - name: task_id
        in: path
        required: true
        schema:
          type: string
        description: The task ID returned when creating the task.
      responses:
        '200':
          description: Query successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskResponse'
              examples:
                processing:
                  summary: Processing
                  value:
                    id: task_xxxxxxxxxxxxx
                    task_id: task_xxxxxxxxxxxxx
                    object: video
                    model: viduq3-pro
                    status: in_progress
                    progress: 45
                    created_at: 1712345678
                completed:
                  summary: Finish
                  value:
                    id: task_xxxxxxxxxxxxx
                    task_id: task_xxxxxxxxxxxxx
                    object: video
                    model: viduq3-pro
                    status: completed
                    progress: 100
                    created_at: 1712345678
                    completed_at: 1712345778
                    metadata:
                      url: https://video.cf.vidu.com/example/video.mp4
                failed:
                  summary: fail
                  value:
                    id: task_xxxxxxxxxxxxx
                    task_id: task_xxxxxxxxxxxxx
                    object: video
                    model: viduq3-pro
                    status: failed
                    progress: 0
                    created_at: 1712345678
                    error:
                      message: content moderation failed
                      code: MODERATION_FAILED
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-get-v1-video-generations-task-id
        label: Query Vidu video task status
        source: "curl https://api.imarouter.com/v1/video/generations/task_202604270001 \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN'"
  /v1/video/generations/{task_id}#pixverse:
    get:
      tags:
      - Pixverse Video
      summary: Query Pixverse video task
      operationId: getPixverseVideoTaskStatus
      description: 'Query a Pixverse video asynchronous task submitted through `POST /v1/video/generations`.


        **Actual request path:** `GET /v1/video/generations/{task_id}`'
      parameters:
      - name: task_id
        in: path
        required: true
        schema:
          type: string
        description: Task ID returned by the create endpoint.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskResponse'
              examples:
                completed:
                  summary: Pixverse success
                  value:
                    id: task_pixverse_202605220001
                    task_id: task_pixverse_202605220001
                    object: video
                    model: pixverse-v6
                    status: completed
                    progress: 100
                    created_at: 1779400000
                    completed_at: 1779400060
                    metadata:
                      url: https://cdn.example.com/video/pixverse-v6.mp4
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '404':
          description: Task not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-get-v1-video-generations-task-id
        label: Query Pixverse video task
        source: "curl https://api.imarouter.com/v1/video/generations/task_202604270001 \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN'"
  /v1/video/generations:
    post:
      tags:
      - MiniMax Video
      summary: Submit MiniMax video task
      description: "MiniMax video generation (asynchronous task system). After submission, `task_id` is returned, and the\
        \ results are polled through `GET /v1/video/generations/{task_id}`.\n\n**Submission endpoint:** `POST /v1/video/generations`\n\
        \n**Supported models:**\n- `MiniMax-Hailuo-02`\n- `MiniMax-Hailuo-2.3`\n- `MiniMax-Hailuo-2.3-Fast`\n\n**Constraints:**\n\
        - `MiniMax-Hailuo-2.3-Fast` supports image-to-video only and requires `metadata.first_frame_image`\n- `duration` only\
        \ supports `6` or `10`\n- `MiniMax-Hailuo-02` supports:\n- `512p`: `6/10s`\n- `768p`: `6/10s`\n- `1080p`: `only 6s`\n\
        - `MiniMax-Hailuo-2.3` supports:\n- `768p`: `6/10s`\n- `1080p`: `only 6s`\n- `MiniMax-Hailuo-2.3-Fast` supports:\n\
        - `768p`: `6/10s`\n- `1080p`: `only 6s`\n- and must pass `metadata.first_frame_image`\n\n**IMPORTANT NOTICE (MUST\
        \ READ)**\n- Input URLs such as `metadata.first_frame_image` are task input references, please confirm they are accessible\
        \ when submitting.\n\n**Call example:**\n```bash\ncurl -X POST https://open-route.fashionlabs.cn/v1/video/generations\
        \ \\\n  -H \"Authorization: Bearer sk-xxxx\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"model\":\"MiniMax-Hailuo-2.3\"\
        ,\"prompt\":\"A cat playing\",\"duration\":6,\"size\":\"1080p\"}'\n```"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MiniMaxVideoGenerationRequest'
            examples:
              hailuo_02_text2video:
                summary: MiniMax-Hailuo-02 text-to-video
                value:
                  model: MiniMax-Hailuo-02
                  prompt: A cat playing with a ball of yarn
              text2video:
                summary: MiniMax text-to-video
                value:
                  model: MiniMax-Hailuo-2.3
                  prompt: A cat playing with a ball of yarn
              hailuo_img2video:
                summary: Hailuo image-to-video (metadata parameter)
                value:
                  model: MiniMax-Hailuo-2.3
                  prompt: A person slowly walking forward
                  metadata:
                    first_frame_image: https://example.com/photo.jpeg
              hailuo_fast_img2video:
                summary: Hailuo-2.3-Fast image-to-video only
                value:
                  model: MiniMax-Hailuo-2.3-Fast
                  prompt: A person slowly walking forward
                  size: 1080p
                  metadata:
                    first_frame_image: https://example.com/photo.jpeg
      responses:
        '200':
          description: Task has been submitted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskResponse'
              examples:
                submitted:
                  value:
                    id: task_abc123
                    task_id: task_abc123
                    object: video
                    model: MiniMax-Hailuo-2.3
                    status: ''
                    progress: 0
                    created_at: 1772037755
        '400':
          description: Parameter errors (e.g. model capability or resolution mismatch)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                hailuo_fast_text2video_rejected:
                  summary: Hailuo-2.3-Fast rejects text-only input (image-to-video only)
                  value:
                    code: '500'
                    message: 'hailuo api error: model MiniMax-Hailuo-2.3-Fast does not support Text-to-Video mode'
                    data: null
                hailuo_fast_invalid_resolution:
                  summary: Hailuo-2.3-Fast uses 720p rejected
                  value:
                    code: '2013'
                    message: 'hailuo api error: invalid params, model MiniMax-Hailuo-2.3-Fast does not support resolution
                      720P, supported resolutions: 768P, 1080P'
                    data: null
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-hailuo-02-text2video
        label: MiniMax-Hailuo-02 text-to-video
        source: "curl https://api.imarouter.com/v1/video/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"MiniMax-Hailuo-02\"\
          ,\n  \"prompt\": \"A cat playing with a ball of yarn\"\n}'"
      - lang: curl-text2video
        label: MiniMax text-to-video
        source: "curl https://api.imarouter.com/v1/video/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"MiniMax-Hailuo-2.3\"\
          ,\n  \"prompt\": \"A cat playing with a ball of yarn\"\n}'"
      - lang: curl-hailuo-img2video
        label: Hailuo image-to-video (metadata parameter)
        source: "curl https://api.imarouter.com/v1/video/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"MiniMax-Hailuo-2.3\"\
          ,\n  \"prompt\": \"A person slowly walking forward\",\n  \"metadata\": {\n    \"first_frame_image\": \"https://example.com/photo.jpeg\"\
          \n  }\n}'"
      - lang: curl-hailuo-fast-img2video
        label: Hailuo-2.3-Fast image-to-video only
        source: "curl https://api.imarouter.com/v1/video/generations \\\n  --request POST \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"MiniMax-Hailuo-2.3-Fast\"\
          ,\n  \"prompt\": \"A person slowly walking forward\",\n  \"size\": \"1080p\",\n  \"metadata\": {\n    \"first_frame_image\"\
          : \"https://example.com/photo.jpeg\"\n  }\n}'"
  /v1/videos#minimax:
    post:
      tags:
      - MiniMax Video
      summary: Submit MiniMax video task (OpenAI compatible endpoint)
      description: 'OpenAI compatible submission endpoint for MiniMax video generation. This document is used to display the
        MiniMax request body of `POST /v1/videos` under the MiniMax video category.


        **Actual request path:** `POST /v1/videos`


        **Supported models:**

        - `MiniMax-Hailuo-02`

        - `MiniMax-Hailuo-2.3`

        - `MiniMax-Hailuo-2.3-Fast`


        **Constraints:**

        - `MiniMax-Hailuo-2.3-Fast` supports image-to-video only and requires `metadata.first_frame_image`

        - `duration` only supports `6` or `10`

        - `size` is checked according to model capabilities: `512p`, `768p`, `1080p`


        **IMPORTANT NOTICE (MUST READ)**

        - Input URLs such as `metadata.first_frame_image` are task input references, please confirm they are accessible when
        submitting.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MiniMaxVideosCreateRequest'
            examples:
              hailuo_02_text2video:
                summary: MiniMax-Hailuo-02 text-to-video
                value:
                  model: MiniMax-Hailuo-02
                  prompt: A cat playing with a ball of yarn
                  duration: 6
                  size: 1080p
              hailuo_23_text2video:
                summary: MiniMax-Hailuo-2.3 text-to-video
                value:
                  model: MiniMax-Hailuo-2.3
                  prompt: A cinematic drone shot above a quiet lake at sunrise
                  duration: 6
                  size: 1080p
              hailuo_fast_img2video:
                summary: MiniMax-Hailuo-2.3-Fast image-to-video
                value:
                  model: MiniMax-Hailuo-2.3-Fast
                  prompt: A gentle camera movement over a cup of tea
                  duration: 6
                  size: 1080p
                  metadata:
                    first_frame_image: https://example.com/photo.jpeg
      responses:
        '200':
          description: Task has been submitted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskResponse'
        '400':
          description: Parameter errors (e.g. model capability or resolution mismatch)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-hailuo-02-text2video
        label: MiniMax-Hailuo-02 text-to-video
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"MiniMax-Hailuo-02\",\n  \"prompt\"\
          : \"A cat playing with a ball of yarn\",\n  \"duration\": 6,\n  \"size\": \"1080p\"\n}'"
      - lang: curl-hailuo-23-text2video
        label: MiniMax-Hailuo-2.3 text-to-video
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"MiniMax-Hailuo-2.3\",\n  \"prompt\"\
          : \"A cinematic drone shot above a quiet lake at sunrise\",\n  \"duration\": 6,\n  \"size\": \"1080p\"\n}'"
      - lang: curl-hailuo-fast-img2video
        label: MiniMax-Hailuo-2.3-Fast image-to-video
        source: "curl https://api.imarouter.com/v1/videos \\\n  --request POST \\\n  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'\
          \ \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"model\": \"MiniMax-Hailuo-2.3-Fast\",\n \
          \ \"prompt\": \"A gentle camera movement over a cup of tea\",\n  \"duration\": 6,\n  \"size\": \"1080p\",\n  \"\
          metadata\": {\n    \"first_frame_image\": \"https://example.com/photo.jpeg\"\n  }\n}'"
  /v1/video/generations/{task_id}:
    get:
      tags:
      - MiniMax Video
      summary: Query MiniMax video task status
      description: 'Poll the task results using the `task_id` returned after `/v1/video/generations` is submitted.

        Authentication: The request header must contain `Authorization: Bearer sk-...`.

        When the task is completed, the `status` in the response is `succeeded` and the `results` array contains the video
        URL.

        **Serious Notice (Must Read)**

        - If the result resource URL such as `results.url`, `metadata.url` is returned after the query is successful, please
        download it immediately and persist it yourself.

        - The platform does not guarantee that the result resource URL will be accessible for a long time, and it will expire
        after about 30 days by default; do not treat the URL in the query result as a permanent storage address.'
      operationId: getMiniMaxVideoTaskStatus
      parameters:
      - name: task_id
        in: path
        required: true
        schema:
          type: string
        description: The task ID returned when creating the task.
      responses:
        '200':
          description: Query successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskResponse'
              examples:
                processing:
                  summary: Processing
                  value:
                    id: task_xxxxxxxxxxxxx
                    task_id: task_xxxxxxxxxxxxx
                    object: video
                    model: MiniMax-Hailuo-2.3
                    status: in_progress
                    progress: 30
                    created_at: 1712345678
                completed:
                  summary: Finish
                  value:
                    id: task_xxxxxxxxxxxxx
                    task_id: task_xxxxxxxxxxxxx
                    object: video
                    model: MiniMax-Hailuo-2.3
                    status: completed
                    progress: 100
                    created_at: 1712345678
                    completed_at: 1712345778
                    metadata:
                      url: https://cdn.example.com/video.mp4
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-apifox-status: released
      x-codeSamples:
      - lang: curl-get-v1-video-generations-task-id
        label: Query MiniMax video task status
        source: "curl https://api.imarouter.com/v1/video/generations/task_202604270001 \\\n  --header 'Authorization: Bearer\
          \ YOUR_SECRET_TOKEN'"
components:
  parameters:
    AuthorizationHeader:
      name: Authorization
      in: header
      required: true
      schema:
        type: string
      example: Bearer sk-xxxxxxxxxxxxxxxx
      description: Access token, the format is fixed to `Bearer sk-...`.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: sk-xxxx
      description: 'Put SK in the request header:

        `Authorization: Bearer sk-xxxx`'
  schemas:
    AssetGroupCreateRequest:
      type: object
      required:
      - name
      properties:
        name:
          type: string
          maxLength: 64
          description: Group name (user-side display name).
          example: marketing-assets
        description:
          type: string
          maxLength: 300
          description: Group description (optional).
          example: Material grouping-marketing
        group_type:
          type: string
          default: AIGC
          description: Grouping type. Currently `AIGC` is used by default.
          example: AIGC
        project_name:
          type: string
          default: default
          description: Project namespace. Defaults to `default` when not passed.
          example: default
        model:
          type: string
          enum:
          - ima-pro-upload
          - ima-pro-upload-cn
          - seedance-upload
          - seedance-upload-cn
          description: 'Optional, asset model name. Serious reminder: Be sure to pass `model` explicitly to distinguish domestic
            and overseas portrait protocols to avoid mismatch between material protocols and video model channels.

            - `ima-pro-upload`: domestic portrait (default, history compatible)

            - `ima-pro-upload-cn`: domestic portrait, adapted to `seedance-2.0-cn`, `seedance-2.0-fast-cn`

            - `seedance-upload`: overseas portraits, adapted to `seedance-2.0`, `seedance-2.0-fast`

            - Do not mix domestic/overseas asset protocols; otherwise `asset://...` may fail to be called later when used
            for video tasks.'
          example: ima-pro-upload-cn
    AssetGroupListRequest:
      type: object
      properties:
        filters:
          type: object
          properties:
            name:
              type: string
            group_ids:
              type: array
              items:
                type: string
            group_type:
              type: string
              default: AIGC
              description: Group type filter, usually `AIGC`.
        page_number:
          type: integer
          minimum: 1
          default: 1
          description: Page number (starting from 1).
        page_size:
          type: integer
          minimum: 1
          maximum: 100
          default: 20
          description: Number per page (1-100).
        sort_by:
          type: string
          enum:
          - CreateTime
          - UpdateTime
          description: Sorting field (strictly case sensitive).
        sort_order:
          type: string
          enum:
          - Asc
          - Desc
          description: Sort direction (strictly case sensitive).
        project_name:
          type: string
          default: default
          description: Project namespace. Untransmitted items will be handled as default items.
        model:
          type: string
          enum:
          - ima-pro-upload
          - ima-pro-upload-cn
          - seedance-upload
          - seedance-upload-cn
          description: 'Optional, asset model name. Serious reminder: Be sure to pass `model` explicitly to distinguish domestic
            and overseas portrait protocols to avoid mismatch between material protocols and video model channels.

            - `ima-pro-upload`: domestic portrait (default, history compatible)

            - `ima-pro-upload-cn`: domestic portrait, adapted to `seedance-2.0-cn`, `seedance-2.0-fast-cn`

            - `seedance-upload`: overseas portraits, adapted to `seedance-2.0`, `seedance-2.0-fast`

            - Do not mix domestic/overseas asset protocols; otherwise `asset://...` may fail to be called later when used
            for video tasks.'
          example: ima-pro-upload-cn
    AssetCreateRequest:
      type: object
      required:
      - group_id
      - url
      properties:
        group_id:
          type: string
          description: Group ID (available with `/v1/assets/group/list`).
          example: grp_123456
        url:
          type: string
          format: uri
          description: Publicly accessible asset URL. Please confirm that it is accessible before calling, and it is recommended
            to persist the original material by yourself; the 30-day expiration rule only applies to the result resource URL
            returned by the interface.
          example: https://example.com/image.png
        name:
          type: string
          maxLength: 64
          description: Material name (optional).
          example: cover-image
        asset_type:
          type: string
          default: Image
          enum:
          - Image
          - Video
          - Audio
          description: 'Material type, default is `Image`.

            When `asset_type=Audio`, the audio duration must be between `1.8s` and `15.2s` (closed interval), otherwise `InvalidParameter.DurationTooLong`
            is returned.'
          example: Image
        project_name:
          type: string
          default: default
          description: Project namespace. Defaults to `default` when not passed.
          example: default
        billing_token_id:
          type: integer
          description: 'Optional, specify the token id used for deduction for this upload.

            When not passed: By default, the token corresponding to SK in the current request header `Authorization` is used.

            Constraints: Must belong to the current user, status is enabled, and the balance is sufficient.'
          example: 3
        model:
          type: string
          enum:
          - ima-pro-upload
          - ima-pro-upload-cn
          - seedance-upload
          - seedance-upload-cn
          description: 'Optional, asset model name. This model price will be used first when billing; if not uploaded, it
            will default to `ima-pro-upload`.

            **Serious reminder**: When creating portrait materials/material protocols, be sure to explicitly pass `model`
            to distinguish between domestic and overseas channels to avoid mismatch between material protocols and video model
            channels.

            - `ima-pro-upload`: domestic portrait (default, history compatible)

            - `ima-pro-upload-cn`: domestic portrait, adapted to `seedance-2.0-cn`, `seedance-2.0-fast-cn`

            - `seedance-upload`: overseas portraits, adapted to `seedance-2.0`, `seedance-2.0-fast`

            - Do not mix domestic/overseas asset protocols; otherwise `asset://...` may fail to be called later when used
            for video tasks.'
          example: ima-pro-upload-cn
    AssetListRequest:
      type: object
      properties:
        filters:
          type: object
          properties:
            group_ids:
              type: array
              items:
                type: string
            group_type:
              type: string
              default: AIGC
              description: Group type filter, usually `AIGC`.
            statuses:
              type: array
              items:
                type: string
                enum:
                - Active
                - Failed
                - Processing
            name:
              type: string
        page_number:
          type: integer
          minimum: 1
          default: 1
        page_size:
          type: integer
          minimum: 1
          maximum: 100
          default: 20
        sort_by:
          type: string
          enum:
          - CreateTime
          - UpdateTime
          - GroupId
          description: Sorting field (strictly case sensitive).
        model:
          type: string
          enum:
          - ima-pro-upload
          - ima-pro-upload-cn
          - seedance-upload
          - seedance-upload-cn
          description: 'Optional, asset model name. Serious reminder: Be sure to pass `model` explicitly to distinguish domestic
            and overseas portrait protocols to avoid mismatch between material protocols and video model channels.

            - `ima-pro-upload`: domestic portrait (default, history compatible)

            - `ima-pro-upload-cn`: domestic portrait, adapted to `seedance-2.0-cn`, `seedance-2.0-fast-cn`

            - `seedance-upload`: overseas portraits, adapted to `seedance-2.0`, `seedance-2.0-fast`

            - Do not mix domestic/overseas asset protocols; otherwise `asset://...` may fail to be called later when used
            for video tasks.'
          example: ima-pro-upload-cn
        sort_order:
          type: string
          enum:
          - Asc
          - Desc
          description: Sort direction (strictly case sensitive).
        project_name:
          type: string
          default: default
          description: Project namespace. Defaults to `default` when not passed.
    AssetItem:
      type: object
      properties:
        Id:
          type: string
        Name:
          type: string
        URL:
          type: string
        GroupId:
          type: string
        AssetType:
          type: string
        Status:
          type: string
        ProjectName:
          type: string
        CreateTime:
          type: string
        UpdateTime:
          type: string
    AssetGroupItem:
      type: object
      properties:
        Id:
          type: string
        Name:
          type: string
        Title:
          type: string
        Description:
          type: string
        GroupType:
          type: string
        ProjectName:
          type: string
        CreateTime:
          type: string
        UpdateTime:
          type: string
    AssetIdResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          type: object
          properties:
            Id:
              type: string
    AssetGroupResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          $ref: '#/components/schemas/AssetGroupItem'
    AssetGetResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          $ref: '#/components/schemas/AssetItem'
    AssetGroupListResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          type: object
          properties:
            Items:
              type: array
              items:
                $ref: '#/components/schemas/AssetGroupItem'
            TotalCount:
              type: integer
            PageNumber:
              type: integer
            PageSize:
              type: integer
    AssetListResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          type: object
          properties:
            Items:
              type: array
              items:
                $ref: '#/components/schemas/AssetItem'
            TotalCount:
              type: integer
            PageNumber:
              type: integer
            PageSize:
              type: integer
    AssetQuotaResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          type: object
          properties:
            enabled:
              type: boolean
            max_count_per_user:
              type: integer
            current_count:
              type: integer
    ImaProSubtitleEraseRequest:
      type: object
      required:
      - model
      - video_url
      additionalProperties: false
      description: Doubao video subtitle erase task request parameters. Use `doubao-video-subtitle-erase-cn` for the domestic
        model and `doubao-video-subtitle-erase` for the overseas model.
      properties:
        model:
          type: string
          enum:
          - doubao-video-subtitle-erase-cn
          description: Model name. `doubao-video-subtitle-erase-cn` is the domestic model, and `doubao-video-subtitle-erase`
            is the overseas model.
          example: doubao-video-subtitle-erase-cn
        video_url:
          type: string
          format: uri
          description: The video URL to be processed. The protocol must be `http` or `https`.
          example: https://example.com/input.mp4
    SeedanceContentsGenerationTaskRequest:
      type: object
      title: Seedance contents video task request
      description: 'Seedance 2.0 contents task request body. Use this schema only for `POST /api/v1/contents/generations/tasks`;
        do not mix it with the OpenAI-compatible `/v1/videos` request body.


        Image, video, and audio fields must use public `https://...` URLs.'
      required:
      - model
      - content
      additionalProperties: false
      properties:
        model:
          type: string
          enum:
          - seedance-2.0
          - seedance-2.0-fast
          - seedance-2.0-cn
          - seedance-2.0-fast-cn
          description: Target model. Only `seedance-2.0`, `seedance-2.0-fast`, `seedance-2.0-cn`, and `seedance-2.0-fast-cn`
            are supported.
        content:
          type: array
          minItems: 1
          description: Input content array. Supports `text`, `image_url`, `video_url`, and `audio_url`. Text-to-video, first-frame,
            first/last-frame, and multimodal reference modes are mutually exclusive.
          items:
            $ref: '#/components/schemas/SeedanceContentsGenerationContentItem'
        return_last_frame:
          type: boolean
          default: false
          description: Whether to return the generated video's last PNG frame after success. Useful for chained generation.
        generate_audio:
          type: boolean
          default: true
          description: Whether to generate synchronized audio. `true` creates an audio video; `false` creates a silent video.
            Do not send `reference_audio` when `generate_audio=false`.
        resolution:
          type: string
          enum:
          - 480p
          - 720p
          - 1080p
          description: 'Output resolution. Allowed values: `480p`, `720p`, `1080p`; Fast models do not support `1080p`.'
        ratio:
          type: string
          enum:
          - '16:9'
          - '4:3'
          - '1:1'
          - '3:4'
          - '9:16'
          - '21:9'
          - adaptive
          description: Output aspect ratio. `adaptive` lets the model choose the best ratio based on input.
        duration:
          type: integer
          minimum: 4
          maximum: 15
          default: 5
          description: Output duration in seconds. Send an integer from `4` to `15` inclusive.
        seed:
          type: integer
          format: int64
          minimum: -1
          maximum: 4294967295
          default: -1
          description: Random seed. `-1` or omission means random; the same seed only makes results similar, not identical.
    SeedanceContentsGenerationContentItem:
      type: object
      title: Seedance contents input item
      description: One contents input item. `type` determines which one of `text`, `image_url`, `video_url`, or `audio_url`
        should be provided.
      required:
      - type
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
          - text
          - image_url
          - video_url
          - audio_url
          description: Input type. `text` is a prompt, `image_url` is an image URL, `video_url` is a reference video URL,
            and `audio_url` is a reference audio URL.
        text:
          type: string
          minLength: 1
          description: Text prompt. Provide only when `type=text`; keep it under about 1000 words.
        image_url:
          $ref: '#/components/schemas/SeedanceContentsGenerationURLField'
        video_url:
          $ref: '#/components/schemas/SeedanceContentsGenerationURLField'
        audio_url:
          $ref: '#/components/schemas/SeedanceContentsGenerationURLField'
        role:
          type: string
          enum:
          - first_frame
          - last_frame
          - reference_image
          - reference_video
          - reference_audio
          description: Media role. Images support `first_frame`, `last_frame`, or `reference_image`; video must use `reference_video`;
            audio must use `reference_audio`. First/last-frame mode and multimodal reference mode cannot be mixed.
    SeedanceContentsGenerationURLField:
      type: object
      title: Seedance contents HTTPS URL
      required:
      - url
      additionalProperties: false
      properties:
        url:
          type: string
          format: uri
          pattern: ^https://.+
          description: Public HTTPS URL. Image, video, and audio media are submitted in this URL shape.
    ImaProVideoCreateRequest:
      type: object
      title: Seedance video (seedance-2.0 / fast / cn)
      required:
      - model
      additionalProperties: false
      description: '7 input combinations (consistent with server behavior):

        1. Text (`prompt` required)

        2. Text + image (`images`, `prompt` optional)

        3. Text + video (`metadata.reference_video_urls`, `prompt` optional)

        4. Text + image + audio (`images` + `metadata.reference_audio_urls`, `prompt` optional)

        5. Text + image + video (`images` + `metadata.reference_video_urls`, `prompt` optional)

        6. Text + video + audio (`metadata.reference_video_urls` + `metadata.reference_audio_urls`, `prompt` optional)

        7. Text + image + video + audio (`images` + `metadata.reference_video_urls` + `metadata.reference_audio_urls`, `prompt`
        optional)

        Image semantic supplement:

        - Single images and multiple images are processed according to `reference_image` semantics, and `first_frame` / `last_frame`
        are not automatically inferred.'
      properties:
        model:
          type: string
          enum:
          - seedance-2.0
          - seedance-2.0-fast
          - seedance-2.0-cn
          - seedance-2.0-fast-cn
          - ima-pro
          - ima-pro-fast
          description: 'target model.

            - `seedance-2.0`: Seedance standard version (overseas)

            - `seedance-2.0-fast`: Seedance fast version (overseas)

            - `seedance-2.0-cn`: Seedance standard version (domestic)

            - `seedance-2.0-fast-cn`: Seedance fast version (domestic)

            - ~~`ima-pro`~~ (overseas channel historical alias, expired; for backward compatibility, please use seedance-2.0
            / seedance-2.0-cn instead)

            - ~~`ima-pro-fast`~~ (Historical alias for overseas channels, expired; for backward compatibility, please use
            seedance-2.0-fast / seedance-2.0-fast-cn instead)'
        prompt:
          type: string
          minLength: 1
          description: 'Main prompt word. Only the "Text" combination is required; the remaining 6 combinations are optional.

            Supports both Chinese and English; it is recommended that Chinese should not exceed 500 words and English should
            not exceed 1,000 words.'
        images:
          type: array
          description: 'Image URL array (supports multiple images).

            **Important Tip**: Before uploading, please ensure that the URL is accessible when called; the 30-day expiration
            rule only applies to the result resource URL returned by the interface.

            Two types of URLs are supported:

            - Publicly accessible URL (`https://...`)

            - Asset library protocol URL (`asset://asset-...`)

            Requirements for passing in a single image:

            - Format: `jpeg`, `png`, `webp`, `bmp`, `tiff`, `gif`

            - Aspect ratio (width/height): `(0.4,2.5)`

            - Width, height and length (px): `(300,6000)`

            -Single image size: `<30MB`

            - Total request body size: `<=64MB`

            - Do not use Base64 encoding for large files. It is recommended to use accessible URLs.'
          items:
            type: string
            format: uri
        input_reference:
          type: string
          format: uri
          description: 'The URL of the hidden image (only takes effect when `images` is not passed).

            **Important note**: This link is for task submission, please confirm that it is accessible before submitting;
            the 30-day expiration rule only applies to the result resource URL returned by the interface, and it is recommended
            that the output resource be persisted in time after being received.

            Supports `https://...` and `asset://asset-...`.

            Image input constraints are consistent with `images` single image requirements.'
        duration:
          type: integer
          minimum: 4
          maximum: 15
          default: 5
          description: 'Desired duration (seconds).

            Allowed range: `4-15` seconds (inclusive).

            Recommended values: `5`, `10`, `15`.'
        seconds:
          type: string
          pattern: ^(?:[4-9]|1[0-5])$
          description: 'Duration in string form (seconds), allowed range: `"4"` ~ `"15"`.'
        size:
          type: string
          description: 'Dimensions (e.g. `1280x720`), used to derive scale and resolution.

            Constraint: `WxH` must be normalizable to the exact supported ratios (e.g. `16:9`, `9:16`, `1:1`, `4:3`, `3:4`,
            `21:9`).

            Note: `854x480` will be normalized to `427:240`, not exactly `16:9`, and will be rejected as `ratio is invalid:
            427:240`. 480p 16:9 It is recommended to use `848x480` or pass `metadata.resolution=480p` directly.'
        metadata:
          type: object
          additionalProperties: true
          description: Advanced parameters (optional).
          properties:
            aspect_ratio:
              type: string
              enum:
              - '16:9'
              - '4:3'
              - '1:1'
              - '3:4'
              - '9:16'
              - '21:9'
              - adaptive
              description: 'aspect ratio.

                Support: `16:9`, `4:3`, `1:1`, `3:4`, `9:16`, `21:9`, `adaptive`.

                - `adaptive`: Automatically select the most appropriate aspect ratio based on input.'
              example: '16:9'
            resolution:
              type: string
              enum:
              - 480p
              - 720p
              - 1080p
              description: 'Resolution level (optional).

                **Divided by model:**

                - `ima-pro` / `seedance-2.0`: supports `480p`, `720p`, `1080p`; measured text-to-video 1080p requests can
                be submitted and processed.

                - `ima-pro-fast` / `seedance-2.0-fast`: text-to-video recommends using `480p` or `720p`; explicitly passing
                `1080p` for text-to-video will be returned by the upstream with `Invalid parameters`.

                - If in doubt, prefer not to pass this field or use `720p`.'
              example: 720p
            audio:
              oneOf:
              - type: boolean
              - type: string
              description: 'Whether to generate audio.

                Suggestions for avoiding copyright risks:

                - If you are worried about background music copyright, set `audio=false` first (no background music)

                - You can specify in the prompt words: no subtitles, no background music, only plot vocals/environmental sound
                effects/action sound effects'
            role_mode:
              type: string
              enum:
              - reference
              - frame
              default: reference
              description: 'Image role mode.

                - `reference` (default): unified mapping of images `reference_image`

                - `frame`: enable first/last-frame semantics (single image = first_frame; two images = first_frame + last_frame)

                Constraints:

                - `frame` mode only supports 1-2 images

                - `frame` mode cannot be mixed with `reference_video_urls`/`reference_audio_urls`'
            reference_video_urls:
              type: array
              minItems: 1
              maxItems: 3
              description: "**Important: Array of reference video URLs (max 3). Please ensure that the input URL is accessible\
                \ at the time of submission. **\n\nPass in a single reference video requirement:\n- Format: `mp4`, `mov`\n\
                - Resolution: `480p`, `720p`\n- Single video duration: `[2,15]s`\n- Total duration of all reference videos:\
                \ `<=15s`\n- Aspect ratio (width/height): `(0.4,2.5)`\n- Width and height pixels (width, height): `(300,6000)`\n\
                - Screen pixels (width × height): `[409600,927408]`\n  - For example: `640x640=409600` (minimum value)\n \
                \ - For example: `834x1112=927408` (maximum value)\n-Single video size: `<=50MB`\n- Frame rate (FPS): `[24,60]`"
              items:
                type: string
                format: uri
            reference_audio_urls:
              type: array
              minItems: 1
              maxItems: 3
              description: '**Important: Reference audio URL array (max 3). Please ensure that the input URL is accessible
                at the time of submission. **

                Passing in a single reference audio requirement:

                - Format: `wav`, `mp3`

                - Single audio duration: `[2,15]s`

                - Total duration of all reference audio: `<=15s`

                -Single audio size: `<=15MB`

                - Total request body size: `<=64MB`

                - Do not use Base64 encoding for large files. It is recommended to use accessible URLs.

                - The resources are short-term hosted content on the platform. It is recommended to complete the download
                and archive within 30 days.'
              items:
                type: string
                format: uri
            mcp_list:
              type: array
              description: List of optional MCP tools.
              items:
                type: object
                properties:
                  tool_name:
                    type: string
                    example: web_search
    Wan26VideoCreateRequest:
      type: object
      title: Wan2.6 video (model-dispatched)
      description: Wan2.6 video creation request. Dispatches to the concrete video request schema by `model`.
      anyOf:
      - $ref: '#/components/schemas/Wan26T2VVideoCreateRequest'
      - $ref: '#/components/schemas/Wan26I2VVideoCreateRequest'
      - $ref: '#/components/schemas/Wan26I2VFlashVideoCreateRequest'
      - $ref: '#/components/schemas/Wan26R2VVideoCreateRequest'
      discriminator:
        propertyName: model
        mapping:
          wan2.6-t2v: '#/components/schemas/Wan26T2VVideoCreateRequest'
          wan2.6-i2v: '#/components/schemas/Wan26I2VVideoCreateRequest'
          wan2.6-i2v-flash: '#/components/schemas/Wan26I2VFlashVideoCreateRequest'
          wan2.6-r2v: '#/components/schemas/Wan26R2VVideoCreateRequest'
    Wan26T2VVideoCreateRequest:
      type: object
      title: wan2.6-t2v text-to-video
      additionalProperties: false
      required:
      - model
      - prompt
      description: Wan2.6 text-to-video request body.
      properties:
        model:
          type: string
          enum:
          - wan2.6-t2v
        prompt:
          type: string
          minLength: 1
          maxLength: 800
          description: Prompt (required).
        duration:
          $ref: '#/components/schemas/Wan26VideoDuration15'
        seconds:
          $ref: '#/components/schemas/Wan26VideoSeconds15'
        size:
          $ref: '#/components/schemas/Wan26VideoResolution'
        aspect_ratio:
          $ref: '#/components/schemas/Wan26VideoAspectRatio'
        negative_prompt:
          type: string
          maxLength: 800
        prompt_extend:
          type: boolean
          default: false
        seed:
          type: integer
          minimum: 0
          maximum: 2147483647
        shot_type:
          type: string
          enum:
          - single
          - multi
        metadata:
          $ref: '#/components/schemas/Wan26T2VVideoMetadata'
    Wan26I2VVideoCreateRequest:
      type: object
      title: wan2.6-i2v image-to-video
      additionalProperties: false
      required:
      - model
      description: Wan2.6 image-to-video request body. At least one first-frame image source is required.
      anyOf:
      - required:
        - image
      - required:
        - images
      properties:
        model:
          type: string
          enum:
          - wan2.6-i2v
        prompt:
          type: string
          maxLength: 800
          description: Prompt (optional).
        image:
          type: string
          format: uri
          description: Single first-frame image URL (optional, mutually exclusive with `images`).
        images:
          type: array
          description: First-frame image array (optional, mutually exclusive with `image`; currently only 1 image is supported).
          items:
            type: string
            format: uri
          minItems: 1
          maxItems: 1
        duration:
          $ref: '#/components/schemas/Wan26VideoDuration15'
        seconds:
          $ref: '#/components/schemas/Wan26VideoSeconds15'
        size:
          $ref: '#/components/schemas/Wan26VideoResolution'
        negative_prompt:
          type: string
          maxLength: 800
        prompt_extend:
          type: boolean
          default: false
        seed:
          type: integer
          minimum: 0
          maximum: 2147483647
        shot_type:
          type: string
          enum:
          - single
          - multi
        template:
          type: string
          maxLength: 100
        metadata:
          $ref: '#/components/schemas/Wan26VideoMetadata'
    Wan26I2VFlashVideoCreateRequest:
      type: object
      title: wan2.6-i2v-flash fast image-to-video
      additionalProperties: false
      required:
      - model
      description: Wan2.6 fast image-to-video request body. Supports audio toggle and reference videos.
      anyOf:
      - required:
        - image
      - required:
        - images
      properties:
        model:
          type: string
          enum:
          - wan2.6-i2v-flash
        prompt:
          type: string
          maxLength: 800
          description: Prompt (optional).
        image:
          type: string
          format: uri
          description: Single first-frame image URL (optional, mutually exclusive with `images`).
        images:
          type: array
          description: First-frame image array (optional, mutually exclusive with `image`; currently only 1 image is supported).
          items:
            type: string
            format: uri
          minItems: 1
          maxItems: 1
        duration:
          $ref: '#/components/schemas/Wan26VideoDuration15'
        seconds:
          $ref: '#/components/schemas/Wan26VideoSeconds15'
        size:
          $ref: '#/components/schemas/Wan26VideoResolution'
        audio:
          type: boolean
          default: false
          description: Whether to enable audio (optional).
        reference_video_urls:
          type: array
          description: Reference video URL list (optional, up to 3 items).
          items:
            type: string
            format: uri
          minItems: 1
          maxItems: 3
        negative_prompt:
          type: string
          maxLength: 800
        prompt_extend:
          type: boolean
          default: false
        seed:
          type: integer
          minimum: 0
          maximum: 2147483647
        shot_type:
          type: string
          enum:
          - single
          - multi
        template:
          type: string
          maxLength: 100
        metadata:
          $ref: '#/components/schemas/Wan26I2VFlashVideoMetadata'
    Wan26R2VVideoCreateRequest:
      type: object
      title: wan2.6-r2v reference-to-video
      additionalProperties: false
      required:
      - model
      description: Wan2.6 reference-to-video request body. Supports reference image or reference video input.
      anyOf:
      - required:
        - image
      - required:
        - images
      - required:
        - reference_video_urls
      - required:
        - video_url
      properties:
        model:
          type: string
          enum:
          - wan2.6-r2v
        prompt:
          type: string
          maxLength: 800
          description: Prompt (optional).
        image:
          type: string
          format: uri
          description: Single reference image URL (optional; constrained with `images`, `reference_video_urls`, and `video_url`).
        images:
          type: array
          description: Reference image array (optional; currently only 1 image is supported).
          items:
            type: string
            format: uri
          minItems: 1
          maxItems: 1
        reference_video_urls:
          type: array
          items:
            type: string
            format: uri
          minItems: 1
          maxItems: 3
        video_url:
          type: string
          format: uri
        duration:
          $ref: '#/components/schemas/Wan26VideoDuration10'
        seconds:
          $ref: '#/components/schemas/Wan26VideoSeconds10'
        size:
          $ref: '#/components/schemas/Wan26VideoResolution'
        aspect_ratio:
          $ref: '#/components/schemas/Wan26VideoAspectRatio'
        negative_prompt:
          type: string
          maxLength: 800
        prompt_extend:
          type: boolean
          default: false
        seed:
          type: integer
          minimum: 0
          maximum: 2147483647
        shot_type:
          type: string
          enum:
          - single
          - multi
        metadata:
          $ref: '#/components/schemas/Wan26R2VVideoMetadata'
    Wan26VideoDuration15:
      type: integer
      description: 'Video duration in seconds. Supported values: `5`, `10`, `15`.'
      default: 5
      enum:
      - 5
      - 10
      - 15
    Wan26VideoDuration10:
      type: integer
      description: 'Video duration in seconds. Supported values: `5`, `10`.'
      default: 5
      enum:
      - 5
      - 10
    Wan26VideoSeconds15:
      description: 'Video duration as a string or integer. Supported values: `5`, `10`, `15`.'
      oneOf:
      - type: integer
        enum:
        - 5
        - 10
        - 15
      - type: string
        enum:
        - '5'
        - '10'
        - '15'
    Wan26VideoSeconds10:
      description: 'Video duration as a string or integer. Supported values: `5`, `10`.'
      oneOf:
      - type: integer
        enum:
        - 5
        - 10
      - type: string
        enum:
        - '5'
        - '10'
    Wan26VideoResolution:
      type: string
      description: 'Output resolution. Supported values: `720P`, `1080P`.'
      default: 1080P
      enum:
      - 720P
      - 1080P
    Wan26VideoAspectRatio:
      type: string
      description: 'Output aspect ratio. Supported values: `16:9`, `9:16`, `4:3`, `3:4`, `1:1`.'
      default: '16:9'
      enum:
      - '16:9'
      - '9:16'
      - '4:3'
      - '3:4'
      - '1:1'
    Wan26VideoMetadata:
      type: object
      additionalProperties: false
      description: Shared Wan2.6 image-to-video metadata. `resolution/size` and `duration/seconds` can also be repeated under
        `metadata`.
      properties:
        resolution:
          $ref: '#/components/schemas/Wan26VideoResolution'
        size:
          $ref: '#/components/schemas/Wan26VideoResolution'
        duration:
          $ref: '#/components/schemas/Wan26VideoDuration15'
        seconds:
          $ref: '#/components/schemas/Wan26VideoSeconds15'
    Wan26T2VVideoMetadata:
      type: object
      additionalProperties: false
      description: Wan2.6 text-to-video metadata. Supports resolution, duration, and aspect ratio under `metadata`.
      properties:
        resolution:
          $ref: '#/components/schemas/Wan26VideoResolution'
        size:
          $ref: '#/components/schemas/Wan26VideoResolution'
        duration:
          $ref: '#/components/schemas/Wan26VideoDuration15'
        seconds:
          $ref: '#/components/schemas/Wan26VideoSeconds15'
        aspect_ratio:
          $ref: '#/components/schemas/Wan26VideoAspectRatio'
    Wan26I2VFlashVideoMetadata:
      type: object
      additionalProperties: false
      description: Wan2.6 fast image-to-video metadata. Supports resolution, duration, audio toggle, and reference videos
        under `metadata`.
      properties:
        resolution:
          $ref: '#/components/schemas/Wan26VideoResolution'
        size:
          $ref: '#/components/schemas/Wan26VideoResolution'
        duration:
          $ref: '#/components/schemas/Wan26VideoDuration15'
        seconds:
          $ref: '#/components/schemas/Wan26VideoSeconds15'
        audio:
          type: boolean
        reference_video_urls:
          type: array
          items:
            type: string
            format: uri
          minItems: 1
          maxItems: 3
    Wan26R2VVideoMetadata:
      type: object
      additionalProperties: false
      description: Wan2.6 reference-to-video metadata. Supports resolution, duration, aspect ratio, and reference videos under
        `metadata`.
      properties:
        resolution:
          $ref: '#/components/schemas/Wan26VideoResolution'
        size:
          $ref: '#/components/schemas/Wan26VideoResolution'
        duration:
          $ref: '#/components/schemas/Wan26VideoDuration10'
        seconds:
          $ref: '#/components/schemas/Wan26VideoSeconds10'
        aspect_ratio:
          $ref: '#/components/schemas/Wan26VideoAspectRatio'
        reference_video_urls:
          type: array
          items:
            type: string
            format: uri
          minItems: 1
          maxItems: 3
        video_url:
          type: string
          format: uri
    Happyhorse10VideoCreateRequest:
      title: HappyHorse 1.0 video (model-dispatched)
      description: HappyHorse 1.0 video request. The `model` field selects text-to-video, image-to-video, or reference-image-to-video.
      anyOf:
      - $ref: '#/components/schemas/Happyhorse10T2VVideoCreateRequest'
      - $ref: '#/components/schemas/Happyhorse10I2VVideoCreateRequest'
      - $ref: '#/components/schemas/Happyhorse10R2VVideoCreateRequest'
      - $ref: '#/components/schemas/Happyhorse10VideoEditVideoCreateRequest'
      discriminator:
        propertyName: model
        mapping:
          happyhorse-1.0-t2v: '#/components/schemas/Happyhorse10T2VVideoCreateRequest'
          happyhorse-1.0-i2v: '#/components/schemas/Happyhorse10I2VVideoCreateRequest'
          happyhorse-1.0-r2v: '#/components/schemas/Happyhorse10R2VVideoCreateRequest'
          happyhorse-1.0-video-edit: '#/components/schemas/Happyhorse10VideoEditVideoCreateRequest'
    Happyhorse10T2VVideoCreateRequest:
      type: object
      title: happyhorse-1.0-t2v text-to-video
      additionalProperties: false
      required:
      - model
      - prompt
      description: HappyHorse 1.0 text-to-video request. Only `happyhorse-1.0-t2v` is supported. Image or reference video
        inputs are not accepted.
      properties:
        model:
          type: string
          enum:
          - happyhorse-1.0-t2v
        prompt:
          type: string
          minLength: 1
          maxLength: 800
          description: Text prompt.
        duration:
          $ref: '#/components/schemas/Happyhorse10T2VVideoDuration'
        seconds:
          $ref: '#/components/schemas/Happyhorse10T2VVideoSeconds'
        size:
          $ref: '#/components/schemas/Happyhorse10T2VVideoResolution'
        aspect_ratio:
          $ref: '#/components/schemas/Happyhorse10T2VVideoAspectRatio'
        seed:
          type: integer
          minimum: 0
          maximum: 2147483647
          description: Random seed.
        metadata:
          $ref: '#/components/schemas/Happyhorse10T2VVideoMetadata'
    Happyhorse10I2VVideoCreateRequest:
      type: object
      title: happyhorse-1.0-i2v image-to-video
      additionalProperties: false
      required:
      - model
      anyOf:
      - required:
        - image
      - required:
        - images
      - required:
        - first_frame_url
      - required:
        - media
      - required:
        - metadata
        properties:
          metadata:
            required:
            - first_frame_url
      - required:
        - metadata
        properties:
          metadata:
            required:
            - media
      description: HappyHorse 1.0 image-to-video request. Only `happyhorse-1.0-i2v` is supported and exactly one first-frame
        image source is required.
      properties:
        model:
          type: string
          enum:
          - happyhorse-1.0-i2v
        prompt:
          type: string
          minLength: 1
          maxLength: 800
          description: Text prompt (optional).
        image:
          type: string
          format: uri
          description: Single image input used as the first frame.
        images:
          type: array
          items:
            type: string
            format: uri
          minItems: 1
          maxItems: 1
          description: Image input array. Only one image is allowed and it is used as the first frame.
        first_frame_url:
          type: string
          format: uri
          description: Official first-frame image field. Use one of `image`, `images`, `first_frame_url`, or `media`; the
            resolved image source must be unique.
        media:
          type: array
          minItems: 1
          maxItems: 1
          description: Official media array. Only one item is allowed and `type` must be `first_frame`.
          items:
            type: object
            additionalProperties: false
            required:
            - url
            properties:
              type:
                type: string
                enum:
                - first_frame
                description: Media type. Currently only `first_frame` is supported.
              url:
                type: string
                format: uri
                description: First-frame image URL.
        duration:
          $ref: '#/components/schemas/Happyhorse10T2VVideoDuration'
        seconds:
          $ref: '#/components/schemas/Happyhorse10T2VVideoSeconds'
        size:
          $ref: '#/components/schemas/Happyhorse10T2VVideoResolution'
        seed:
          type: integer
          minimum: 0
          maximum: 2147483647
          description: Random seed.
        metadata:
          $ref: '#/components/schemas/Happyhorse10I2VVideoMetadata'
    Happyhorse10R2VVideoCreateRequest:
      type: object
      title: happyhorse-1.0-r2v reference-image-to-video
      additionalProperties: false
      required:
      - model
      - prompt
      anyOf:
      - required:
        - image
      - required:
        - images
      - required:
        - reference_image_urls
      - required:
        - media
      - required:
        - metadata
        properties:
          metadata:
            required:
            - reference_image_urls
      - required:
        - metadata
        properties:
          metadata:
            required:
            - media
      description: HappyHorse 1.0 reference-image-to-video request. Only `happyhorse-1.0-r2v` is supported and 1 to 9 reference
        images are required.
      properties:
        model:
          type: string
          enum:
          - happyhorse-1.0-r2v
        prompt:
          type: string
          minLength: 1
          maxLength: 2500
          description: Text prompt.
        image:
          type: string
          format: uri
          description: Single image input used as a reference image.
        images:
          type: array
          items:
            type: string
            format: uri
          minItems: 1
          maxItems: 9
          description: Image input array used as reference images. At most 9 images are allowed.
        reference_image_urls:
          type: array
          items:
            type: string
            format: uri
          minItems: 1
          maxItems: 9
          description: Official reference image URL array. Provide 1 to 9 images.
        media:
          type: array
          minItems: 1
          maxItems: 9
          description: Official media array. Provide 1 to 9 items and `type` must be `reference_image`.
          items:
            type: object
            additionalProperties: false
            required:
            - url
            properties:
              type:
                type: string
                enum:
                - reference_image
                description: Media type. Currently only `reference_image` is supported.
              url:
                type: string
                format: uri
                description: Reference image URL.
        duration:
          $ref: '#/components/schemas/Happyhorse10T2VVideoDuration'
        seconds:
          $ref: '#/components/schemas/Happyhorse10T2VVideoSeconds'
        size:
          $ref: '#/components/schemas/Happyhorse10T2VVideoResolution'
        aspect_ratio:
          $ref: '#/components/schemas/Happyhorse10T2VVideoAspectRatio'
        seed:
          type: integer
          minimum: 0
          maximum: 2147483647
          description: Random seed.
        metadata:
          $ref: '#/components/schemas/Happyhorse10R2VVideoMetadata'
    Happyhorse10VideoEditVideoCreateRequest:
      type: object
      title: happyhorse-1.0-video-edit video edit
      additionalProperties: false
      required:
      - model
      - prompt
      oneOf:
      - required:
        - video_url
      - required:
        - media
      - required:
        - metadata
        properties:
          metadata:
            required:
            - video_url
      - required:
        - metadata
        properties:
          metadata:
            required:
            - media
      description: HappyHorse 1.0 video-edit request. Only `happyhorse-1.0-video-edit` is supported. Provide a text prompt,
        one source video, and optional reference images; duration is not exposed for this model.
      properties:
        model:
          type: string
          enum:
          - happyhorse-1.0-video-edit
        prompt:
          type: string
          minLength: 1
          maxLength: 2500
          description: Text prompt (required).
        video_url:
          type: string
          format: uri
          description: Source video URL.
        reference_image_urls:
          type: array
          items:
            type: string
            format: uri
          minItems: 1
          maxItems: 5
          description: Optional reference image URLs. At most 5 images are allowed.
        media:
          type: array
          minItems: 1
          maxItems: 6
          description: Official media array. Provide one `video` item and optional `reference_image` items; at most 6 media
            items are allowed.
          items:
            type: object
            additionalProperties: false
            required:
            - type
            - url
            properties:
              type:
                type: string
                enum:
                - video
                - reference_image
                description: Media type. Supported values are `video` and `reference_image`.
              url:
                type: string
                format: uri
                description: Media URL.
        size:
          $ref: '#/components/schemas/Happyhorse10T2VVideoResolution'
        audio_setting:
          $ref: '#/components/schemas/Happyhorse10VideoEditAudioSetting'
        seed:
          type: integer
          minimum: 0
          maximum: 2147483647
          description: Random seed.
        metadata:
          $ref: '#/components/schemas/Happyhorse10VideoEditVideoMetadata'
    Happyhorse10T2VVideoDuration:
      type: integer
      description: Output video duration in seconds.
      default: 5
      enum:
      - 3
      - 4
      - 5
      - 6
      - 7
      - 8
      - 9
      - 10
      - 11
      - 12
      - 13
      - 14
      - 15
    Happyhorse10T2VVideoSeconds:
      description: OpenAI-compatible alias for `duration`.
      oneOf:
      - type: integer
        enum:
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
        - 9
        - 10
        - 11
        - 12
        - 13
        - 14
        - 15
      - type: string
        enum:
        - '3'
        - '4'
        - '5'
        - '6'
        - '7'
        - '8'
        - '9'
        - '10'
        - '11'
        - '12'
        - '13'
        - '14'
        - '15'
    Happyhorse10T2VVideoResolution:
      type: string
      description: Output video resolution. The exact SKU uses the normalized 720p/1080p value.
      default: 1080P
      enum:
      - 720P
      - 1080P
    Happyhorse10T2VVideoAspectRatio:
      type: string
      description: Output video aspect ratio. The field is exposed according to the current upstream official enum.
      default: '16:9'
      enum:
      - '16:9'
      - '9:16'
      - '1:1'
      - '4:3'
      - '3:4'
    Happyhorse10VideoEditAudioSetting:
      type: string
      description: Audio handling mode for video edit.
      default: auto
      enum:
      - auto
      - origin
    Happyhorse10T2VVideoMetadata:
      type: object
      additionalProperties: false
      description: Compatibility object. New clients should prefer top-level fields.
      properties:
        duration:
          $ref: '#/components/schemas/Happyhorse10T2VVideoDuration'
        seconds:
          $ref: '#/components/schemas/Happyhorse10T2VVideoSeconds'
        resolution:
          $ref: '#/components/schemas/Happyhorse10T2VVideoResolution'
        size:
          $ref: '#/components/schemas/Happyhorse10T2VVideoResolution'
        aspect_ratio:
          $ref: '#/components/schemas/Happyhorse10T2VVideoAspectRatio'
        seed:
          type: integer
          minimum: 0
          maximum: 2147483647
    Happyhorse10I2VVideoMetadata:
      type: object
      additionalProperties: false
      description: HappyHorse image-to-video compatibility object. New clients should prefer top-level fields.
      properties:
        duration:
          $ref: '#/components/schemas/Happyhorse10T2VVideoDuration'
        seconds:
          $ref: '#/components/schemas/Happyhorse10T2VVideoSeconds'
        resolution:
          $ref: '#/components/schemas/Happyhorse10T2VVideoResolution'
        size:
          $ref: '#/components/schemas/Happyhorse10T2VVideoResolution'
        seed:
          type: integer
          minimum: 0
          maximum: 2147483647
        first_frame_url:
          type: string
          format: uri
        media:
          type: array
          minItems: 1
          maxItems: 1
          items:
            type: object
            additionalProperties: false
            required:
            - url
            properties:
              type:
                type: string
                enum:
                - first_frame
              url:
                type: string
                format: uri
    Happyhorse10R2VVideoMetadata:
      type: object
      additionalProperties: false
      description: HappyHorse reference-image-to-video compatibility object. New clients should prefer top-level fields.
      properties:
        duration:
          $ref: '#/components/schemas/Happyhorse10T2VVideoDuration'
        seconds:
          $ref: '#/components/schemas/Happyhorse10T2VVideoSeconds'
        resolution:
          $ref: '#/components/schemas/Happyhorse10T2VVideoResolution'
        size:
          $ref: '#/components/schemas/Happyhorse10T2VVideoResolution'
        aspect_ratio:
          $ref: '#/components/schemas/Happyhorse10T2VVideoAspectRatio'
        seed:
          type: integer
          minimum: 0
          maximum: 2147483647
        reference_image_url:
          type: string
          format: uri
        reference_image_urls:
          type: array
          minItems: 1
          maxItems: 9
          items:
            type: string
            format: uri
        media:
          type: array
          minItems: 1
          maxItems: 9
          items:
            type: object
            additionalProperties: false
            required:
            - url
            properties:
              type:
                type: string
                enum:
                - reference_image
              url:
                type: string
                format: uri
    Happyhorse10VideoEditVideoMetadata:
      type: object
      additionalProperties: false
      description: HappyHorse video-edit compatibility object. New clients should prefer top-level fields.
      properties:
        resolution:
          $ref: '#/components/schemas/Happyhorse10T2VVideoResolution'
        size:
          $ref: '#/components/schemas/Happyhorse10T2VVideoResolution'
        audio_setting:
          $ref: '#/components/schemas/Happyhorse10VideoEditAudioSetting'
        seed:
          type: integer
          minimum: 0
          maximum: 2147483647
        video_url:
          type: string
          format: uri
        reference_image_url:
          type: string
          format: uri
        reference_image_urls:
          type: array
          minItems: 1
          maxItems: 5
          items:
            type: string
            format: uri
        media:
          type: array
          minItems: 1
          maxItems: 6
          items:
            type: object
            additionalProperties: false
            required:
            - type
            - url
            properties:
              type:
                type: string
                enum:
                - video
                - reference_image
              url:
                type: string
                format: uri
    KlingV3VideoCreateRequest:
      type: object
      title: kling-v3-video
      additionalProperties: false
      required:
      - model
      description: Kling v3 Video request. The `model` field must be `kling-v3-video`.
      properties:
        model:
          type: string
          enum:
          - kling-v3-video
          description: Model id.
        prompt:
          type: string
          minLength: 1
          description: Text prompt. Required for text-to-video and recommended for image inputs.
        image:
          type: string
          format: uri
          description: Single URL image input used for image-to-video or first-frame generation.
        images:
          type: array
          description: URL image input array. Two images select first-last-frame mode unless a category is explicitly provided.
          items:
            type: string
            format: uri
          minItems: 1
        first_frame_url:
          type: string
          format: uri
          description: First-frame image URL.
        last_frame_url:
          type: string
          format: uri
          description: Last-frame image URL.
        element_list:
          $ref: '#/components/schemas/KlingV3ElementList'
          description: Official subject reference list. Each item only supports `element_id`; media URL elements are not supported
            for this Kling v3 schema.
        camera_control:
          type: object
          description: '`kling-v3-video` camera-control object.'
          additionalProperties: true
        duration:
          $ref: '#/components/schemas/KlingV3VideoDuration'
        seconds:
          $ref: '#/components/schemas/KlingV3VideoSeconds'
        aspect_ratio:
          $ref: '#/components/schemas/KlingV3AspectRatio'
        mode:
          $ref: '#/components/schemas/KlingV3VideoMode'
        sound:
          $ref: '#/components/schemas/KlingV3Sound'
          description: Sound generation switch. Use the string `on` or `off`; normal text/image/first-last-frame categories
            support `on/off`, while subject reference-image mode only supports `off`.
        negative_prompt:
          type: string
          description: Negative prompt.
        multi_prompt:
          $ref: '#/components/schemas/KlingV3MultiPrompt'
          description: Multi-shot prompt array. Up to 6 shots.
        multi_shot:
          type: boolean
          description: Whether to enable multi-shot generation.
        shot_type:
          type: string
          description: Multi-shot mode type.
        static_mask:
          type: string
          description: Static mask object.
        voice_list:
          type: array
          description: Voice list.
          items:
            type: object
            additionalProperties: true
        metadata:
          $ref: '#/components/schemas/KlingV3VideoMetadata'
    KlingV3OmniVideoCreateRequest:
      type: object
      title: kling-v3-omni-video
      additionalProperties: false
      required:
      - model
      description: Kling v3 Omni Video request. The `model` field must be `kling-v3-omni-video`.
      properties:
        model:
          type: string
          enum:
          - kling-v3-omni-video
          description: Model id.
        prompt:
          type: string
          minLength: 1
          description: Text prompt.
        image:
          type: string
          format: uri
          description: Single image input used as first frame or reference image.
        images:
          type: array
          description: Image input array.
          items:
            type: string
            format: uri
          minItems: 1
        video_url:
          type: string
          format: uri
          description: Video input URL. This input form supports only `3~10s` and cannot be combined with `sound=on`.
        video_list:
          type: array
          description: Video input list. Items may be URL strings or objects with `video_url`; optional `refer_type` is `feature`
            or `base`, and `keep_original_sound` is `yes` or `no`. This input form supports only `3~10s` and cannot be combined
            with `sound=on`.
          items:
            oneOf:
            - type: string
              format: uri
            - type: object
              additionalProperties: false
              properties:
                url:
                  type: string
                  format: uri
                video_url:
                  type: string
                  format: uri
                refer_type:
                  type: string
                  enum:
                  - feature
                  - base
                keep_original_sound:
                  type: string
                  enum:
                  - true
                  - false
          minItems: 1
        image_list:
          type: array
          description: Official image input list. For Omni Video use `image_url`; optional `type` only supports `first_frame`
            and `end_frame`.
          items:
            oneOf:
            - type: string
              format: uri
            - type: object
              additionalProperties: false
              properties:
                url:
                  type: string
                  format: uri
                image_url:
                  type: string
                  format: uri
                type:
                  type: string
                  enum:
                  - first_frame
                  - end_frame
          minItems: 1
        element_list:
          $ref: '#/components/schemas/KlingV3ElementList'
          description: Official subject reference list. Each item only supports `element_id`; media URLs must use `image_list`
            or `video_list`.
        first_frame_url:
          type: string
          format: uri
          description: First-frame image URL.
        last_frame_url:
          type: string
          format: uri
          description: Last-frame image URL.
        reference_image_url:
          type: string
          format: uri
          description: Single reference image URL.
        reference_image_urls:
          type: array
          description: Reference image URL array.
          items:
            type: string
            format: uri
          minItems: 1
        duration:
          $ref: '#/components/schemas/KlingV3VideoDuration'
        seconds:
          $ref: '#/components/schemas/KlingV3VideoSeconds'
        aspect_ratio:
          $ref: '#/components/schemas/KlingV3AspectRatio'
        mode:
          $ref: '#/components/schemas/KlingV3VideoMode'
        sound:
          $ref: '#/components/schemas/KlingV3Sound'
          description: Sound generation switch. Use the string `on` or `off`; normal text/image/first-last-frame/reference-image
            categories support `on/off`, while `video_url` / `video_list` reference-video input only supports `off`.
        multi_prompt:
          $ref: '#/components/schemas/KlingV3MultiPrompt'
          description: Multi-shot prompt array. Up to 6 shots.
        multi_shot:
          type: boolean
          description: Whether to enable multi-shot generation.
        shot_type:
          type: string
          description: Multi-shot mode type.
        metadata:
          $ref: '#/components/schemas/KlingV3OmniVideoMetadata'
    KlingV3VideoDuration:
      description: Video duration in seconds. Supported range is 3 through 15 seconds for these models.
      oneOf:
      - type: integer
        enum:
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
        - 9
        - 10
        - 11
        - 12
        - 13
        - 14
        - 15
      - type: string
        enum:
        - '3'
        - '4'
        - '5'
        - '6'
        - '7'
        - '8'
        - '9'
        - '10'
        - '11'
        - '12'
        - '13'
        - '14'
        - '15'
    KlingV3VideoSeconds:
      description: OpenAI-compatible alias for `duration`.
      oneOf:
      - type: integer
        enum:
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
        - 9
        - 10
        - 11
        - 12
        - 13
        - 14
        - 15
      - type: string
        enum:
        - '3'
        - '4'
        - '5'
        - '6'
        - '7'
        - '8'
        - '9'
        - '10'
        - '11'
        - '12'
        - '13'
        - '14'
        - '15'
    KlingV3VideoMode:
      type: string
      description: Quality mode for `kling-v3-video` and `kling-v3-omni-video`.
      default: std
      enum:
      - std
      - pro
    KlingV3Sound:
      type: string
      description: Sound generation switch. Normal categories support `on/off`; `kling-v3-video` reference-image video and
        `kling-v3-omni-video` `video_url` / `video_list` reference video input only support `off`.
      default: 'off'
      enum:
      - 'on'
      - 'off'
    KlingV3AspectRatio:
      type: string
      description: 'Supported output aspect ratios: `16:9`, `9:16`, `1:1`.'
      default: '16:9'
      enum:
      - '16:9'
      - '9:16'
      - '1:1'
    KlingV3MultiPrompt:
      type: array
      description: Multi-shot prompt array. Each item may include `index`, `prompt`, and `duration`.
      maxItems: 6
      items:
        type: object
        additionalProperties: false
        properties:
          index:
            type: integer
            minimum: 1
          prompt:
            type: string
            maxLength: 512
          duration:
            type: integer
            minimum: 1
    KlingV3VideoMetadata:
      type: object
      additionalProperties: false
      description: Kling v3 Video compatibility object. New clients should prefer top-level fields. `element_list` only supports
        `{ element_id }` items.
      properties:
        aigc_category:
          type: string
          enum:
          - text_to_video
          - image_to_video
          - first_last_frame_to_video
          - reference_image_to_video
        duration:
          $ref: '#/components/schemas/KlingV3VideoDuration'
        seconds:
          $ref: '#/components/schemas/KlingV3VideoSeconds'
        aspect_ratio:
          $ref: '#/components/schemas/KlingV3AspectRatio'
        mode:
          $ref: '#/components/schemas/KlingV3VideoMode'
        sound:
          $ref: '#/components/schemas/KlingV3Sound'
          description: Compatibility metadata sound switch. New clients should prefer top-level `sound`; value must be the
            string `on` or `off`.
        first_frame_url:
          type: string
          format: uri
        last_frame_url:
          type: string
          format: uri
        negative_prompt:
          type: string
        multi_prompt:
          $ref: '#/components/schemas/KlingV3MultiPrompt'
        multi_shot:
          type: boolean
        shot_type:
          type: string
          enum:
          - customize
          - intelligence
        static_mask:
          type: string
        voice_list:
          type: array
          items:
            type: object
            additionalProperties: true
        element_list:
          $ref: '#/components/schemas/KlingV3ElementList'
    KlingV3ElementList:
      type: array
      description: Kling v3 official subject reference list.
      minItems: 1
      items:
        type: object
        additionalProperties: false
        required:
        - element_id
        properties:
          element_id:
            type: integer
            minimum: 1
            description: Subject ID.
            example: 12345
    KlingV3OmniVideoMetadata:
      type: object
      additionalProperties: false
      description: Kling v3 Omni Video compatibility object. New clients should prefer top-level fields. `image_list.type`
        only supports `first_frame` and `end_frame`; `element_list` only supports `{ element_id }` items.
      properties:
        aigc_category:
          type: string
          enum:
          - text_to_video
          - image_to_video
          - first_last_frame_to_video
          - reference_image_to_video
        duration:
          $ref: '#/components/schemas/KlingV3VideoDuration'
        seconds:
          $ref: '#/components/schemas/KlingV3VideoSeconds'
        aspect_ratio:
          $ref: '#/components/schemas/KlingV3AspectRatio'
        mode:
          $ref: '#/components/schemas/KlingV3VideoMode'
        sound:
          $ref: '#/components/schemas/KlingV3Sound'
          description: Compatibility metadata sound switch. New clients should prefer top-level `sound`; value must be the
            string `on` or `off`.
        video_url:
          type: string
          format: uri
        video_list:
          type: array
          minItems: 1
          items:
            oneOf:
            - type: string
              format: uri
            - type: object
              additionalProperties: false
              properties:
                url:
                  type: string
                  format: uri
                video_url:
                  type: string
                  format: uri
                refer_type:
                  type: string
                  enum:
                  - feature
                  - base
                keep_original_sound:
                  type: string
                  enum:
                  - true
                  - false
        image_list:
          type: array
          minItems: 1
          items:
            oneOf:
            - type: string
              format: uri
            - type: object
              additionalProperties: false
              properties:
                url:
                  type: string
                  format: uri
                image_url:
                  type: string
                  format: uri
                type:
                  type: string
                  enum:
                  - first_frame
                  - end_frame
        element_list:
          $ref: '#/components/schemas/KlingV3ElementList'
        first_frame_url:
          type: string
          format: uri
        last_frame_url:
          type: string
          format: uri
        reference_image_url:
          type: string
          format: uri
        reference_image_urls:
          type: array
          minItems: 1
          items:
            type: string
            format: uri
        multi_prompt:
          $ref: '#/components/schemas/KlingV3MultiPrompt'
        multi_shot:
          type: boolean
        shot_type:
          type: string
          enum:
          - customize
    GeminiImageGenerationRequest:
      type: object
      description: 'Gemini image generation request.

        - `gemini-2.5-flash-image`, `gemini-3-pro-image-preview`, and `gemini-3.1-flash-image-preview` use the Gemini image
        parameter set

        - This object is only used for Gemini docs on the main `/v1/images/generations` path'
      oneOf:
      - $ref: '#/components/schemas/ImaImageGenerationRequestGemini25Flash'
      - $ref: '#/components/schemas/ImaImageGenerationRequestGemini3Pro'
      - $ref: '#/components/schemas/ImaImageGenerationRequestGemini31Flash'
      discriminator:
        propertyName: model
        mapping:
          gemini-2.5-flash-image: '#/components/schemas/ImaImageGenerationRequestGemini25Flash'
          gemini-3-pro-image-preview: '#/components/schemas/ImaImageGenerationRequestGemini3Pro'
          gemini-3.1-flash-image-preview: '#/components/schemas/ImaImageGenerationRequestGemini31Flash'
    ImaImageGenerationRequest:
      type: object
      description: 'Image generation request, strictly constrained by model.

        - Gemini: `gemini-2.5-flash-image`, `gemini-3-pro-image-preview`, `gemini-3.1-flash-image-preview`

        - GPT Image: `gpt-image-2`

        - Doubao Seedream: `doubao-seedream-4-5-251128`, `doubao-seedream-5-0-lite-260128`

        - Wan Images: `wan2.6-t2i`, `wan2.6-image`, `wan2.7-image`, `wan2.7-image-pro`

        - PrunaAI Images: `prunaai/p-image`, `prunaai/p-image-edit`

        - Each model family uses its own schema, and fields only document parameters currently validated or forwarded by the
        implementation'
      oneOf:
      - $ref: '#/components/schemas/ImaImageGenerationRequestGemini25Flash'
      - $ref: '#/components/schemas/ImaImageGenerationRequestGemini3Pro'
      - $ref: '#/components/schemas/ImaImageGenerationRequestGemini31Flash'
      - $ref: '#/components/schemas/GptImage2ImageGenerationRequest'
      - $ref: '#/components/schemas/DoubaoSeedream45ImageGenerationRequest'
      - $ref: '#/components/schemas/DoubaoSeedream50LiteImageGenerationRequest'
      - $ref: '#/components/schemas/Wan26T2IImageGenerationRequest'
      - $ref: '#/components/schemas/Wan26I2IImageGenerationRequest'
      - $ref: '#/components/schemas/Wan27ImageGenerationRequest'
      - $ref: '#/components/schemas/PrunaPImageGenerationRequest'
      - $ref: '#/components/schemas/PrunaPImageEditGenerationRequest'
      discriminator:
        propertyName: model
        mapping:
          gemini-2.5-flash-image: '#/components/schemas/ImaImageGenerationRequestGemini25Flash'
          gemini-3-pro-image-preview: '#/components/schemas/ImaImageGenerationRequestGemini3Pro'
          gemini-3.1-flash-image-preview: '#/components/schemas/ImaImageGenerationRequestGemini31Flash'
          gpt-image-2: '#/components/schemas/GptImage2ImageGenerationRequest'
          doubao-seedream-4-5-251128: '#/components/schemas/DoubaoSeedream45ImageGenerationRequest'
          doubao-seedream-5-0-lite-260128: '#/components/schemas/DoubaoSeedream50LiteImageGenerationRequest'
          seedream-5-0-260128: '#/components/schemas/DoubaoSeedream50LiteImageGenerationRequest'
          wan2.6-t2i: '#/components/schemas/Wan26T2IImageGenerationRequest'
          wan2.6-image: '#/components/schemas/Wan26I2IImageGenerationRequest'
          wan2.7-image: '#/components/schemas/Wan27ImageGenerationRequest'
          wan2.7-image-pro: '#/components/schemas/Wan27ImageGenerationRequest'
          prunaai/p-image: '#/components/schemas/PrunaPImageGenerationRequest'
          prunaai/p-image-edit: '#/components/schemas/PrunaPImageEditGenerationRequest'
    ImaMusicCreateTaskRequest:
      type: object
      additionalProperties: false
      required:
      - model
      - prompt
      description: sonic music generation request.
      example:
        model: sonic
        prompt: Bright synth-pop with a catchy chorus
        custom_mode: false
        model_version: sonic-v5
        tags: electronic, cinematic
        title: Neon Skyline
        vocal_gender: f
        style_weight: 0
        weirdness_constraint: 0
      properties:
        model:
          type: string
          enum:
          - sonic
          description: Music model ID. Currently supports `sonic`.
        prompt:
          type: string
          minLength: 1
          maxLength: 5000
          description: Music prompt (required).
        auto_lyrics:
          type: boolean
          default: false
          description: Whether to auto-generate lyrics. Explicit `false` is preserved.
        custom_mode:
          type: boolean
          default: true
          description: Whether to use custom mode. Defaults to `true`; explicit `false` is preserved.
        gpt_description_prompt:
          type: string
          maxLength: 400
          description: Prompt used to generate the song description, up to 400 characters.
        make_instrumental:
          type: boolean
          default: false
          description: Whether to generate an instrumental track. Explicit `false` is preserved.
        model_version:
          type: string
          default: sonic-v4
          enum:
          - sonic-v3-5
          - sonic-v4
          - sonic-v4-5
          - sonic-v4-5-plus
          - sonic-v5
          description: Sonic model version. Defaults to `sonic-v4` when omitted.
        negative_tags:
          type: string
          description: Negative tags.
        style_weight:
          type: number
          minimum: 0
          maximum: 1
          description: Style weight from 0 to 1. Explicit `0` is preserved.
        tags:
          type: string
          maxLength: 1000
          description: Style or music tags, up to 1000 characters.
        title:
          type: string
          maxLength: 120
          description: Song title, up to 120 characters.
        vocal_gender:
          type: string
          description: Vocal gender hint, usually `m` or `f`.
        weirdness_constraint:
          type: number
          minimum: 0
          maximum: 1
          description: Creativity/weirdness constraint from 0 to 1. Explicit `0` is preserved.
    ImaMusicCreateTaskResponse:
      type: object
      additionalProperties: true
      description: Music task submission response.
      properties:
        id:
          type: string
          description: Public task ID.
        task_id:
          type: string
          description: Same as `id`.
        object:
          type: string
          example: music
        model:
          type: string
          example: sonic
        status:
          type: string
          description: Initial task status.
        progress:
          type: integer
          minimum: 0
          maximum: 100
        created_at:
          type: integer
          format: int64
    ImaMusicTaskFetchResponse:
      type: object
      additionalProperties: true
      description: Music task fetch response.
      properties:
        code:
          type: string
          example: success
        data:
          type: object
          additionalProperties: true
          properties:
            task_id:
              type: string
              description: Public task ID.
            status:
              type: string
              description: Task status.
              enum:
              - queued
              - processing
              - succeeded
              - failed
            data:
              type: array
              description: Music result array. A successful terminal response usually returns two items; queued, processing,
                or failed states may return an empty array.
              items:
                $ref: '#/components/schemas/ImaMusicResult'
            amount_usd:
              type: number
              format: double
              minimum: 0
              description: USD amount for the completed task, when returned.
            error:
              nullable: true
              oneOf:
              - type: object
                additionalProperties: true
              - type: string
    SeedTtsSpeechCreateRequest:
      type: object
      x-model-type: tts
      additionalProperties: false
      required:
      - model
      allOf:
      - anyOf:
        - required:
          - input
        - required:
          - text
        - required:
          - prompt
        - required:
          - ssml
      - anyOf:
        - required:
          - voice
        - required:
          - speaker
      description: Seed TTS 2.0 speech synthesis request body.
      properties:
        model:
          type: string
          enum:
          - seed-tts-2.0
          description: Speech model name. Currently only `seed-tts-2.0` is supported.
        input:
          type: string
          minLength: 1
          maxLength: 10000
          description: Text input. Provide at least one of `input`, `text`, `prompt`, or `ssml`.
        text:
          type: string
          minLength: 1
          maxLength: 10000
          description: Text input alias.
        prompt:
          type: string
          minLength: 1
          maxLength: 10000
          description: Text input alias.
        ssml:
          type: string
          minLength: 1
          maxLength: 10000
          description: SSML input.
        voice:
          type: string
          description: OpenAI-compatible voice field.
        speaker:
          type: string
          description: Speech speaker field.
        response_format:
          type: string
          default: mp3
          description: Audio format, defaults to `mp3`.
        speed:
          type: number
          format: double
          description: Speech speed multiplier.
        metadata:
          type: object
          additionalProperties: true
          description: Optional metadata.
    SeedTtsSpeechCreateResponse:
      type: object
      additionalProperties: true
      description: Seed TTS task submission response.
      properties:
        id:
          type: string
          description: Public task ID.
        task_id:
          type: string
          description: Public task ID.
        object:
          type: string
          example: audio.speech
        model:
          type: string
          example: seed-tts-2.0
        status:
          type: string
          example: submitted
        progress:
          type: integer
          minimum: 0
          maximum: 100
        created_at:
          type: integer
          format: int64
    SeedTtsSpeechFetchResponse:
      type: object
      additionalProperties: true
      description: Seed TTS task fetch response.
      properties:
        code:
          type: string
          example: success
        data:
          type: object
          additionalProperties: true
          properties:
            task_id:
              type: string
              description: Public task ID.
            status:
              type: string
              enum:
              - queued
              - processing
              - succeeded
              - failed
              description: Task status.
            format:
              type: string
              description: Audio format.
            url:
              type: string
              description: Audio URL after terminal success.
            amount_usd:
              type: number
              format: double
              minimum: 0
              description: USD amount for the completed task, when returned.
            usage:
              type: object
              additionalProperties: true
              description: Terminal usage.
              properties:
                count:
                  type: integer
                  minimum: 0
                  description: Character usage count.
            error:
              nullable: true
              oneOf:
              - type: object
                additionalProperties: true
              - type: string
    ImaMusicResult:
      type: object
      additionalProperties: true
      description: Single music result. Clients should prefer `url` or `audio_url` for the audio address.
      properties:
        url:
          type: string
          format: uri
          description: Music result URL. Download and persist it promptly after receiving it.
        audio_url:
          type: string
          format: uri
          description: Music audio URL.
        title:
          type: string
          description: Song title.
        lyrics:
          type: string
          description: Lyrics text.
        duration:
          type: number
          minimum: 0
          description: Audio duration in seconds.
        metadata:
          type: object
          additionalProperties: true
          description: Music result metadata.
    ImaImageGenerationRequestGemini25Flash:
      type: object
      additionalProperties: false
      required:
      - model
      - prompt
      example:
        model: gemini-2.5-flash-image
        prompt: compact watercolor postcard of a mountain village
        aspect_ratio: '21:9'
        size: 4K
      properties:
        model:
          type: string
          enum:
          - gemini-2.5-flash-image
          description: Image model name (Gemini 2.5 Flash Image).
        prompt:
          type: string
          minLength: 1
          maxLength: 10000
          description: Prompt (required).
        aspect_ratio:
          type: string
          description: Image aspect ratio (optional).
          enum:
          - '1:1'
          - '1:4'
          - '1:8'
          - '2:3'
          - '3:2'
          - '3:4'
          - '4:1'
          - '4:3'
          - '4:5'
          - '5:4'
          - '8:1'
          - '9:16'
          - '16:9'
          - '21:9'
        size:
          type: string
          description: Output size (optional, default `1K`).
          default: 1K
          enum:
          - 512px
          - 1K
          - 2K
          - 4K
        image:
          type: string
          format: uri
          description: 'Single image input (optional, image-to-image).

            **IMPORTANT**: Confirm that the input URL is accessible before calling; the 30-day expiration rule only applies
            to the result resource URL returned by the API.

            File type requirement: `jpg/png` (upstream constraint).'
        images:
          type: array
          description: 'Multiple image input (optional, image-to-image).

            **IMPORTANT**: Confirm that the input URL is accessible before calling; the 30-day expiration rule only applies
            to the result resource URL returned by the API.

            File type requirement: `jpg/png` (upstream constraint).'
          items:
            type: string
            format: uri
          minItems: 1
          maxItems: 14
    ImaImageGenerationRequestGemini3Pro:
      type: object
      additionalProperties: false
      required:
      - model
      - prompt
      example:
        model: gemini-3-pro-image-preview
        prompt: a futuristic city at sunset
        aspect_ratio: '16:9'
        size: 2K
      properties:
        model:
          type: string
          enum:
          - gemini-3-pro-image-preview
          description: Image model name (pro).
        prompt:
          type: string
          minLength: 1
          maxLength: 10000
          description: Prompt word (required).
        aspect_ratio:
          type: string
          description: Image aspect ratio (optional).
          enum:
          - '1:1'
          - '3:2'
          - '2:3'
          - '3:4'
          - '4:3'
          - '4:5'
          - '5:4'
          - '9:16'
          - '16:9'
          - '21:9'
        size:
          type: string
          description: Output size (optional, default `1K`).
          default: 1K
          enum:
          - 1K
          - 2K
          - 4K
        image:
          type: string
          format: uri
          description: 'Single image input (optional, image-to-image).

            **IMPORTANT**: Please confirm that the input URL is accessible before calling; the 30-day expiration rule only
            applies to the result resource URL returned by the interface.

            File type requirement: `jpg/png` (upstream constraint).'
        images:
          type: array
          description: 'Multiple image input (optional, image-to-image).

            **IMPORTANT**: Please confirm that the input URL is accessible before calling; the 30-day expiration rule only
            applies to the result resource URL returned by the interface.

            File type requirement: `jpg/png` (upstream constraint).'
          items:
            type: string
            format: uri
          minItems: 1
          maxItems: 14
    ImaImageGenerationRequestGemini31Flash:
      type: object
      additionalProperties: false
      required:
      - model
      - prompt
      example:
        model: gemini-3.1-flash-image-preview
        prompt: minimalist icon set for weather app
        aspect_ratio: '1:1'
        size: 512px
      properties:
        model:
          type: string
          enum:
          - gemini-3.1-flash-image-preview
          description: Image model name (flash).
        prompt:
          type: string
          minLength: 1
          maxLength: 10000
          description: Prompt word (required).
        aspect_ratio:
          type: string
          description: Image aspect ratio (optional).
          enum:
          - '1:1'
          - '1:4'
          - '1:8'
          - '2:3'
          - '3:2'
          - '3:4'
          - '4:1'
          - '4:3'
          - '4:5'
          - '5:4'
          - '8:1'
          - '9:16'
          - '16:9'
          - '21:9'
        size:
          type: string
          description: Output size (optional, default `1K`).
          default: 1K
          enum:
          - 512px
          - 1K
          - 2K
          - 4K
        image:
          type: string
          format: uri
          description: 'Single image input (optional, image-to-image).

            **IMPORTANT**: Please confirm that the input URL is accessible before calling; the 30-day expiration rule only
            applies to the result resource URL returned by the interface.

            File type requirement: `jpg/png` (upstream constraint).'
        images:
          type: array
          description: 'Multiple image input (optional, image-to-image).

            **IMPORTANT**: Please confirm that the input URL is accessible before calling; the 30-day expiration rule only
            applies to the result resource URL returned by the interface.

            File type requirement: `jpg/png` (upstream constraint).'
          items:
            type: string
            format: uri
          minItems: 1
          maxItems: 14
    GptImage2ImageGenerationRequest:
      type: object
      additionalProperties: false
      required:
      - model
      - prompt
      example:
        model: gpt-image-2
        prompt: replace the background with a clean studio backdrop
        images:
        - https://example.com/input.png
        mask: https://example.com/mask.png
        size: 1536x1024
        quality: high
        input_fidelity: high
        moderation: low
        output_format: png
      properties:
        model:
          type: string
          enum:
          - gpt-image-2
          description: gpt-image-2 image model name.
        prompt:
          type: string
          minLength: 1
          description: Prompt (required). The current implementation requires `prompt` to be present.
        size:
          type: string
          description: Output size (optional). Passed through as-is without enum validation.
        quality:
          type: string
          description: Output quality (optional). Passed through as-is.
        image:
          type: string
          description: Single image input (optional). With image input and no `mask`, the request is treated as `image_to_image`.
        images:
          type: array
          description: Multiple image input (optional). With image input and no `mask`, the request is treated as `image_to_image`.
          items:
            type: string
        background:
          type: string
          description: Background control (optional). Passed through as-is by the current implementation.
        input_fidelity:
          type: string
          description: Input fidelity (optional). Passed through as-is by the current implementation.
        mask:
          type: string
          description: Edit mask (optional). With image input and `mask`, the request is treated as `image_edit`.
        moderation:
          type: string
          description: Moderation level (optional). Passed through as-is by the current implementation.
        n:
          type: integer
          minimum: 0
          description: Number of images to return (optional). Passed through as-is by the current implementation.
        output_compression:
          type: integer
          minimum: 0
          maximum: 100
          default: 100
          description: Output compression ratio (optional, 0-100). **Only applies when `output_format=jpeg` or `webp`**; when
            `output_format=png` it must be 100 (default), otherwise upstream returns 400 `invalid_png_output_compression`.
        output_format:
          type: string
          enum:
          - png
          - jpeg
          - webp
          default: png
          description: Output format (optional). One of `png` (default) / `jpeg` / `webp`. Do NOT send `output_compression`
            (or set it to 100) when `png` is chosen — upstream will reject otherwise.
    DoubaoSeedreamImageGenerationRequest:
      type: object
      description: Doubao Seedream image generation request. The real request path is `POST /v1/images/generations`; `model`
        dispatches to the 4.5 or 5.0 Lite request body.
      oneOf:
      - $ref: '#/components/schemas/DoubaoSeedream45ImageGenerationRequest'
      - $ref: '#/components/schemas/DoubaoSeedream50LiteImageGenerationRequest'
      discriminator:
        propertyName: model
        mapping:
          doubao-seedream-4-5-251128: '#/components/schemas/DoubaoSeedream45ImageGenerationRequest'
          doubao-seedream-5-0-lite-260128: '#/components/schemas/DoubaoSeedream50LiteImageGenerationRequest'
          seedream-5-0-260128: '#/components/schemas/DoubaoSeedream50LiteImageGenerationRequest'
    DoubaoSeedream45ImageGenerationRequest:
      type: object
      additionalProperties: false
      required:
      - model
      - prompt
      description: doubao-seedream-4-5-251128 image generation request. Supports text-to-image and image-to-image; the current
        implementation forwards only `prompt`, `size`, and image input.
      example:
        model: doubao-seedream-4-5-251128
        prompt: turn this reference into a cinematic poster
        images:
        - https://example.com/input.webp
        size: 2K
      properties:
        model:
          type: string
          enum:
          - doubao-seedream-4-5-251128
          description: doubao-seedream-4-5-251128 image model name.
        prompt:
          type: string
          minLength: 1
          maxLength: 600
          description: Prompt (required).
        size:
          type: string
          description: Output image size (optional). Supports `2K`, `4K`, and upstream-allowed custom pixel sizes.
          default: 2K
          enum:
          - 2K
          - 4K
          - 2048x2048
          - 2304x1728
          - 1728x2304
          - 2560x1440
          - 1440x2560
          - 2496x1664
          - 1664x2496
          - 3024x1296
        image:
          type: string
          format: uri
          description: Single input image (optional, for image-to-image).
        images:
          type: array
          description: Multiple input images (optional, for image-to-image, up to 14 images).
          items:
            type: string
            format: uri
          minItems: 1
          maxItems: 14
    DoubaoSeedream50LiteImageGenerationRequest:
      type: object
      additionalProperties: false
      required:
      - model
      - prompt
      example:
        model: doubao-seedream-5-0-lite-260128
        prompt: turn this reference into a cinematic poster
        images:
        - https://example.com/input.webp
        size: 3K
        output_format: png
        optimize_prompt_options:
          mode: standard
      properties:
        model:
          type: string
          enum:
          - doubao-seedream-5-0-lite-260128
          - seedream-5-0-260128
          description: Seedream 5.0 image model name. Supports `doubao-seedream-5-0-lite-260128` and `seedream-5-0-260128`.
        prompt:
          type: string
          minLength: 1
          maxLength: 600
          description: Prompt (required).
        size:
          type: string
          description: Output image size (optional). Supported values are `2K`, `3K`, `2048x2048`, `2304x1728`, `1728x2304`,
            `2848x1600`, `1600x2848`, `2496x1664`, `1664x2496`, `3136x1344`, `3072x3072`, `3456x2592`, `2592x3456`, `4096x2304`,
            `2304x4096`, `2496x3744`, `3744x2496`, `4704x2016`.
          enum:
          - 2K
          - 3K
          - 2048x2048
          - 2304x1728
          - 1728x2304
          - 2848x1600
          - 1600x2848
          - 2496x1664
          - 1664x2496
          - 3136x1344
          - 3072x3072
          - 3456x2592
          - 2592x3456
          - 4096x2304
          - 2304x4096
          - 2496x3744
          - 3744x2496
          - 4704x2016
        image:
          type: string
          format: uri
          description: Single input image (optional, for image-to-image).
        images:
          type: array
          description: Multiple input images (optional, for image-to-image, up to 14 images).
          items:
            type: string
            format: uri
          minItems: 1
          maxItems: 14
        output_format:
          type: string
          enum:
          - jpeg
          - png
          description: Output format (optional).
        optimize_prompt_options:
          type: object
          additionalProperties: false
          description: Prompt optimization options (optional).
          properties:
            mode:
              type: string
              enum:
              - standard
              description: Only `standard` is supported for this model.
    WanImageGenerationRequest:
      type: object
      description: Wan image generation request. The real request path is `POST /v1/images/generations`; `model` dispatches
        to the Wan2.6 or Wan2.7 request body.
      oneOf:
      - $ref: '#/components/schemas/Wan26T2IImageGenerationRequest'
      - $ref: '#/components/schemas/Wan26I2IImageGenerationRequest'
      - $ref: '#/components/schemas/Wan27ImageGenerationRequest'
      discriminator:
        propertyName: model
        mapping:
          wan2.6-t2i: '#/components/schemas/Wan26T2IImageGenerationRequest'
          wan2.6-image: '#/components/schemas/Wan26I2IImageGenerationRequest'
          wan2.7-image: '#/components/schemas/Wan27ImageGenerationRequest'
          wan2.7-image-pro: '#/components/schemas/Wan27ImageGenerationRequest'
    Wan26T2IImageGenerationRequest:
      type: object
      additionalProperties: false
      required:
      - model
      - prompt
      description: Wan2.6 text-to-image request body.
      example:
        model: wan2.6-t2i
        prompt: 一个美丽的日落海景
        size: 1280*1280
        prompt_extend: false
        seed: 12345
      properties:
        model:
          type: string
          enum:
          - wan2.6-t2i
          description: Wan2.6 text-to-image model name.
        prompt:
          type: string
          minLength: 1
          maxLength: 2000
          description: Prompt (required).
        size:
          $ref: '#/components/schemas/Wan26ImageSize'
        negative_prompt:
          type: string
          maxLength: 500
          description: Negative prompt (optional).
        prompt_extend:
          type: boolean
          default: false
          description: Whether to enable prompt expansion (optional).
        seed:
          type: integer
          minimum: 0
          maximum: 2147483647
          description: Random seed (optional).
    Wan26I2IImageGenerationRequest:
      type: object
      additionalProperties: false
      required:
      - model
      - prompt
      description: Wan2.6 image-to-image request body. Provide at least `image` or `images`.
      example:
        model: wan2.6-image
        prompt: 将参考图改成电影海报风格
        images:
        - https://example.com/reference.png
        size: 1280*720
      anyOf:
      - required:
        - image
      - required:
        - images
      properties:
        model:
          type: string
          enum:
          - wan2.6-image
          description: Wan2.6 image-to-image model name.
        prompt:
          type: string
          minLength: 1
          maxLength: 2000
          description: Prompt (required).
        image:
          type: string
          format: uri
          description: Single input image URL (optional, mutually exclusive with `images`).
        images:
          type: array
          description: Input image array (optional; at least 1 image).
          items:
            type: string
            format: uri
          minItems: 1
        size:
          $ref: '#/components/schemas/Wan26ImageSize'
        negative_prompt:
          type: string
          maxLength: 500
          description: Negative prompt (optional).
        prompt_extend:
          type: boolean
          default: false
          description: Whether to enable prompt expansion (optional).
        seed:
          type: integer
          minimum: 0
          maximum: 2147483647
          description: Random seed (optional).
    Wan26ImageSize:
      type: string
      description: 'Output image size. Supported values: `1280*1280`, `800*1200`, `1200*800`, `960*1280`, `1280*960`, `720*1280`,
        `1280*720`, `1344*576`.'
      default: 1280*1280
      enum:
      - 1280*1280
      - 800*1200
      - 1200*800
      - 960*1280
      - 1280*960
      - 720*1280
      - 1280*720
      - 1344*576
    Wan27ImageGenerationRequest:
      type: object
      additionalProperties: false
      required:
      - model
      - prompt
      example:
        model: wan2.7-image-pro
        prompt: 电影感插画
        images:
        - https://cdn.example.com/reference.png
        size: 1024*1024
        bbox_list:
        - - - 0
            - 0
            - 12
            - 12
        color_palette:
        - hex: '#C2D1E6'
          ratio: 50.00%
        - hex: '#F4D06F'
          ratio: 30.00%
        - hex: '#7FA99B'
          ratio: 20.00%
        enable_sequential: false
        seed: 12345
      properties:
        model:
          type: string
          enum:
          - wan2.7-image
          - wan2.7-image-pro
          description: Wan image model name.
        prompt:
          type: string
          minLength: 1
          description: Prompt (required).
        image:
          type: string
          format: uri
          description: Single input image (optional, for image-to-image).
        images:
          type: array
          description: Multiple input images (optional, for image-to-image, up to 14 images).
          items:
            type: string
            format: uri
          minItems: 1
          maxItems: 14
        size:
          description: Output image size (optional). `wan2.7-image` supports `1K`, `2K`, or custom `width*height`; total pixels
            must stay between `768*768` and `2048*2048`, and aspect ratio must stay between `1:8` and `8:1`. `wan2.7-image-pro`
            supports `1K`, `2K`, `4K`, or custom `width*height`; only text-to-image without input images and without sequential
            mode supports `4K` and custom sizes up to `4096*4096`, while all other cases only support `2K` and `2048*2048`.
          oneOf:
          - type: string
            enum:
            - 1K
            - 2K
            - 4K
          - type: string
            description: Custom `width*height` string, for example `2048*2048` or `4096*4096`.
            pattern: ^[0-9]+\*[0-9]+$
            example: 1024*1024
        enable_sequential:
          type: boolean
          description: Whether to enable sequential multi-image mode (optional). Do not send it together with `thinking_mode`
            or `color_palette`.
        seed:
          type: integer
          minimum: 0
          maximum: 2147483647
          description: Random seed (optional).
        thinking_mode:
          type: boolean
          description: Whether to enable thinking mode (optional). Mutually exclusive with `enable_sequential=true`; sending
            both returns a parameter error.
          x-playground-omit-when:
          - path: enable_sequential
            equals: true
        bbox_list:
          allOf:
          - $ref: '#/components/schemas/Wan27BBoxList'
          description: Bounding box list (optional). The list length must match the number of input images. Each image supports
            at most 2 boxes, and each box uses the `[x1, y1, x2, y2]` coordinate format. Only available for image-to-image
            requests with input images.
        color_palette:
          allOf:
          - $ref: '#/components/schemas/Wan27ColorPalette'
          description: Color palette list (optional). Each item must contain `hex` and `ratio`. The number of colors must
            be between 3 and 10, with 8 recommended. Only available when sequential mode is disabled; do not send it together
            with `enable_sequential=true`.
          x-playground-omit-when:
          - path: enable_sequential
            equals: true
    PrunaImageGenerationRequest:
      type: object
      description: PrunaAI image generation request. The real request path is `POST /v1/images/generations`; exact `model`
        dispatches to the concrete `prunaai/p-image` or `prunaai/p-image-edit` request body.
      oneOf:
      - $ref: '#/components/schemas/PrunaPImageGenerationRequest'
      - $ref: '#/components/schemas/PrunaPImageEditGenerationRequest'
      discriminator:
        propertyName: model
        mapping:
          prunaai/p-image: '#/components/schemas/PrunaPImageGenerationRequest'
          prunaai/p-image-edit: '#/components/schemas/PrunaPImageEditGenerationRequest'
    PrunaPImageGenerationRequest:
      type: object
      additionalProperties: false
      required:
      - model
      - prompt
      example:
        model: prunaai/p-image
        prompt: a clean studio product photo of a ceramic cup
        size: 1024x1024
        aspect_ratio: '1:1'
        seed: 0
      properties:
        model:
          type: string
          enum:
          - prunaai/p-image
          description: PrunaAI text-to-image model name.
        prompt:
          type: string
          minLength: 1
          description: Prompt (required).
        size:
          type: string
          description: OpenAI-compatible size string. Supports common sizes and custom dimensions; custom dimensions can be
            used with `width` / `height`.
        aspect_ratio:
          type: string
          description: Output image aspect ratio. Use `custom` with `width` / `height` for custom dimensions.
          enum:
          - '1:1'
          - '16:9'
          - '9:16'
          - '3:2'
          - '2:3'
          - '3:4'
          - '4:3'
          - custom
        width:
          type: integer
          minimum: 256
          maximum: 1440
          description: Custom width, used only with `aspect_ratio=custom`; constrained to 256-1440.
        height:
          type: integer
          minimum: 256
          maximum: 1440
          description: Custom height, used only with `aspect_ratio=custom`; constrained to 256-1440.
        seed:
          type: integer
          description: Random seed (optional).
        disable_safety_checker:
          type: boolean
          description: Whether to disable the safety checker (optional).
    PrunaPImageEditGenerationRequest:
      type: object
      additionalProperties: false
      required:
      - model
      - prompt
      anyOf:
      - required:
        - image
      - required:
        - images
      - required:
        - extra_fields
      example:
        model: prunaai/p-image-edit
        prompt: edit this image into a clean product-style composition
        image: https://example.com/source.png
        extra_fields:
          input:
            images:
            - https://example.com/source.png
            aspect_ratio: '1:1'
            turbo: false
            seed: 0
      properties:
        model:
          type: string
          enum:
          - prunaai/p-image-edit
          description: PrunaAI image-edit model name.
        prompt:
          type: string
          description: Prompt (required).
        image:
          type: string
          format: uri
          description: Single input image URL.
        images:
          type: array
          description: Input image URL array.
          items:
            type: string
            format: uri
          minItems: 1
        extra_fields:
          type: object
          additionalProperties: true
          description: Extended parameter object. It may include `input.images`, `aspect_ratio`, `turbo`, `seed`, `disable_safety_checker`,
            and related options.
        aspect_ratio:
          type: string
          description: PrunaAI image-edit aspect ratio.
          enum:
          - '1:1'
          - '16:9'
          - '9:16'
          - '3:2'
          - '2:3'
          - '3:4'
          - '4:3'
        turbo:
          type: boolean
          description: Whether to enable turbo mode (optional).
        seed:
          type: integer
          description: Random seed (optional).
        disable_safety_checker:
          type: boolean
          description: Whether to disable the safety checker (optional).
    Wan27BBoxCoords:
      type: array
      description: Coordinates for a single bounding box in the format `[x1, y1, x2, y2]`.
      minItems: 4
      maxItems: 4
      items:
        type: integer
    Wan27BBoxPerImage:
      type: array
      description: Bounding box list for one input image, with at most 2 boxes.
      maxItems: 2
      items:
        $ref: '#/components/schemas/Wan27BBoxCoords'
    Wan27BBoxList:
      type: array
      description: Bounding box list. Its length must match the number of input images.
      maxItems: 9
      items:
        $ref: '#/components/schemas/Wan27BBoxPerImage'
    Wan27ColorPaletteItem:
      type: object
      additionalProperties: false
      required:
      - hex
      - ratio
      properties:
        hex:
          type: string
          description: HEX color value.
          pattern: ^#[0-9A-Fa-f]{6}$
        ratio:
          type: string
          description: Color percentage. The sum of all `ratio` values must equal `100.00%`.
          pattern: ^([0-9]|[1-9][0-9]|100)\.[0-9]{2}%$
    Wan27ColorPalette:
      type: array
      description: Color palette list.
      minItems: 3
      maxItems: 10
      items:
        $ref: '#/components/schemas/Wan27ColorPaletteItem'
    ImaImageGenerationResponse:
      type: object
      additionalProperties: true
      description: OpenAI Images compatible response (different upstreams may return url or b64_json).
      properties:
        created:
          type: integer
          format: int64
          description: Response creation time (Unix seconds).
        data:
          type: array
          description: Generate a list of results.
          items:
            type: object
            additionalProperties: true
            properties:
              url:
                type: string
                format: uri
                description: Image URL (when the link is returned from the upstream). It is recommended to download and save
                  it immediately after receiving it. The default validity period is about 30 days.
              b64_json:
                type: string
                description: Base64 encoded image (when upstream returns binary).
              revised_prompt:
                type: string
                description: Upstream revised prompt word (if any).
    ImaImageCreateTaskResponse:
      type: object
      additionalProperties: true
      description: Image asynchronous task submission response.
      properties:
        id:
          type: string
          description: Public task ID.
        task_id:
          type: string
          description: Same as `id`.
        object:
          type: string
          example: image
        model:
          type: string
        status:
          type: string
          description: Initial state (e.g. `queued` / `in_progress`).
        progress:
          type: integer
          minimum: 0
          maximum: 100
        amount_usd:
          type: number
          format: double
          minimum: 0
          description: USD amount for the completed task, when returned.
        created_at:
          type: integer
          format: int64
    PrunaImageCreateTaskResponse:
      type: object
      additionalProperties: true
      description: PrunaAI image task submission response, including task ID, status, and creation time.
      properties:
        id:
          type: string
          description: Public task ID.
        task_id:
          type: string
          description: Same as `id`.
        object:
          type: string
          example: image
        model:
          type: string
        status:
          type: string
          description: Initial state (e.g. `queued` / `in_progress`).
        progress:
          type: integer
          minimum: 0
          maximum: 100
        created_at:
          type: integer
          format: int64
    ImaImageTaskFetchResponse:
      type: object
      additionalProperties: true
      properties:
        code:
          type: string
          example: success
        data:
          type: object
          additionalProperties: true
          properties:
            task_id:
              type: string
            status:
              type: string
              description: Task status (such as queued/processing/succeeded/failed).
            format:
              type: string
              description: Output format (if recognized).
            url:
              type: string
              description: Returns the result link after success. This link is a resource hosted by the platform. It is recommended
                to download and save it immediately after receiving it. It will expire after about 30 days.
            error:
              nullable: true
              oneOf:
              - type: object
                additionalProperties: true
              - type: string
            metadata:
              nullable: true
              oneOf:
              - type: object
                additionalProperties: true
              - type: string
              - type: 'null'
            amount_usd:
              type: number
              format: double
              minimum: 0
              description: USD amount for the completed task, when returned.
            usage:
              type: object
              additionalProperties: true
              description: Usage information, when returned.
              properties:
                input_tokens:
                  type: integer
                  minimum: 0
                  description: Enter token
                output_tokens:
                  type: integer
                  minimum: 0
                  description: output token
                total_tokens:
                  type: integer
                  minimum: 0
                  description: total tokens
    ImaProCreateResponse:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
          description: Public task ID.
        task_id:
          type: string
          description: Same as `id`.
        object:
          type: string
          example: video
        model:
          type: string
        status:
          type: string
        progress:
          type: integer
          minimum: 0
          maximum: 100
        created_at:
          type: integer
          format: int64
    ImaProQueryResponse:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
          description: Public task ID.
        task_id:
          type: string
          description: Same as `id`.
        object:
          type: string
          example: video
        model:
          type: string
          description: Model name.
        status:
          type: string
          description: OpenAI style status (e.g. `queued` / `in_progress` / `completed` / `failed`).
        progress:
          type: integer
          minimum: 0
          maximum: 100
        created_at:
          type: integer
          format: int64
        completed_at:
          type: integer
          format: int64
        amount_usd:
          type: number
          format: double
          minimum: 0
          description: Actual dollar amount charged. It will only be returned after the task is successfully completed and
            the deduction is confirmed; it will not be returned when the task is queued, in processing, failed or the deduction
            confirmation has not been completed.
        metadata:
          type: object
          additionalProperties: true
          description: Metadata (usually contains `url`). If `url` is included, it is recommended to perform persistent archiving
            with a 30-day TTL.
        results:
          type: array
          description: List of results (usually contains the video URL on success).
          items:
            type: object
            additionalProperties: true
            properties:
              url:
                type: string
                format: uri
                description: Video result address. This address is a short-term link hosted by the platform. It is recommended
                  to download and save it immediately after receiving it. It will expire after about 30 days by default.
              size:
                type: integer
              content_type:
                type: string
        usage:
          type: object
          additionalProperties: true
          description: Upstream usage information (transparent transmission).
          properties:
            prompt_tokens:
              type: integer
            completion_tokens:
              type: integer
            total_tokens:
              type: integer
        error:
          type: object
          nullable: true
          description: The error object when the task fails.
          properties:
            code:
              type: string
              example: task_failed
            message:
              type: string
              example: 'video generation failed: internal error: 601300'
    ErrorResponse:
      type: object
      additionalProperties: true
      properties:
        error:
          oneOf:
          - type: string
          - type: object
            additionalProperties: true
    TaskErrorResponse:
      type: object
      additionalProperties: true
      description: 'Task interface (create/query) error return.

        Common fields:

        - `code`: error code (may be business code or HTTP string code)

        - `message`: error description

        - `data`: usually `null`

        Examples of common errors:

        - `text_to_video requires one text content item`

        - `status_code=500, task_id is empty`

        - `the parameter video pixel count specified in the request must be less than or equal to 927408`

        - `Portraits are not supported yet`'
      required:
      - code
      - message
      properties:
        code:
          oneOf:
          - type: string
          - type: integer
          description: Error code (such as `invalid_request`, `missing_model`, `task_not_exist`, `500`).
        message:
          type: string
          description: Error description.
        data:
          nullable: true
          description: Extended data; currently implemented mostly as `null`.
    MjSubmitResponse:
      type: object
      additionalProperties: true
      properties:
        code:
          type: integer
          description: 1=success, other=failure.
        result:
          type: string
          description: Task ID.
        description:
          type: string
          description: Descriptive information.
    MjTaskFetchResponse:
      type: object
      additionalProperties: true
      properties:
        mj_id:
          type: string
          description: MJ task ID.
        status:
          type: string
          enum:
          - ''
          - SUCCESS
          - FAILURE
          description: Task status.
        progress:
          type: string
          example: 100%
        imageUrl:
          type: string
          format: uri
          description: The address of the first image (compatibility field). The platform hosts short-term links. It is recommended
            to download and save them immediately after receiving them. By default, they will expire after about 30 days.
        urls:
          type: array
          description: Complete image list (recommended for priority use). The platform hosts short-term links. It is recommended
            to download and save them immediately after receiving them. By default, they will expire after about 30 days.
          items:
            type: string
            format: uri
        action:
          type: string
          description: Task action type (such as `IMAGINE`, `UPSCALE`).
        failReason:
          type: string
          description: Reason for failure (may occur when failure occurs).
        buttons:
          type: array
          items:
            type: object
            additionalProperties: true
    ModelItem:
      type: object
      properties:
        id:
          type: string
          description: model identification
        object:
          type: string
          example: model
        created:
          type: integer
          description: Model creation time (Unix seconds, compatible field)
        owned_by:
          type: string
          description: Upstream supplier identification
        supported_endpoint_types:
          type: array
          description: Endpoint types supported by the model
          items:
            type: string
        reasoning:
          type: boolean
          description: Whether the model supports reasoning (only returned based on gateway configuration)
    ModelsListResponse:
      type: object
      properties:
        object:
          type: string
          example: list
        success:
          type: boolean
          example: true
        data:
          type: array
          items:
            $ref: '#/components/schemas/ModelItem'
    ChatCompletionRequest:
      type: object
      required:
      - model
      - messages
      properties:
        model:
          type: string
          description: Model name
          enum:
          - gpt-4.1
          - gpt-4.1-mini
          - gpt-4.1-nano
          - gpt-4o
          - gpt-4o-mini
          - gpt-5
          - gpt-5-mini
          - gpt-5.1
          - MiniMax-Text-01
          - MiniMax-M1
          - MiniMax-M2
          - MiniMax-M2.1
          - MiniMax-M2.1-highspeed
          - MiniMax-M2.5
          - MiniMax-M2.5-highspeed
          - claude-sonnet-4-5-20250929
          - claude-sonnet-4-6
          - claude-haiku-4-5-20251001
          - claude-opus-4-5-20251101
          - claude-opus-4-6
          - claude-opus-4-7
          - kimi-for-coding
          - deepseek-v4-pro
          - deepseek-v4-flash
          - gpt-5.4-mini
          - seed-sc-260215
        messages:
          type: array
          items:
            type: object
            required:
            - role
            - content
            properties:
              role:
                type: string
                enum:
                - system
                - user
                - assistant
              content:
                type: string
        stream:
          type: boolean
          default: false
          description: Whether to enable streaming responses
        temperature:
          type: number
          minimum: 0
          maximum: 2
          default: 1
        max_tokens:
          type: integer
          description: Maximum number of generated tokens
        tools:
          type: array
          description: Function tool definition (OpenAI compatible)
          items:
            type: object
            required:
            - type
            - function
            properties:
              type:
                type: string
                enum:
                - function
              function:
                type: object
                required:
                - name
                - parameters
                properties:
                  name:
                    type: string
                  description:
                    type: string
                  parameters:
                    type: object
        tool_choice:
          description: Tool selection strategy
          oneOf:
          - type: string
            enum:
            - none
            - auto
            - required
          - type: object
            properties:
              type:
                type: string
                enum:
                - function
              function:
                type: object
                properties:
                  name:
                    type: string
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          example: chat.completion
        model:
          type: string
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              message:
                type: object
                properties:
                  role:
                    type: string
                  content:
                    type: string
                  tool_calls:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                          enum:
                          - function
                        function:
                          type: object
                          properties:
                            name:
                              type: string
                            arguments:
                              type: string
              finish_reason:
                type: string
        usage:
          type: object
          properties:
            prompt_tokens:
              type: integer
            completion_tokens:
              type: integer
            total_tokens:
              type: integer
    ResponsesRequest:
      type: object
      required:
      - model
      - input
      properties:
        model:
          type: string
          enum:
          - gpt-5.2
          - gpt-5.3-codex
          - gpt-5.4
          - gpt-5.5
        input:
          type: string
          description: Enter text
        max_output_tokens:
          type: integer
          description: Maximum number of output tokens
        temperature:
          type: number
          minimum: 0
          maximum: 2
        stream:
          type: boolean
          default: false
    ResponsesResponse:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          example: response
        model:
          type: string
        status:
          type: string
          example: completed
        output:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              role:
                type: string
              content:
                type: array
                items:
                  type: object
                  properties:
                    type:
                      type: string
                    text:
                      type: string
        usage:
          type: object
          properties:
            input_tokens:
              type: integer
            output_tokens:
              type: integer
            total_tokens:
              type: integer
    AnthropicMessagesRequest:
      type: object
      required:
      - model
      - anthropic_version
      - max_tokens
      - messages
      properties:
        model:
          type: string
          enum:
          - claude-sonnet-4-5-20250929
          - claude-sonnet-4-6
          - claude-haiku-4-5-20251001
          - claude-opus-4-5-20251101
          - claude-opus-4-6
          - claude-opus-4-7
          - glm-5.1
          - deepseek-v4-flash
          description: Anthropic Messages model name.
        anthropic_version:
          type: string
          default: bedrock-2023-05-31
          enum:
          - bedrock-2023-05-31
          description: Anthropic Bedrock API version. Must be `bedrock-2023-05-31`.
        max_tokens:
          type: integer
          default: 4096
          description: Maximum number of output tokens
        messages:
          type: array
          items:
            type: object
            required:
            - role
            - content
            properties:
              role:
                type: string
                enum:
                - user
                - assistant
              content:
                type: string
        system:
          type: string
          description: System prompt word
        temperature:
          type: number
          minimum: 0
          maximum: 1
          default: 1
        stream:
          type: boolean
          default: false
          description: Whether to stream responses. Playground always sends non-streaming requests.
    AnthropicMessagesResponse:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          example: message
        role:
          type: string
          example: assistant
        model:
          type: string
        content:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              text:
                type: string
        stop_reason:
          type: string
        usage:
          type: object
          properties:
            input_tokens:
              type: integer
            output_tokens:
              type: integer
    EmbeddingRequest:
      type: object
      required:
      - model
      - input
      properties:
        model:
          type: string
          enum:
          - text-embedding-3-large
          - text-embedding-3-small
          description: Embedding model name. Currently supports `text-embedding-3-large` and `text-embedding-3-small`.
        input:
          oneOf:
          - type: string
          - type: array
            items:
              type: string
          description: Text to encode; either a string or an array of strings.
        encoding_format:
          type: string
          enum:
          - float
          - base64
          default: float
          description: 'Vector encoding: float (default) JSON numbers or base64 packed string.'
        dimensions:
          type: integer
          minimum: 1
          maximum: 3072
          description: Explicit output dimensionality; useful for storage compression or matching downstream index shape.
        user:
          type: string
          description: End-user identifier forwarded upstream for abuse monitoring (optional).
    EmbeddingResponse:
      type: object
      properties:
        object:
          type: string
          example: list
        data:
          type: array
          items:
            type: object
            properties:
              object:
                type: string
                example: embedding
              index:
                type: integer
              embedding:
                type: array
                items:
                  type: number
                  format: float
        model:
          type: string
          example: text-embedding-3-large
        usage:
          type: object
          properties:
            prompt_tokens:
              type: integer
            total_tokens:
              type: integer
    MidjourneyImagineRequest:
      type: object
      required:
      - model
      properties:
        model:
          type: string
          enum:
          - mj_imagine
          - mj_blend
          description: Midjourney action type; imagine = text-to-image, blend = multi-image blend.
        prompt:
          type: string
          description: Prompt text. It may include MJ flags such as `--ar`, `--niji`, `--stylize`, `--sref`, `--sw`, `--p`,
            `--iw`, `--c`, and `--w`. When using `--iw`, start the prompt with an image URL.
        base64Array:
          type: array
          items:
            type: string
          description: 'blend only: 2~5 image data URLs (image/png|jpeg, base64).'
        dimensions:
          type: string
          enum:
          - PORTRAIT
          - SQUARE
          - LANDSCAPE
          description: Blend output aspect ratio.
        botType:
          type: string
          enum:
          - MID_JOURNEY
          - NIJI_JOURNEY
          default: MID_JOURNEY
          description: Rendering bot; default MID_JOURNEY, alternative NIJI_JOURNEY.
        state:
          type: string
          description: Free-form business context for callback correlation. It does not affect image generation.
    MidjourneyChangeRequest:
      type: object
      required:
      - model
      - taskId
      - customId
      properties:
        model:
          type: string
          enum:
          - mj_upscale
          - mj_variation
          - mj_low_variation
          - mj_high_variation
          - mj_reroll
          - mj_zoom
          - mj_custom_zoom
          - mj_pan
          description: Follow-up operation; pair with the parent task's customId.
        taskId:
          type: string
          description: Parent task ID (result of the imagine call).
        customId:
          type: string
          description: '`buttons[].customId` from the parent task; must match exactly.'
        prompt:
          type: string
          description: Optional prompt (e.g. custom_zoom requires it; ignored for plain upscale).
        state:
          type: string
          description: Business context, echoed in the callback.
    MidjourneyModalRequest:
      type: object
      required:
      - model
      - taskId
      - customId
      properties:
        model:
          type: string
          enum:
          - mj_remix
          description: Remix / regional edit operation.
        taskId:
          type: string
          description: Parent task ID.
        customId:
          type: string
          description: RemixModal button customId.
        prompt:
          type: string
          description: New remix prompt.
        maskBase64:
          type: string
          description: Optional mask image (base64 PNG) for regional edit.
        state:
          type: string
          description: Business context.
    MidjourneySubmitResponse:
      type: object
      properties:
        code:
          type: integer
          example: 1
          description: 1 = accepted. Other codes are described by the `description` field.
        description:
          type: string
          example: Submit success
        result:
          type: string
          example: '1751234567890'
          description: Task ID; use it to poll status.
        properties:
          type: object
          additionalProperties: true
    MidjourneyTaskResponse:
      type: object
      properties:
        id:
          type: string
          example: '1751234567890'
        action:
          type: string
          example: IMAGINE
        status:
          type: string
          enum:
          - NOT_START
          - SUBMITTED
          - MODAL
          - IN_PROGRESS
          - FAILURE
          - SUCCESS
          - CANCEL
          description: 'State machine: NOT_START → SUBMITTED → IN_PROGRESS → SUCCESS|FAILURE|CANCEL.'
        progress:
          type: string
          example: 100%
        prompt:
          type: string
        promptEn:
          type: string
        imageUrl:
          type: string
          format: uri
          description: Result image URL (returned on success; short-lived, download promptly).
        buttons:
          type: array
          items:
            type: object
            properties:
              customId:
                type: string
              label:
                type: string
              emoji:
                type: string
              style:
                type: integer
        properties:
          type: object
          additionalProperties: true
    ImageGenerationRequest:
      type: object
      required:
      - model
      - prompt
      properties:
        model:
          type: string
          enum:
          - seedream-5-0-260128
          - doubao-seedream-5-0-lite-260128
        prompt:
          type: string
          description: Image description
        size:
          type: string
          description: Image size (seedream requires ≥ 3686400 pixels, such as 1920x1920)
          default: 1920x1920
    ImageGenerationResponse:
      type: object
      properties:
        created:
          type: integer
        data:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
              b64_json:
                type: string
    ViduVideoRequest:
      type: object
      title: Vidu video (viduq1 / viduq2 / viduq3)
      required:
      - model
      properties:
        model:
          type: string
          enum:
          - viduq1
          - viduq2
          - viduq2-pro
          - viduq2-turbo
          - viduq3-pro
          - viduq3-turbo
          description: 'Vidu video model.

            - `viduq1`: fixed 1080P/5s

            - `viduq2`: text-to-video

            - `viduq2-pro`: image-to-video only

            - `viduq2-turbo`: image-to-video only

            - `viduq3-pro`: text-to-video / image-to-video, billed per second

            - `viduq3-turbo`: text-to-video / image-to-video, billed per second'
        prompt:
          type: string
          description: Video prompt. Required for text-to-video; optional for image-to-video.
        images:
          type: array
          items:
            type: string
          description: '**Important: Reference image URL array for image-to-video. Please ensure that the input URL is accessible
            at the time of submission. **


            - Single image: reference image-to-video

            - Two images: first and last frames (the first image = first frame, the second image = last frame)

            - `viduq2-pro`, `viduq2-turbo` support image-to-video only (images are required)'
        duration:
          type: integer
          default: 5
          description: 'Video duration (seconds).

            - `viduq1`: fixed 5s

            - `viduq2` series: supports 4~8s

            - `viduq3` series: supports 1~16s'
        size:
          type: string
          default: '16:9'
          description: Aspect ratio, such as `16:9` (default), `9:16`, `1:1`.
        metadata:
          type: object
          description: Extended parameters.
          properties:
            resolution:
              type: string
              enum:
              - 540p
              - 720p
              - 1080p
              default: 1080p
              description: Resolution, default `1080p`.
    PixverseVideoCreateRequest:
      type: object
      title: Pixverse video request
      required:
      - model
      - prompt
      additionalProperties: false
      description: Pixverse video generation request body for `pixverse-c1` and `pixverse-v6`.
      properties:
        model:
          type: string
          enum:
          - pixverse-c1
          - pixverse-v6
          description: Pixverse video model name.
        prompt:
          type: string
          minLength: 1
          description: Video prompt (required).
        duration:
          type: integer
          default: 5
          description: Video duration in seconds, default 5.
        size:
          type: string
          default: '16:9'
          enum:
          - '16:9'
          - '9:16'
          - '1:1'
          description: Output aspect ratio, default `16:9`.
        quality:
          type: string
          default: 720p
          enum:
          - 360p
          - 540p
          - 720p
          - 1080p
          description: Output resolution tier.
        metadata:
          type: object
          additionalProperties: true
          description: Pixverse advanced parameters.
          properties:
            img_id:
              type: integer
              description: Pixverse image ID; when present, submit as image-to-video.
            audio:
              type: boolean
              description: Whether to generate audio.
            generate_audio_switch:
              type: boolean
              description: Alternate field for whether to generate audio.
            negative_prompt:
              type: string
              description: Negative prompt.
    VeoVideoCreateRequest:
      type: object
      title: Veo video request
      required:
      - model
      - prompt
      additionalProperties: false
      description: Veo video generation request body for `veo-3.0-generate-001` and `veo-3.1-fast-generate-001`.
      properties:
        model:
          type: string
          enum:
          - veo-3.0-generate-001
          - veo-3.1-fast-generate-001
          description: Veo video model name.
        prompt:
          type: string
          minLength: 1
          description: Video prompt (required).
        image:
          type: string
          description: Optional first-frame image URL.
        images:
          type: array
          minItems: 1
          maxItems: 3
          description: Image URL array. For `veo-3.1-fast-generate-001`, use this field for 1 to 3 reference images. Two images
            default to reference-image video unless `metadata.role_mode=frame` is set for first/last-frame video. Do not use
            `reference_image_urls` for Veo 3.1.
          items:
            type: string
        duration:
          type: integer
          enum:
          - 4
          - 8
          description: Video duration in seconds. Only 4 or 8 is supported.
        seconds:
          type: string
          enum:
          - '4'
          - '8'
          description: String alias for video duration. Only `"4"` or `"8"` is supported.
        durationSeconds:
          type: integer
          enum:
          - 4
          - 8
          description: Video duration field. Only 4 or 8 is supported.
        resolution:
          type: string
          enum:
          - 720p
          - 1080p
          - 4k
          description: Output resolution. Veo 3.0 supports 720p/1080p; Veo 3.1 Fast also supports 4k.
        aspect_ratio:
          type: string
          enum:
          - '16:9'
          - '9:16'
          description: Output aspect ratio.
        aspectRatio:
          type: string
          enum:
          - '16:9'
          - '9:16'
          description: Output aspect ratio field.
        size:
          type: string
          description: Optional size string that may derive resolution or aspect ratio.
        metadata:
          type: object
          additionalProperties: false
          description: Veo advanced parameters.
          properties:
            durationSeconds:
              type: integer
              enum:
              - 4
              - 8
              description: Video duration field. Only 4 or 8 is supported.
            resolution:
              type: string
              enum:
              - 720p
              - 1080p
              - 4k
              description: Output resolution.
            aspectRatio:
              type: string
              enum:
              - '16:9'
              - '9:16'
              description: Output aspect ratio.
            aspect_ratio:
              type: string
              enum:
              - '16:9'
              - '9:16'
              description: Output aspect ratio alias.
            negativePrompt:
              type: string
              description: Negative prompt.
            personGeneration:
              type: string
              enum:
              - allow_all
              - allow_adult
              - dont_allow
              description: 'Person generation policy. Allowed values: `allow_all`, `allow_adult`, `dont_allow`.'
            storageUri:
              type: string
              description: Storage URI.
            compressionQuality:
              type: string
              enum:
              - optimized
              - lossless
              description: 'Compression quality. Allowed values: `optimized`, `lossless`.'
            resizeMode:
              type: string
              description: Resize mode.
            seed:
              type: integer
              description: Random seed.
            role_mode:
              type: string
              enum:
              - reference
              - frame
              description: Veo 3.1 image role mode. `reference` keeps `images` as reference images; `frame` treats two images
                as first and last frames.
    KlingVideoRequest:
      type: object
      title: Kling legacy video (v1 / v1.6 / v2.x / o1)
      required:
      - model
      properties:
        model:
          type: string
          enum:
          - kling-v1
          - kling-v1-6
          - kling-v2-master
          - kling-v2-1-master
          - kling-v2-5-turbo
          - kling-v2-6
          - kling-video-o1
          description: Kling video model name.
        prompt:
          type: string
          description: Video description prompt words. Required when submitting a video.
        negative_prompt:
          type: string
          description: Reverse prompt word (optional) describing unwanted content.
        image:
          type: string
          description: Reference image URL (required for image-to-video). Ensure the input URL is accessible at submission
            time and the image has valid dimensions and pixels; otherwise the upstream service may return `Image pixel is
            invalid`.
        image_tail:
          type: string
          description: Last-frame image URL (first/last frame mode, optional). Ensure the input URL is accessible at submission
            time and the image has valid dimensions and pixels; otherwise the upstream service may return `Image pixel is
            invalid`.
        mode:
          type: string
          enum:
          - std
          - pro
          default: std
          description: Quality mode. `std` (standard, default) or `pro` (high quality). Master Edition models do not have
            this distinction.
        duration:
          type: integer
          enum:
          - 5
          - 10
          default: 5
          description: Video duration (seconds), supports 5 or 10, default is 5.
        aspect_ratio:
          type: string
          enum:
          - '1:1'
          - '16:9'
          - '9:16'
          default: '1:1'
          description: Aspect ratio, default `1:1`.
        cfg_scale:
          type: number
          default: 0.5
          description: Generate degrees of freedom, 0~1, default 0.5. The smaller the value, the more free it is, and the
            larger the value, the closer it is to the prompt word.
        camera_control:
          type: object
          description: Lens control parameters (optional).
          properties:
            type:
              type: string
              description: Control type.
            config:
              type: object
              description: Lens parameters (horizontal, vertical, pan, tilt, roll, zoom).
    KlingText2VideoRequest:
      type: object
      description: Kling text-to-video request parameters. Use `model` to specify the Kling video model.
      required:
      - model
      - prompt
      properties:
        model:
          type: string
          enum:
          - kling-v1
          - kling-v1-6
          - kling-v2-master
          - kling-v2-1-master
          - kling-v2-5-turbo
          - kling-v2-6
          - kling-video-o1
          description: Kling video model name.
        prompt:
          type: string
          description: Video description prompt words.
        negative_prompt:
          type: string
          description: Reverse prompt word (optional) describing unwanted content.
        mode:
          type: string
          enum:
          - std
          - pro
          default: std
          description: Quality mode. `std` (standard, default) or `pro` (high quality). Master Edition models do not have
            this distinction.
        duration:
          type: integer
          enum:
          - 5
          - 10
          default: 5
          description: Video duration (seconds), supports 5 or 10, default is 5.
        aspect_ratio:
          type: string
          enum:
          - '1:1'
          - '16:9'
          - '9:16'
          default: '1:1'
          description: Aspect ratio, default `1:1`.
        cfg_scale:
          type: number
          default: 0.5
          description: Generate degrees of freedom, 0~1, default 0.5. The smaller the value, the more free it is, and the
            larger the value, the closer it is to the prompt word.
        camera_control:
          type: object
          description: Lens control parameters (optional).
          properties:
            type:
              type: string
              description: Control type.
            config:
              type: object
              description: Lens parameters (horizontal, vertical, pan, tilt, roll, zoom).
    KlingImage2VideoRequest:
      type: object
      description: Kling image-to-video request parameters. Use `model` to specify the Kling video model.
      required:
      - model
      - image
      properties:
        model:
          type: string
          enum:
          - kling-v1
          - kling-v1-6
          - kling-v2-master
          - kling-v2-1-master
          - kling-v2-5-turbo
          - kling-v2-6
          - kling-video-o1
          description: Kling video model name.
        image:
          type: string
          description: Reference image URL (required for image-to-video). Ensure the input URL is accessible at submission
            time and the image has valid dimensions and pixels; otherwise the upstream service may return `Image pixel is
            invalid`.
        image_tail:
          type: string
          description: Last-frame image URL (first/last frame mode, optional). Ensure the input URL is accessible at submission
            time and the image has valid dimensions and pixels; otherwise the upstream service may return `Image pixel is
            invalid`.
        prompt:
          type: string
          description: Video description prompt words. Optional when creating a video.
        negative_prompt:
          type: string
          description: Reverse prompt word (optional) describing unwanted content.
        mode:
          type: string
          enum:
          - std
          - pro
          default: std
          description: Quality mode. `std` (standard, default) or `pro` (high quality). Master Edition models do not have
            this distinction.
        duration:
          type: integer
          enum:
          - 5
          - 10
          default: 5
          description: Video duration (seconds), supports 5 or 10, default is 5.
        aspect_ratio:
          type: string
          enum:
          - '1:1'
          - '16:9'
          - '9:16'
          default: '1:1'
          description: Aspect ratio, default `1:1`.
        cfg_scale:
          type: number
          default: 0.5
          description: Generate degrees of freedom, 0~1, default 0.5. The smaller the value, the more free it is, and the
            larger the value, the closer it is to the prompt word.
        camera_control:
          type: object
          description: Lens control parameters (optional).
          properties:
            type:
              type: string
              description: Control type.
            config:
              type: object
              description: Lens parameters (horizontal, vertical, pan, tilt, roll, zoom).
    KlingUnifiedVideoRequest:
      type: object
      description: Kling universal video endpoint request parameters, applicable to `POST /v1/video/generations`, the same
        JSON request body is also compatible with `POST /v1/videos`.
      required:
      - model
      properties:
        model:
          type: string
          enum:
          - kling-v1
          - kling-v1-6
          - kling-v2-master
          - kling-v2-1-master
          - kling-v2-5-turbo
          - kling-v2-6
          - kling-video-o1
          description: Kling video model name.
        prompt:
          type: string
          description: Video prompt. Required for text-to-video; optional for image-to-video.
        image:
          type: string
          description: Image-to-video reference image URL. This field is recommended for single-image input. Ensure the input
            URL is accessible at submission time and the image has valid dimensions and pixels; otherwise the upstream service
            may return `Image pixel is invalid`.
        images:
          type: array
          items:
            type: string
          description: Image-to-video reference image URL array. Use this field when multiple images are required; for Kling
            first/last frame mode, prefer putting the last frame in `metadata.image_tail`. Ensure each input URL is accessible
            at submission time and each image has valid dimensions and pixels; otherwise the upstream service may return `Image
            pixel is invalid`.
        duration:
          type: integer
          enum:
          - 5
          - 10
          default: 5
          description: Video duration (seconds).
        size:
          type: string
          enum:
          - '1:1'
          - '16:9'
          - '9:16'
          default: '1:1'
          description: aspect ratio. Common endpoints are mapped to Kling's `aspect_ratio`.
        metadata:
          type: object
          description: Kling vendor parameters.
          properties:
            mode:
              type: string
              enum:
              - std
              - pro
              default: std
              description: Quality mode. `std` (standard, default) or `pro` (high quality).
            image_tail:
              type: string
              description: Last-frame image URL (first/last frame mode). Ensure the input URL is accessible at submission
                time and the image has valid dimensions and pixels; otherwise the upstream service may return `Image pixel
                is invalid`.
            negative_prompt:
              type: string
              description: Reverse cue words.
            cfg_scale:
              type: number
              default: 0.5
              description: Generate degrees of freedom, 0~1, default 0.5.
            camera_control:
              type: object
              description: Lens control parameters.
    MiniMaxVideoGenerationRequest:
      type: object
      required:
      - model
      additionalProperties: false
      properties:
        model:
          type: string
          enum:
          - MiniMax-Hailuo-02
          - MiniMax-Hailuo-2.3
          - MiniMax-Hailuo-2.3-Fast
          description: MiniMax video model (MiniMax only).
        prompt:
          type: string
          description: Video description
        duration:
          type: integer
          enum:
          - 6
          - 10
          default: 6
          description: Video duration (seconds), currently only 6 or 10 are supported.
        size:
          type: string
          enum:
          - 512p
          - 768p
          - 1080p
          default: 768p
          description: Resolution (verified by model capability).
        metadata:
          type: object
          description: 'MiniMax vendor parameters.

            - Image-to-video: `{"first_frame_image":"URL"}`'
          properties:
            first_frame_image:
              type: string
              description: First-frame image URL for Hailuo image-to-video (`MiniMax-Hailuo-2.3-Fast` required). Please ensure
                that the input URL is accessible at the time of submission.
      allOf:
      - if:
          properties:
            model:
              const: MiniMax-Hailuo-2.3-Fast
        then:
          required:
          - metadata
          properties:
            size:
              type: string
              enum:
              - 768p
              - 1080p
            metadata:
              type: object
              required:
              - first_frame_image
      - if:
          properties:
            model:
              const: MiniMax-Hailuo-2.3-Fast
            size:
              const: 1080p
        then:
          properties:
            duration:
              type: integer
              enum:
              - 6
      - if:
          properties:
            model:
              const: MiniMax-Hailuo-2.3
        then:
          properties:
            size:
              type: string
              enum:
              - 768p
              - 1080p
      - if:
          properties:
            model:
              const: MiniMax-Hailuo-2.3
            size:
              const: 1080p
        then:
          properties:
            duration:
              type: integer
              enum:
              - 6
      - if:
          properties:
            model:
              const: MiniMax-Hailuo-02
        then:
          properties:
            size:
              type: string
              enum:
              - 512p
              - 768p
              - 1080p
      - if:
          properties:
            model:
              const: MiniMax-Hailuo-02
            size:
              const: 1080p
        then:
          properties:
            duration:
              type: integer
              enum:
              - 6
    VideoTaskResponse:
      type: object
      properties:
        id:
          type: string
        task_id:
          type: string
        object:
          type: string
          example: video
        model:
          type: string
        status:
          type: string
          enum:
          - ''
          - in_progress
          - completed
          - failed
          description: An empty string indicates that it has been submitted for processing
        progress:
          type: integer
          minimum: 0
          maximum: 100
        created_at:
          type: integer
        completed_at:
          type: integer
        metadata:
          type: object
          properties:
            url:
              type: string
              description: Video download link (value when completed). This link is a short-term resource hosted by the platform.
                It is recommended to download and save it immediately after receiving it. It will expire after about 30 days
                by default.
    ConsumeCallbackEvent:
      type: object
      required:
      - request_id
      - user_id
      - username
      - token_id
      - token_name
      - sk
      - model_name
      - channel_id
      - billing_source
      - prompt_tokens
      - completion_tokens
      - total_tokens
      - quota
      - amount_usd
      - timestamp
      - event_phase
      properties:
        request_id:
          type: string
          description: 'Gateway request ID (can be used for reconciliation with usage logs).

            This field is consistent with `X-Trace-Id` when the caller request header carries `X-Trace-Id`.'
        user_id:
          type: integer
          description: User ID (compatible field, it is recommended to use username first)
          deprecated: true
        username:
          type: string
          description: Username (recommended)
        token_id:
          type: integer
          description: Token ID (compatible field, it is recommended to use sk first)
          deprecated: true
        token_name:
          type: string
          description: Token name
        sk:
          type: string
          description: Call the SK of this request (with sk- prefix)
        model_name:
          type: string
          description: Actual request model name
        channel_id:
          type: integer
          description: The actual hit channel ID
        billing_source:
          type: string
          enum:
          - wallet
          - subscription
          description: Deduction source.
        prompt_tokens:
          type: integer
          minimum: 0
        completion_tokens:
          type: integer
          minimum: 0
        total_tokens:
          type: integer
          minimum: 0
        quota:
          type: integer
          minimum: 0
          description: Quota value for this event.
        amount_usd:
          type: number
          format: double
          minimum: 0
          description: USD amount for this event.
        timestamp:
          type: integer
          format: int64
          description: Event generation time (Unix seconds)
        event_phase:
          type: string
          enum:
          - settle
          description: Event phase, currently only `settle` is sent.
    ConsumeCallbackAck:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
          example: accepted
    MjSubmitRequest:
      type: object
      required:
      - prompt
      properties:
        prompt:
          type: string
          description: MJ prompt word (supports --ar, --v and other parameters)
    MjChangeRequest:
      type: object
      required:
      - action
      - taskId
      - index
      properties:
        action:
          type: string
          enum:
          - UPSCALE
          - VARIATION
          - REROLL
        taskId:
          type: string
          description: Original task ID
        index:
          type: integer
          minimum: 1
          maximum: 4
          description: Image index (1-4)
    MjTaskResponse:
      type: object
      properties:
        mj_id:
          type: string
        status:
          type: string
          enum:
          - ''
          - SUCCESS
          - FAILURE
        progress:
          type: string
          example: 100%
        imageUrl:
          type: string
          description: The address of the first image (compatibility field). The platform hosts short-term links. It is recommended
            to download and save them immediately after receiving them. By default, they will expire after about 30 days.
        urls:
          type: array
          description: Full list of images (recommended reading). The platform hosts short-term links. It is recommended to
            download and save them immediately after receiving them. By default, they will expire after about 30 days.
          items:
            type: string
        action:
          type: string
        failReason:
          type: string
        buttons:
          type: array
          items:
            type: object
    MiniMaxVideosCreateRequest:
      type: object
      title: MiniMax Hailuo video (OpenAI Videos)
      required:
      - model
      additionalProperties: false
      properties:
        model:
          type: string
          enum:
          - MiniMax-Hailuo-02
          - MiniMax-Hailuo-2.3
          - MiniMax-Hailuo-2.3-Fast
          description: MiniMax video model (openai-videos endpoint).
        prompt:
          type: string
          minLength: 1
          description: Video prompt words.
        duration:
          type: integer
          enum:
          - 6
          - 10
          default: 6
          description: Video duration (seconds), currently only 6 or 10 are supported.
        size:
          type: string
          enum:
          - 512p
          - 768p
          - 1080p
          description: Resolution (verified by model capability).
        metadata:
          type: object
          additionalProperties: true
          properties:
            first_frame_image:
              type: string
              format: uri
              description: First-frame image URL for image-to-video (required). Please ensure that the input URL is accessible
                at the time of submission.
      allOf:
      - if:
          properties:
            model:
              const: MiniMax-Hailuo-2.3-Fast
        then:
          required:
          - metadata
          properties:
            size:
              type: string
              enum:
              - 768p
              - 1080p
            metadata:
              type: object
              required:
              - first_frame_image
      - if:
          properties:
            model:
              const: MiniMax-Hailuo-2.3-Fast
            size:
              const: 1080p
        then:
          properties:
            duration:
              type: integer
              enum:
              - 6
      - if:
          properties:
            model:
              const: MiniMax-Hailuo-2.3
        then:
          properties:
            size:
              type: string
              enum:
              - 768p
              - 1080p
      - if:
          properties:
            model:
              const: MiniMax-Hailuo-2.3
            size:
              const: 1080p
        then:
          properties:
            duration:
              type: integer
              enum:
              - 6
      - if:
          properties:
            model:
              const: MiniMax-Hailuo-02
        then:
          properties:
            size:
              type: string
              enum:
              - 512p
              - 768p
              - 1080p
      - if:
          properties:
            model:
              const: MiniMax-Hailuo-02
            size:
              const: 1080p
        then:
          properties:
            duration:
              type: integer
              enum:
              - 6
