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

# API

> API reference for MiniMax: every `minimax.api.*` operation with input and output types.

Every `minimax.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling).

## Chat

### completion

`chat.completion`

Create a chat completion with a MiniMax text model

**Risk:** `read`

```ts theme={null}
await corsair.minimax.api.chat.completion({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `model` | `MiniMax-M3.1-Flash-Preview \| MiniMax-M3 \| MiniMax-M2.7 \| MiniMax-M2.7-highspeed \| MiniMax-M2.5 \| MiniMax-M2.5-highspeed \| MiniMax-M2.1 \| MiniMax-M2` | Yes | — |
| `messages` | `object[]` | Yes | — |
| `max_completion_tokens` | `number` | No | — |
| `max_tokens` | `number` | No | — |
| `temperature` | `number` | No | — |
| `top_p` | `number` | No | — |
| `tool_choice` | `none \| auto` | No | — |
| `tools` | `object[]` | No | — |
| `response_format` | `object` | No | — |
| `mask_sensitive_info` | `boolean` | No | — |
| `stream` | `false` | No | — |

> **messages full type**
>
> ```ts theme={null}
> {
>   role: system | user | assistant | tool,
>   name?: string,
>   content?: string | {
>     type?: string
>   }[] | null,
>   tool_calls?: {
>     type?: string
>   }[]
> }[]
> ```

> **tools full type**
>
> ```ts theme={null}
> {
>   type: string,
>   function: {
>     name: string,
>     description?: string,
>     parameters?: {
>     }
>   }
> }[]
> ```

> **response\_format full type**
>
> ```ts theme={null}
> {
>   type: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | No | — |
| `choices` | `object[]` | No | — |
| `created` | `number` | No | — |
| `model` | `string` | No | — |
| `object` | `chat.completion \| chat.completion.chunk` | No | — |
| `usage` | `object` | No | — |
| `base_resp` | `object` | No | — |

> **choices full type**
>
> ```ts theme={null}
> {
>   finish_reason?: string,
>   index?: number,
>   message?: {
>     role: system | user | assistant | tool,
>     name?: string,
>     content?: string | {
>       type?: string
>     }[] | null,
>     tool_calls?: {
>       type?: string
>     }[]
>   }
> }[]
> ```

> **usage full type**
>
> ```ts theme={null}
> {
>   total_tokens?: number
> }
> ```

> **base\_resp full type**
>
> ```ts theme={null}
> {
>   status_code: number,
>   status_msg?: string
> }
> ```

***

### createResponse

`chat.createResponse`

Create a model response via the Responses API

**Risk:** `read`

```ts theme={null}
await corsair.minimax.api.chat.createResponse({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `model` | `string` | Yes | — |
| `input` | `object[]` | Yes | — |
| `instructions` | `string` | No | — |
| `max_output_tokens` | `number` | No | — |
| `temperature` | `number` | No | — |
| `top_p` | `number` | No | — |
| `service_tier` | `standard \| priority` | No | — |
| `tools` | `object[]` | No | — |
| `tool_choice` | `none \| auto` | No | — |
| `metadata` | `object` | No | — |
| `prompt_cache_key` | `string` | No | — |
| `text` | `object` | No | — |
| `reasoning` | `object` | No | — |
| `stream` | `false` | No | — |

> **input full type**
>
> ```ts theme={null}
> string | {
>   type?: message | function_call | function_call_output | reasoning,
>   role?: user | assistant | system | developer | tool,
>   content?: string | {
>     type?: string
>   }[],
>   call_id?: string,
>   name?: string,
>   arguments?: string,
>   output?: string | {
>     type?: string
>   }[],
>   summary?: {
>   }[]
> }[]
> ```

> **tools full type**
>
> ```ts theme={null}
> {
>   type: string
> }[]
> ```

> **metadata full type**
>
> ```ts theme={null}
> {
> }
> ```

> **text full type**
>
> ```ts theme={null}
> {
>   format?: {
>   }
> }
> ```

> **reasoning full type**
>
> ```ts theme={null}
> {
>   effort?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | No | — |
| `object` | `string` | No | — |
| `created_at` | `number` | No | — |
| `model` | `string` | No | — |
| `status` | `completed \| incomplete \| failed` | No | — |
| `output` | `object[]` | No | — |
| `output_text` | `string` | No | — |
| `usage` | `object` | No | — |
| `error` | `object` | No | — |
| `incomplete_details` | `object` | No | — |
| `parallel_tool_calls` | `boolean` | No | — |
| `store` | `boolean` | No | — |
| `truncation` | `string` | No | — |

> **output full type**
>
> ```ts theme={null}
> {
>   type?: string
> }[]
> ```

> **usage full type**
>
> ```ts theme={null}
> {
> }
> ```

> **error full type**
>
> ```ts theme={null}
> {
>   code?: string,
>   message?: string
> }
> ```

> **incomplete\_details full type**
>
> ```ts theme={null}
> {
>   reason?: string
> }
> ```

***

### estimateInputTokens

`chat.estimateInputTokens`

Estimate the input token count of a request

**Risk:** `read`

```ts theme={null}
await corsair.minimax.api.chat.estimateInputTokens({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `model` | `string` | Yes | — |
| `input` | `object[]` | Yes | — |
| `instructions` | `string` | No | — |
| `tools` | `object[]` | No | — |
| `tool_choice` | `none \| auto` | No | — |
| `text` | `object` | No | — |
| `reasoning` | `object` | No | — |
| `stream` | `false` | No | — |

> **input full type**
>
> ```ts theme={null}
> string | {
>   type?: message | function_call | function_call_output | reasoning,
>   role?: user | assistant | system | developer | tool,
>   content?: string | {
>     type?: string
>   }[],
>   call_id?: string,
>   name?: string,
>   arguments?: string,
>   output?: string | {
>     type?: string
>   }[],
>   summary?: {
>   }[]
> }[]
> ```

> **tools full type**
>
> ```ts theme={null}
> {
>   type: string
> }[]
> ```

> **text full type**
>
> ```ts theme={null}
> {
>   format?: {
>   }
> }
> ```

> **reasoning full type**
>
> ```ts theme={null}
> {
>   effort?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `response.input_tokens` | Yes | — |
| `input_tokens` | `number` | Yes | — |

***

## Files

### delete

`files.delete`

Delete an uploaded file permanently \[DESTRUCTIVE · IRREVERSIBLE]

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.minimax.api.files.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `file_id` | `number` | Yes | — |
| `purpose` | `voice_clone \| prompt_audio \| t2a_async \| t2a_async_input \| video_generation` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `file_id` | `number` | No | — |
| `base_resp` | `object` | No | — |

> **base\_resp full type**
>
> ```ts theme={null}
> {
>   status_code: number,
>   status_msg?: string
> }
> ```

***

### list

`files.list`

List uploaded files for a purpose

**Risk:** `read`

```ts theme={null}
await corsair.minimax.api.files.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `purpose` | `voice_clone \| prompt_audio \| t2a_async_input \| video_generation_input` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `files` | `object[]` | Yes | — |
| `base_resp` | `object` | No | — |

> **files full type**
>
> ```ts theme={null}
> {
>   file_id?: number,
>   bytes?: number,
>   created_at?: number,
>   filename?: string,
>   purpose?: string,
>   download_url?: string
> }[]
> ```

> **base\_resp full type**
>
> ```ts theme={null}
> {
>   status_code: number,
>   status_msg?: string
> }
> ```

***

### retrieve

`files.retrieve`

Retrieve the metadata of an uploaded file

**Risk:** `read`

```ts theme={null}
await corsair.minimax.api.files.retrieve({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `file_id` | `number` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `file` | `object` | Yes | — |
| `base_resp` | `object` | No | — |

> **file full type**
>
> ```ts theme={null}
> {
>   file_id?: number,
>   bytes?: number,
>   created_at?: number,
>   filename?: string,
>   purpose?: string,
>   download_url?: string
> }
> ```

> **base\_resp full type**
>
> ```ts theme={null}
> {
>   status_code: number,
>   status_msg?: string
> }
> ```

***

## Image

### generate

`image.generate`

Generate images from a prompt, optionally with a subject reference

**Risk:** `write`

```ts theme={null}
await corsair.minimax.api.image.generate({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `model` | `image-01 \| image-01-live` | Yes | — |
| `prompt` | `string` | Yes | — |
| `subject_reference` | `object[]` | No | — |
| `aspect_ratio` | `1:1 \| 16:9 \| 4:3 \| 3:2 \| 2:3 \| 3:4 \| 9:16 \| 21:9` | No | — |
| `width` | `number` | No | — |
| `height` | `number` | No | — |
| `response_format` | `url \| base64` | No | — |
| `seed` | `number` | No | — |
| `n` | `number` | No | — |
| `prompt_optimizer` | `boolean` | No | — |

> **subject\_reference full type**
>
> ```ts theme={null}
> {
>   type: character,
>   image_file: string
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | No | — |
| `metadata` | `object` | No | — |
| `id` | `string` | No | — |
| `base_resp` | `object` | No | — |

> **data full type**
>
> ```ts theme={null}
> {
>   image_urls?: string[],
>   image_base64?: string[]
> }
> ```

> **metadata full type**
>
> ```ts theme={null}
> {
>   success_count?: number,
>   failed_count?: number
> }
> ```

> **base\_resp full type**
>
> ```ts theme={null}
> {
>   status_code: number,
>   status_msg?: string
> }
> ```

***

## Models

### list

`models.list`

List available models (OpenAI-compatible)

**Risk:** `read`

```ts theme={null}
await corsair.minimax.api.models.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `string` | No | — |
| `data` | `object[]` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id: string,
>   object?: string,
>   created?: number,
>   owned_by?: string
> }[]
> ```

***

### listAnthropic

`models.listAnthropic`

List available models (Anthropic-compatible)

**Risk:** `read`

```ts theme={null}
await corsair.minimax.api.models.listAnthropic({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | — |
| `after_id` | `string` | No | — |
| `before_id` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `first_id` | `string` | No | — |
| `has_more` | `boolean` | No | — |
| `last_id` | `string` | No | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id: string,
>   created_at?: string,
>   display_name?: string,
>   type?: string
> }[]
> ```

***

### retrieve

`models.retrieve`

Retrieve a model (OpenAI-compatible)

**Risk:** `read`

```ts theme={null}
await corsair.minimax.api.models.retrieve({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `model_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `object` | `string` | No | — |
| `created` | `number` | No | — |
| `owned_by` | `string` | No | — |

***

### retrieveAnthropic

`models.retrieveAnthropic`

Retrieve a model (Anthropic-compatible)

**Risk:** `read`

```ts theme={null}
await corsair.minimax.api.models.retrieveAnthropic({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `model_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `created_at` | `string` | No | — |
| `display_name` | `string` | No | — |
| `type` | `string` | No | — |

***

## Music

### coverPreprocess

`music.coverPreprocess`

Preprocess reference audio for two-step music cover generation

**Risk:** `write`

```ts theme={null}
await corsair.minimax.api.music.coverPreprocess({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `model` | `music-cover` | Yes | — |
| `audio_url` | `string` | No | — |
| `audio_base64` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `cover_feature_id` | `string` | No | — |
| `formatted_lyrics` | `string` | No | — |
| `structure_result` | `string` | No | — |
| `audio_duration` | `number` | No | — |
| `trace_id` | `string` | No | — |
| `base_resp` | `object` | No | — |

> **base\_resp full type**
>
> ```ts theme={null}
> {
>   status_code: number,
>   status_msg?: string
> }
> ```

***

### generate

`music.generate`

Generate a song from a prompt and lyrics

**Risk:** `write`

```ts theme={null}
await corsair.minimax.api.music.generate({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `model` | `music-3.0 \| music-2.6 \| music-cover \| music-3.0-free \| music-2.6-free \| music-cover-free` | Yes | — |
| `prompt` | `string` | No | — |
| `lyrics` | `string` | No | — |
| `output_format` | `url \| hex` | No | — |
| `audio_setting` | `object` | No | — |
| `lyrics_optimizer` | `boolean` | No | — |
| `is_instrumental` | `boolean` | No | — |
| `audio_url` | `string` | No | — |
| `audio_base64` | `string` | No | — |
| `cover_feature_id` | `string` | No | — |

> **audio\_setting full type**
>
> ```ts theme={null}
> {
>   sample_rate?: number,
>   bitrate?: number,
>   format?: mp3 | wav | pcm
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | No | — |
| `base_resp` | `object` | No | — |

> **data full type**
>
> ```ts theme={null}
> {
>   status?: number,
>   audio?: string
> }
> ```

> **base\_resp full type**
>
> ```ts theme={null}
> {
>   status_code: number,
>   status_msg?: string
> }
> ```

***

### generateLyrics

`music.generateLyrics`

Generate or edit song lyrics

**Risk:** `write`

```ts theme={null}
await corsair.minimax.api.music.generateLyrics({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `mode` | `write_full_song \| edit` | Yes | — |
| `prompt` | `string` | No | — |
| `lyrics` | `string` | No | — |
| `title` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `song_title` | `string` | No | — |
| `style_tags` | `string` | No | — |
| `lyrics` | `string` | No | — |
| `base_resp` | `object` | No | — |

> **base\_resp full type**
>
> ```ts theme={null}
> {
>   status_code: number,
>   status_msg?: string
> }
> ```

***

## Speech

### createAsyncTask

`speech.createAsyncTask`

Create an asynchronous long-text speech synthesis task

**Risk:** `write`

```ts theme={null}
await corsair.minimax.api.speech.createAsyncTask({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `model` | `speech-2.8-hd \| speech-2.8-turbo \| speech-2.6-hd \| speech-2.6-turbo \| speech-02-hd \| speech-02-turbo \| speech-01-hd \| speech-01-turbo` | Yes | — |
| `text` | `string` | No | — |
| `text_file_id` | `number` | No | — |
| `voice_setting` | `object` | Yes | — |
| `audio_setting` | `object` | No | — |
| `pronunciation_dict` | `object` | No | — |
| `language_boost` | `Chinese \| Chinese,Yue \| English \| Arabic \| Russian \| Spanish \| French \| Portuguese \| German \| Turkish \| Dutch \| Ukrainian \| Vietnamese \| Indonesian \| Japanese \| Italian \| Korean \| Thai \| Polish \| Romanian \| Greek \| Czech \| Finnish \| Hindi \| Bulgarian \| Danish \| Hebrew \| Malay \| Persian \| Slovak \| Swedish \| Croatian \| Filipino \| Hungarian \| Norwegian \| Slovenian \| Catalan \| Nynorsk \| Tamil \| Afrikaans \| auto` | No | — |
| `voice_modify` | `object` | No | — |

> **voice\_setting full type**
>
> ```ts theme={null}
> {
>   voice_id: string,
>   speed?: number,
>   vol?: number,
>   pitch?: number,
>   emotion?: happy | sad | angry | fearful | disgusted | surprised | calm | fluent | whisper,
>   english_normalization?: boolean,
>   latex_read?: boolean
> }
> ```

> **audio\_setting full type**
>
> ```ts theme={null}
> {
>   audio_sample_rate?: number,
>   bitrate?: number,
>   format?: mp3 | pcm | flac | wav | pcmu_raw | pcmu_wav | opus,
>   channel?: number
> }
> ```

> **pronunciation\_dict full type**
>
> ```ts theme={null}
> {
>   tone?: string[]
> }
> ```

> **voice\_modify full type**
>
> ```ts theme={null}
> {
>   pitch?: number,
>   intensity?: number,
>   timbre?: number,
>   sound_effects?: spacious_echo | auditorium_echo | lofi_telephone | robotic
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |
| `file_id` | `number` | No | — |
| `task_token` | `string` | No | — |
| `usage_characters` | `number` | No | — |
| `base_resp` | `object` | No | — |

> **base\_resp full type**
>
> ```ts theme={null}
> {
>   status_code: number,
>   status_msg?: string
> }
> ```

***

### queryAsyncTask

`speech.queryAsyncTask`

Query the status of an asynchronous speech synthesis task

**Risk:** `read`

```ts theme={null}
await corsair.minimax.api.speech.queryAsyncTask({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string \| number` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string \| number` | No | — |
| `status` | `success \| failed \| expired \| processing \| Success \| Failed \| Expired \| Processing` | Yes | — |
| `file_id` | `number` | No | — |
| `base_resp` | `object` | No | — |

> **base\_resp full type**
>
> ```ts theme={null}
> {
>   status_code: number,
>   status_msg?: string
> }
> ```

***

### t2a

`speech.t2a`

Synthesize speech from text (synchronous T2A)

**Risk:** `write`

```ts theme={null}
await corsair.minimax.api.speech.t2a({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `model` | `speech-2.8-hd \| speech-2.8-turbo \| speech-2.6-hd \| speech-2.6-turbo \| speech-02-hd \| speech-02-turbo \| speech-01-hd \| speech-01-turbo` | Yes | — |
| `text` | `string` | Yes | — |
| `voice_setting` | `object` | No | — |
| `audio_setting` | `object` | No | — |
| `pronunciation_dict` | `object` | No | — |
| `timbre_weights` | `object[]` | No | — |
| `language_boost` | `Chinese \| Chinese,Yue \| English \| Arabic \| Russian \| Spanish \| French \| Portuguese \| German \| Turkish \| Dutch \| Ukrainian \| Vietnamese \| Indonesian \| Japanese \| Italian \| Korean \| Thai \| Polish \| Romanian \| Greek \| Czech \| Finnish \| Hindi \| Bulgarian \| Danish \| Hebrew \| Malay \| Persian \| Slovak \| Swedish \| Croatian \| Filipino \| Hungarian \| Norwegian \| Slovenian \| Catalan \| Nynorsk \| Tamil \| Afrikaans \| auto` | No | — |
| `text_normalization_mode` | `basic \| quality` | No | — |
| `voice_modify` | `object` | No | — |
| `subtitle_enable` | `boolean` | No | — |
| `subtitle_type` | `sentence \| word \| word_streaming` | No | — |
| `output_format` | `url \| hex` | No | — |

> **voice\_setting full type**
>
> ```ts theme={null}
> {
>   voice_id: string,
>   speed?: number,
>   vol?: number,
>   pitch?: number,
>   emotion?: happy | sad | angry | fearful | disgusted | surprised | calm | fluent | whisper,
>   text_normalization?: boolean,
>   latex_read?: boolean
> }
> ```

> **audio\_setting full type**
>
> ```ts theme={null}
> {
>   sample_rate?: number,
>   bitrate?: number,
>   format?: mp3 | pcm | flac | wav | pcmu_raw | pcmu_wav | opus,
>   channel?: number,
>   force_cbr?: boolean
> }
> ```

> **pronunciation\_dict full type**
>
> ```ts theme={null}
> {
>   tone?: string[]
> }
> ```

> **timbre\_weights full type**
>
> ```ts theme={null}
> {
>   voice_id: string,
>   weight: number
> }[]
> ```

> **voice\_modify full type**
>
> ```ts theme={null}
> {
>   pitch?: number,
>   intensity?: number,
>   timbre?: number,
>   sound_effects?: spacious_echo | auditorium_echo | lofi_telephone | robotic
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | No | — |
| `trace_id` | `string` | No | — |
| `extra_info` | `object` | No | — |
| `base_resp` | `object` | No | — |

> **data full type**
>
> ```ts theme={null}
> {
>   audio?: string,
>   status?: number,
>   subtitle_file?: string,
>   subtitle?: string,
>   subtitles?: {
>   }[]
> }
> ```

> **extra\_info full type**
>
> ```ts theme={null}
> {
>   audio_length?: number,
>   audio_sample_rate?: number,
>   audio_size?: number,
>   bitrate?: number,
>   audio_format?: string,
>   audio_channel?: number,
>   usage_characters?: number,
>   word_count?: number
> }
> ```

> **base\_resp full type**
>
> ```ts theme={null}
> {
>   status_code: number,
>   status_msg?: string
> }
> ```

***

## Video

### cancelOrDeleteV2

`video.cancelOrDeleteV2`

Cancel a queued task or delete a finished task record permanently \[DESTRUCTIVE · IRREVERSIBLE]

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.minimax.api.video.cancelOrDeleteV2({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | No | — |
| `action` | `cancelled \| deleted` | No | — |
| `status` | `cancelled \| deleted` | No | — |

***

### contextIr

`video.contextIr`

Create an H3-Context-IR task that enriches a video prompt

**Risk:** `write`

```ts theme={null}
await corsair.minimax.api.video.contextIr({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `model` | `MiniMax-H3` | Yes | — |
| `content` | `object[]` | Yes | — |
| `duration` | `number` | Yes | — |
| `ratio` | `adaptive \| 21:9 \| 16:9 \| 4:3 \| 1:1 \| 3:4 \| 9:16` | No | — |
| `callback_url` | `string` | No | — |

> **content full type**
>
> ```ts theme={null}
> {
>   type: text | image_url | video_url | audio_url,
>   text?: string,
>   image_url?: {
>     url: string
>   },
>   video_url?: {
>     url: string
>   },
>   audio_url?: {
>     url: string
>   },
>   role?: first_frame | last_frame | reference_image | reference_video | reference_audio
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |

***

### generate

`video.generate`

Create a Hailuo video generation task (text, image, first/last frame or subject reference)

**Risk:** `write`

```ts theme={null}
await corsair.minimax.api.video.generate({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `model` | `MiniMax-Hailuo-2.3 \| MiniMax-Hailuo-2.3-Fast \| MiniMax-Hailuo-02 \| T2V-01-Director \| T2V-01 \| I2V-01-Director \| I2V-01-live \| I2V-01 \| S2V-01` | Yes | — |
| `prompt` | `string` | No | — |
| `first_frame_image` | `string` | No | — |
| `last_frame_image` | `string` | No | — |
| `subject_reference` | `object[]` | No | — |
| `prompt_optimizer` | `boolean` | No | — |
| `fast_pretreatment` | `boolean` | No | — |
| `duration` | `number` | No | — |
| `resolution` | `512P \| 720P \| 768P \| 1080P` | No | — |
| `callback_url` | `string` | No | — |

> **subject\_reference full type**
>
> ```ts theme={null}
> {
>   type: character,
>   image: string[]
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |
| `base_resp` | `object` | No | — |

> **base\_resp full type**
>
> ```ts theme={null}
> {
>   status_code: number,
>   status_msg?: string
> }
> ```

***

### generateV2

`video.generateV2`

Create an H3 multimodal video generation task

**Risk:** `write`

```ts theme={null}
await corsair.minimax.api.video.generateV2({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `model` | `MiniMax-H3 \| MiniMax-H3-Max` | Yes | — |
| `content` | `object[]` | Yes | — |
| `resolution` | `480P \| 768P \| 2K` | Yes | — |
| `duration` | `number` | Yes | — |
| `ratio` | `adaptive \| 21:9 \| 16:9 \| 4:3 \| 1:1 \| 3:4 \| 9:16` | No | — |
| `extra` | `object` | No | — |
| `callback_url` | `string` | No | — |

> **content full type**
>
> ```ts theme={null}
> {
>   type: text | image_url | video_url | audio_url,
>   text?: string,
>   image_url?: {
>     url: string
>   },
>   video_url?: {
>     url: string
>   },
>   audio_url?: {
>     url: string
>   },
>   role?: first_frame | last_frame | reference_image | reference_video | reference_audio
> }[]
> ```

> **extra full type**
>
> ```ts theme={null}
> {
>   prompt_expansion_mode?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |

***

### listV2

`video.listV2`

List H3 video tasks from the last 7 days

**Risk:** `read`

```ts theme={null}
await corsair.minimax.api.video.listV2({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pageNum` | `number` | No | — |
| `pageSize` | `number` | No | — |
| `status` | `queued \| running \| succeeded \| failed \| cancelled` | No | — |
| `taskIds` | `string[]` | No | — |
| `model` | `string` | No | — |
| `taskType` | `generation \| h3_context_ir \| regeneration` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `items` | `object[]` | Yes | — |
| `total` | `number` | No | — |

> **items full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   model?: string,
>   status?: queued | running | succeeded | failed | cancelled,
>   error?: {
>     code?: string,
>     message?: string
>   },
>   created_at?: number,
>   updated_at?: number,
>   content?: {
>     url?: string,
>     prompt?: string
>   },
>   resolution?: string,
>   duration?: number,
>   usage?: {
>   },
>   ratio?: string,
>   task_type?: generation | h3_context_ir | regeneration,
>   modality?: video | text
> }[]
> ```

***

### query

`video.query`

Query a Hailuo video generation task

**Risk:** `read`

```ts theme={null}
await corsair.minimax.api.video.query({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | No | — |
| `status` | `Preparing \| Queueing \| Processing \| Success \| Fail` | No | — |
| `file_id` | `string` | No | — |
| `video_width` | `number` | No | — |
| `video_height` | `number` | No | — |
| `base_resp` | `object` | No | — |

> **base\_resp full type**
>
> ```ts theme={null}
> {
>   status_code: number,
>   status_msg?: string
> }
> ```

***

### queryV2

`video.queryV2`

Query an H3 video task by id

**Risk:** `read`

```ts theme={null}
await corsair.minimax.api.video.queryV2({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `task` | `object` | Yes | — |

> **task full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   model?: string,
>   status?: queued | running | succeeded | failed | cancelled,
>   error?: {
>     code?: string,
>     message?: string
>   },
>   created_at?: number,
>   updated_at?: number,
>   content?: {
>     url?: string,
>     prompt?: string
>   },
>   resolution?: string,
>   duration?: number,
>   usage?: {
>   },
>   ratio?: string,
>   task_type?: generation | h3_context_ir | regeneration,
>   modality?: video | text
> }
> ```

***

### regenerate

`video.regenerate`

Create a 2K video regeneration task

**Risk:** `write`

```ts theme={null}
await corsair.minimax.api.video.regenerate({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `model` | `MiniMax-H3` | Yes | — |
| `source_task_id` | `string` | No | — |
| `content` | `object[]` | No | — |
| `resolution` | `2K` | Yes | — |
| `callback_url` | `string` | No | — |
| `aigc_watermark` | `boolean` | No | — |

> **content full type**
>
> ```ts theme={null}
> {
>   type: text | image_url | video_url | audio_url,
>   text?: string,
>   image_url?: {
>     url: string
>   },
>   video_url?: {
>     url: string
>   },
>   audio_url?: {
>     url: string
>   },
>   role?: base_video | first_frame | last_frame | reference_image | reference_video | reference_audio
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |

***

### templateGenerate

`video.templateGenerate`

Create a Video Agent task from a template

**Risk:** `write`

```ts theme={null}
await corsair.minimax.api.video.templateGenerate({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `template_id` | `string` | Yes | — |
| `text_inputs` | `object[]` | No | — |
| `media_inputs` | `object[]` | No | — |
| `callback_url` | `string` | No | — |

> **text\_inputs full type**
>
> ```ts theme={null}
> {
>   value: string
> }[]
> ```

> **media\_inputs full type**
>
> ```ts theme={null}
> {
>   value: string
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |
| `base_resp` | `object` | No | — |

> **base\_resp full type**
>
> ```ts theme={null}
> {
>   status_code: number,
>   status_msg?: string
> }
> ```

***

### templateQuery

`video.templateQuery`

Query a Video Agent template generation task

**Risk:** `read`

```ts theme={null}
await corsair.minimax.api.video.templateQuery({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | No | — |
| `status` | `Preparing \| Queueing \| Processing \| Success \| Fail` | No | — |
| `video_url` | `string` | No | — |
| `base_resp` | `object` | No | — |

> **base\_resp full type**
>
> ```ts theme={null}
> {
>   status_code: number,
>   status_msg?: string
> }
> ```

***

## Voice

### clone

`voice.clone`

Clone a voice from uploaded audio

**Risk:** `write`

```ts theme={null}
await corsair.minimax.api.voice.clone({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `file_id` | `number` | Yes | — |
| `voice_id` | `string` | Yes | — |
| `clone_prompt` | `object` | No | — |
| `text` | `string` | No | — |
| `model` | `speech-2.8-hd \| speech-2.8-turbo \| speech-2.6-hd \| speech-2.6-turbo \| speech-02-hd \| speech-02-turbo \| speech-01-hd \| speech-01-turbo` | No | — |
| `language_boost` | `Chinese \| Chinese,Yue \| English \| Arabic \| Russian \| Spanish \| French \| Portuguese \| German \| Turkish \| Dutch \| Ukrainian \| Vietnamese \| Indonesian \| Japanese \| Italian \| Korean \| Thai \| Polish \| Romanian \| Greek \| Czech \| Finnish \| Hindi \| Bulgarian \| Danish \| Hebrew \| Malay \| Persian \| Slovak \| Swedish \| Croatian \| Filipino \| Hungarian \| Norwegian \| Slovenian \| Catalan \| Nynorsk \| Tamil \| Afrikaans \| auto` | No | — |
| `text_validation` | `string` | No | — |
| `accuracy` | `number` | No | — |
| `need_noise_reduction` | `boolean` | No | — |
| `need_volume_normalization` | `boolean` | No | — |
| `aigc_watermark` | `boolean` | No | — |

> **clone\_prompt full type**
>
> ```ts theme={null}
> {
>   prompt_audio: number,
>   prompt_text: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `demo_audio` | `string` | No | — |
| `input_sensitive` | `object` | No | — |
| `extra_info` | `object` | No | — |
| `base_resp` | `object` | No | — |

> **input\_sensitive full type**
>
> ```ts theme={null}
> {
>   type?: number
> }
> ```

> **extra\_info full type**
>
> ```ts theme={null}
> {
> }
> ```

> **base\_resp full type**
>
> ```ts theme={null}
> {
>   status_code: number,
>   status_msg?: string
> }
> ```

***

### delete

`voice.delete`

Delete a generated voice permanently \[DESTRUCTIVE · IRREVERSIBLE]

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.minimax.api.voice.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `voice_type` | `voice_cloning \| voice_generation` | Yes | — |
| `voice_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `voice_id` | `string` | No | — |
| `created_time` | `string` | No | — |
| `base_resp` | `object` | No | — |

> **base\_resp full type**
>
> ```ts theme={null}
> {
>   status_code: number,
>   status_msg?: string
> }
> ```

***

### design

`voice.design`

Design a custom voice from a description

**Risk:** `write`

```ts theme={null}
await corsair.minimax.api.voice.design({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `prompt` | `string` | Yes | — |
| `preview_text` | `string` | Yes | — |
| `voice_id` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `voice_id` | `string` | Yes | — |
| `trial_audio` | `string` | No | — |
| `base_resp` | `object` | No | — |

> **base\_resp full type**
>
> ```ts theme={null}
> {
>   status_code: number,
>   status_msg?: string
> }
> ```

***

### list

`voice.list`

List system, cloned and generated voices

**Risk:** `read`

```ts theme={null}
await corsair.minimax.api.voice.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `voice_type` | `system \| voice_cloning \| voice_generation \| all` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `system_voice` | `object[]` | No | — |
| `voice_cloning` | `object[]` | No | — |
| `voice_generation` | `object[]` | No | — |
| `base_resp` | `object` | No | — |

> **system\_voice full type**
>
> ```ts theme={null}
> {
>   voice_id: string,
>   voice_name?: string,
>   description?: string[],
>   created_time?: string
> }[]
> ```

> **voice\_cloning full type**
>
> ```ts theme={null}
> {
>   voice_id: string,
>   voice_name?: string,
>   description?: string[],
>   created_time?: string
> }[]
> ```

> **voice\_generation full type**
>
> ```ts theme={null}
> {
>   voice_id: string,
>   voice_name?: string,
>   description?: string[],
>   created_time?: string
> }[]
> ```

> **base\_resp full type**
>
> ```ts theme={null}
> {
>   status_code: number,
>   status_msg?: string
> }
> ```

***


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