# Claude Code setup Source: https://platform.minimax.io/docs/ai-tools/claude-code Configure Claude Code for your documentation workflow Claude Code is Anthropic's official CLI tool. This guide will help you set up Claude Code to help you write and maintain your documentation. ## Prerequisites * Active Claude subscription (Pro, Max, or API access) ## Setup 1. Install Claude Code globally: ```bash theme={null} npm install -g @anthropic-ai/claude-code ``` 2. Navigate to your docs directory. 3. (Optional) Add the `CLAUDE.md` file below to your project. 4. Run `claude` to start. ## Create `CLAUDE.md` Create a `CLAUDE.md` file at the root of your documentation repository to train Claude Code on your specific documentation standards: ```markdown theme={null} # Mintlify documentation ## Working relationship - You can push back on ideas-this can lead to better documentation. Cite sources and explain your reasoning when you do so - ALWAYS ask for clarification rather than making assumptions - NEVER lie, guess, or make up information ## Project context - Format: MDX files with YAML frontmatter - Config: docs.json for navigation, theme, settings - Components: Mintlify components ## Content strategy - Document just enough for user success - not too much, not too little - Prioritize accuracy and usability of information - Make content evergreen when possible - Search for existing information before adding new content. Avoid duplication unless it is done for a strategic reason - Check existing patterns for consistency - Start by making the smallest reasonable changes ## Frontmatter requirements for pages - title: Clear, descriptive page title - description: Concise summary for SEO/navigation ## Writing standards - Second-person voice ("you") - Prerequisites at start of procedural content - Test all code examples before publishing - Match style and formatting of existing pages - Include both basic and advanced use cases - Language tags on all code blocks - Alt text on all images - Relative paths for internal links ## Git workflow - NEVER use --no-verify when committing - Ask how to handle uncommitted changes before starting - Create a new branch when no clear branch exists for changes - Commit frequently throughout development - NEVER skip or disable pre-commit hooks ## Do not - Skip frontmatter on any MDX file - Use absolute URLs for internal links - Include untested code examples - Make assumptions - always ask for clarification ``` # Cursor setup Source: https://platform.minimax.io/docs/ai-tools/cursor Configure Cursor for your documentation workflow Use Cursor to help write and maintain your documentation. This guide shows how to configure Cursor for better results on technical writing tasks and using Mintlify components. ## Prerequisites * Cursor editor installed * Access to your documentation repository ## Project rules Create project rules that all team members can use. In your documentation repository root: ```bash theme={null} mkdir -p .cursor ``` Create `.cursor/rules.md`: ````markdown theme={null} # Mintlify technical writing rule You are an AI writing assistant specialized in creating exceptional technical documentation using Mintlify components and following industry-leading technical writing practices. ## Core writing principles ### Language and style requirements - Use clear, direct language appropriate for technical audiences - Write in second person ("you") for instructions and procedures - Use active voice over passive voice - Employ present tense for current states, future tense for outcomes - Avoid jargon unless necessary and define terms when first used - Maintain consistent terminology throughout all documentation - Keep sentences concise while providing necessary context - Use parallel structure in lists, headings, and procedures ### Content organization standards - Lead with the most important information (inverted pyramid structure) - Use progressive disclosure: basic concepts before advanced ones - Break complex procedures into numbered steps - Include prerequisites and context before instructions - Provide expected outcomes for each major step - Use descriptive, keyword-rich headings for navigation and SEO - Group related information logically with clear section breaks ### User-centered approach - Focus on user goals and outcomes rather than system features - Anticipate common questions and address them proactively - Include troubleshooting for likely failure points - Write for scannability with clear headings, lists, and white space - Include verification steps to confirm success ## Mintlify component reference ### Callout components #### Note - Additional helpful information Supplementary information that supports the main content without interrupting flow #### Tip - Best practices and pro tips Expert advice, shortcuts, or best practices that enhance user success #### Warning - Important cautions Critical information about potential issues, breaking changes, or destructive actions #### Info - Neutral contextual information Background information, context, or neutral announcements #### Check - Success confirmations Positive confirmations, successful completions, or achievement indicators ### Code components #### Single code block Example of a single code block: ```javascript config.js const apiConfig = { baseURL: 'https://api.example.com', timeout: 5000, headers: { 'Authorization': `Bearer ${process.env.API_TOKEN}` } }; ``` #### Code group with multiple languages Example of a code group: ```javascript Node.js const response = await fetch('/api/endpoint', { headers: { Authorization: `Bearer ${apiKey}` } }); ``` ```python Python import requests response = requests.get('/api/endpoint', headers={'Authorization': f'Bearer {api_key}'}) ``` ```curl cURL curl -X GET '/api/endpoint' \ -H 'Authorization: Bearer YOUR_API_KEY' ``` #### Request/response examples Example of request/response documentation: ```bash cURL curl -X POST 'https://api.example.com/users' \ -H 'Content-Type: application/json' \ -d '{"name": "John Doe", "email": "john@example.com"}' ``` ```json Success { "id": "user_123", "name": "John Doe", "email": "john@example.com", "created_at": "2024-01-15T10:30:00Z" } ``` ### Structural components #### Steps for procedures Example of step-by-step instructions: Run `npm install` to install required packages. Verify installation by running `npm list`. Create a `.env` file with your API credentials. ```bash API_KEY=your_api_key_here ``` Never commit API Keys to version control. #### Tabs for alternative content Example of tabbed content: ```bash brew install node npm install -g package-name ``` ```powershell choco install nodejs npm install -g package-name ``` ```bash sudo apt install nodejs npm npm install -g package-name ``` #### Accordions for collapsible content Example of accordion groups: - **Firewall blocking**: Ensure ports 80 and 443 are open - **Proxy configuration**: Set HTTP_PROXY environment variable - **DNS resolution**: Try using 8.8.8.8 as DNS server ```javascript const config = { performance: { cache: true, timeout: 30000 }, security: { encryption: 'AES-256' } }; ``` ### Cards and columns for emphasizing information Example of cards and card groups: Complete walkthrough from installation to your first API call in under 10 minutes. Learn how to authenticate requests using API Keys or JWT tokens. Understand rate limits and best practices for high-volume usage. ### API documentation components #### Parameter fields Example of parameter documentation: Unique identifier for the user. Must be a valid UUID v4 format. User's email address. Must be valid and unique within the system. Maximum number of results to return. Range: 1-100. Bearer token for API authentication. Format: `Bearer YOUR_API_KEY` #### Response fields Example of response field documentation: Unique identifier assigned to the newly created user. ISO 8601 formatted timestamp of when the user was created. List of permission strings assigned to this user. #### Expandable nested fields Example of nested field documentation: Complete user object with all associated data. User profile information including personal details. User's first name as entered during registration. URL to user's profile picture. Returns null if no avatar is set. ### Media and advanced components #### Frames for images Wrap all images in frames: Main dashboard showing analytics overview Analytics dashboard with charts #### Videos Use the HTML video element for self-hosted video content: Embed YouTube videos using iframe elements: #### Tooltips Example of tooltip usage: API #### Updates Use updates for changelogs: ## New features - Added bulk user import functionality - Improved error messages with actionable suggestions ## Bug fixes - Fixed pagination issue with large datasets - Resolved authentication timeout problems ## Required page structure Every documentation page must begin with YAML frontmatter: ```yaml --- title: "Clear, specific, keyword-rich title" description: "Concise description explaining page purpose and value" --- ``` ## Content quality standards ### Code examples requirements - Always include complete, runnable examples that users can copy and execute - Show proper error handling and edge case management - Use realistic data instead of placeholder values - Include expected outputs and results for verification - Test all code examples thoroughly before publishing - Specify language and include filename when relevant - Add explanatory comments for complex logic - Never include real API Keys or secrets in code examples ### API documentation requirements - Document all parameters including optional ones with clear descriptions - Show both success and error response examples with realistic data - Include rate limiting information with specific limits - Provide authentication examples showing proper format - Explain all HTTP status codes and error handling - Cover complete request/response cycles ### Accessibility requirements - Include descriptive alt text for all images and diagrams - Use specific, actionable link text instead of "click here" - Ensure proper heading hierarchy starting with H2 - Provide keyboard navigation considerations - Use sufficient color contrast in examples and visuals - Structure content for easy scanning with headers and lists ## Component selection logic - Use **Steps** for procedures and sequential instructions - Use **Tabs** for platform-specific content or alternative approaches - Use **CodeGroup** when showing the same concept in multiple programming languages - Use **Accordions** for progressive disclosure of information - Use **RequestExample/ResponseExample** specifically for API endpoint documentation - Use **ParamField** for API parameters, **ResponseField** for API responses - Use **Expandable** for nested object properties or hierarchical information ```` # Windsurf setup Source: https://platform.minimax.io/docs/ai-tools/windsurf Configure Windsurf for your documentation workflow Configure Windsurf's Cascade AI assistant to help you write and maintain documentation. This guide shows how to set up Windsurf specifically for your Mintlify documentation workflow. ## Prerequisites * Windsurf editor installed * Access to your documentation repository ## Workspace rules Create workspace rules that provide Windsurf with context about your documentation project and standards. Create `.windsurf/rules.md` in your project root: ````markdown theme={null} # Mintlify technical writing rule ## Project context - This is a documentation project on the Mintlify platform - We use MDX files with YAML frontmatter - Navigation is configured in `docs.json` - We follow technical writing best practices ## Writing standards - Use second person ("you") for instructions - Write in active voice and present tense - Start procedures with prerequisites - Include expected outcomes for major steps - Use descriptive, keyword-rich headings - Keep sentences concise but informative ## Required page structure Every page must start with frontmatter: ```yaml --- title: "Clear, specific title" description: "Concise description for SEO and navigation" --- ``` ## Mintlify components ### Callouts - `` for helpful supplementary information - `` for important cautions and breaking changes - `` for best practices and expert advice - `` for neutral contextual information - `` for success confirmations ### Code examples - When appropriate, include complete, runnable examples - Use `` for multiple language examples - Specify language tags on all code blocks - Include realistic data, not placeholders - Use `` and `` for API docs ### Procedures - Use `` component for sequential instructions - Include verification steps with `` components when relevant - Break complex procedures into smaller steps ### Content organization - Use `` for platform-specific content - Use `` for progressive disclosure - Use `` and `` for highlighting content - Wrap images in `` components with descriptive alt text ## API documentation requirements - Document all parameters with `` - Show response structure with `` - Include both success and error examples - Use `` for nested object properties - Always include authentication examples ## Quality standards - Test all code examples before publishing - Use relative paths for internal links - Include alt text for all images - Ensure proper heading hierarchy (start with h2) - Check existing patterns for consistency ```` # Explicit Prompt Caching (Anthropic API) Source: https://platform.minimax.io/docs/api-reference/anthropic-api-compatible-cache MiniMax supports Anthropic API compatible caching that is managed through explicit cache_control settings. ## Quick Start Here's a quick example of how to implement prompt caching in the Anthropic-compatible API using a `cache_control` block: ```python Python theme={null} theme={null} import anthropic client = anthropic.Anthropic( base_url="https://api.minimax.io/anthropic", api_key="" # Replace with your MiniMax API Key ) response = client.messages.create( model="MiniMax-M2.7", max_tokens=1024, system=[ { "type": "text", "text": "You are an AI assistant tasked with analyzing literary works. Your goal is to provide insightful commentary on themes, characters, and writing style.\n", }, { "type": "text", "text": "", "cache_control": {"type": "ephemeral"} } ], messages=[{"role": "user", "content": "Analyze the major themes in 'Pride and Prejudice'."}], ) print(response.usage.model_dump_json()) # Make another call with the same cached content # Only the user message needs to change response = client.messages.create(.....) print(response.usage.model_dump_json()) ``` ```JSON JSON theme={null} theme={null} {"cache_creation_input_tokens":188086,"cache_read_input_tokens":0,"input_tokens":21,"output_tokens":393} {"cache_creation_input_tokens":0,"cache_read_input_tokens":188086,"input_tokens":21,"output_tokens":393} ``` In this example, the entire text of "Pride and Prejudice" is cached using the `cache_control` parameter. This enables reuse of the large text across multiple API calls without reprocessing it each time. By changing only the user message, you can ask various questions about the book while utilizing the cached content, resulting in faster responses and reduced costs. *** ## How Prompt Caching Works When you send a request with prompt caching enabled: 1. The system checks if the prompt prefix before the specified cache breakpoint (cache\_control) has been cached from a previous request. 2. If found, it uses the cached version, significantly reducing processing time and costs. 3. If not found, it processes the full prompt and caches it when generating the response. This is especially useful for: * Prompts with many examples * Large amounts of context or background information * Repetitive tasks with consistent instructions * Long multi-turn conversations Cached content has a **lifetime of 5 minutes**. Each time the cached content is hit, the cache lifetime is automatically refreshed at no additional cost. *** ## Supported Models and Pricing Prompt caching introduces a differentiated pricing structure. The table below shows the price per million tokens for each supported model: | Model | Input | Output | Prompt caching Read | Prompt caching Write | | :--------------------------------------------------------------------------- | :--------------- | :--------------- | :------------------ | :------------------- | | **MiniMax-M2.7** | \$0.3 / M tokens | \$1.2 / M tokens | \$0.06 / M tokens | \$0.375 / M tokens | | **MiniMax-M2.7-highspeed**
Same performance, faster and more efficient | \$0.3 / M tokens | \$2.4 / M tokens | \$0.06 / M tokens | \$0.375 / M tokens | | **MiniMax-M2.5** | \$0.3 / M tokens | \$1.2 / M tokens | \$0.03 / M tokens | \$0.375 / M tokens | | **MiniMax-M2.5-highspeed**
Same performance, faster and more efficient | \$0.3 / M tokens | \$2.4 / M tokens | \$0.03 / M tokens | \$0.375 / M tokens | | **MiniMax-M2.1** | \$0.3 / M tokens | \$1.2 / M tokens | \$0.03 / M tokens | \$0.375 / M tokens | | **MiniMax-M2.1-highspeed**
Faster and more efficient | \$0.3 / M tokens | \$2.4 / M tokens | \$0.03 / M tokens | \$0.375 / M tokens | | **MiniMax-M2 / M2-Stable** | \$0.3 / M tokens | \$1.2 / M tokens | \$0.03 / M tokens | \$0.375 / M tokens | The table above reflects the following prompt caching pricing rules: * Cache write tokens and cache read tokens follow the prices shown in the table *** ## How to Implement Prompt Caching ### Structuring Your Prompt Place static, reusable content (tool definitions, system instructions, examples, etc.) at the beginning of your prompt. Mark the end of the cacheable content using the `cache_control` parameter. Cache prefixes are created in the following order: `tools` → `system` → `messages`. This order forms a hierarchy where each level builds upon the previous ones. ### Automatic Prefix Checking You can use just one cache breakpoint at the end of your static content, and the system will automatically find the longest matching prefix. **Three core principles:** 1. **Cache content is cumulative**: When you mark a block with `cache_control`, the cache content is generated from all previous blocks in sequence. This means each cache depends on all content that came before it. 2. **Forward sequential checking**: The system checks for cache hits by working forward from the explicit cache breakpoint, ensuring the longest possible cache is hit. 3. **20-block lookback window**: The system checks up to 20 blocks before each explicit cache breakpoint. If no match is found after checking 20 blocks, it stops and moves to the previous explicit breakpoint (if any). **Example:** If you set `cache_control` at block 30 and make repeated requests: 1. If no block content is modified, the system will hit the cache for all content from blocks 1-30. 2. If block 25 is modified, the system searches forward from block 30 until it matches the cache at block 24, so blocks 1-24 will hit the cache. 3. If block 5 is modified, the system searches forward from block 30 and still finds no match at block 11, so the cache becomes invalid for this request. ### What Can Be Cached Most blocks in the request can be designated for caching with `cache_control`, including: * **Tools**: Tool definitions in the `tools` array * **System messages**: Content blocks in the `system` array * **Text messages**: Content blocks in the `messages.content` array, for both user and assistant turns * **Tool use and tool results**: Tool\_use and tool\_result types in content blocks in the `messages.content` array, for both user and assistant turns Mark any of these elements with `cache_control` to enable caching for that portion of the request. ### Cache Invalidation Modifications to cached content can invalidate some or all of the cache. As described in [Structuring Your Prompt](#structuring-your-prompt), the cache follows the hierarchy: `tools` → `system` → `messages`. Changes at each level invalidate that level and all subsequent levels. ### Cache Performance Monitor cache performance using the following API response fields in the `usage` object (or in the `message_start` event when streaming): * `cache_creation_input_tokens`: Number of tokens written to the cache when creating a new cache entry. * `cache_read_input_tokens`: Number of tokens retrieved from the cache for this request. * `input_tokens`: Number of input tokens not read from or used to create a cache (i.e., tokens after the last cache breakpoint). **Understanding Token Composition** To calculate total input tokens: ``` total_input_tokens = cache_read_input_tokens + cache_creation_input_tokens + input_tokens ``` **Breakdown by position:** * `cache_read_input_tokens`: Tokens before the breakpoint, already cached (reads) * `cache_creation_input_tokens`: Tokens before the breakpoint, being cached now (writes) * `input_tokens`: Tokens after the last breakpoint (not eligible for caching) **Example:** A request with 100,000 tokens of cached content (read from cache), 0 tokens of new content being cached, and 50 tokens in the user message (after the cache breakpoint): * `cache_read_input_tokens`: 100,000 * `cache_creation_input_tokens`: 0 * `input_tokens`: 50 * **Total input tokens**: 100,050 tokens This is important for understanding both costs and rate limits. When using caching effectively, `input_tokens` will typically be much smaller than your total input. ### Common Issues If you're experiencing unexpected caching behavior: * **Content consistency**: Verify that cached sections are identical across calls and marked with `cache_control` in the same locations * **Cache expiration**: Confirm that calls are made within the cache lifetime (5 minutes) * **Block count limit**: For prompts with more than 20 content blocks, add additional `cache_control` parameters to ensure all content can be cached (the system automatically checks approximately 20 blocks before each breakpoint) * **Inactive cache breakpoints**: A call supports up to 4 `cache_control` parameters. If more than 4 are specified, only the most recent 4 (from back to front) will be used *** ## More Examples The following code examples showcase various prompt caching patterns and demonstrate how to implement caching in different scenarios: ```Python Python theme={null} theme={null} import anthropic client = anthropic.Anthropic() response = client.messages.create( model="MiniMax-M2.7", max_tokens=1024, system=[ { "type": "text", "text": "You are an AI assistant tasked with analyzing legal documents." }, { "type": "text", "text": "Here is the full text of a complex legal agreement: [Insert full text of a 50-page legal agreement here]", "cache_control": {"type": "ephemeral"} } ], messages=[ { "role": "user", "content": "What are the key terms and conditions in this agreement?" } ] ) print(response.model_dump_json()) ``` This example demonstrates basic prompt caching by caching the full text of the legal agreement while keeping the user instruction uncached. **First request:** * `input_tokens`: Tokens in the user message only * `cache_creation_input_tokens`: Tokens in the entire system message, including the legal document * `cache_read_input_tokens`: 0 (no cache hit on first request) **Subsequent requests within cache lifetime:** * `input_tokens`: Tokens in the user message only * `cache_creation_input_tokens`: 0 (no new cache creation) * `cache_read_input_tokens`: Tokens in the entire cached system message ```Python Python theme={null} theme={null} import anthropic client = anthropic.Anthropic() response = client.messages.create( model="MiniMax-M2.7", max_tokens=1024, tools=[ { "name": "get_weather", "description": "Get the current weather in a given location", "input_schema": { "type": "object", "properties": { "location": { "type": "string", "description": "The city and state, e.g. San Francisco, CA" }, "unit": { "type": "string", "enum": ["celsius", "fahrenheit"], "description": "The unit of temperature, either 'celsius' or 'fahrenheit'" } }, "required": ["location"] }, }, # More tools { "name": "get_time", "description": "Get the current time in a given time zone", "input_schema": { "type": "object", "properties": { "timezone": { "type": "string", "description": "The IANA time zone name, e.g. America/Los_Angeles" } }, "required": ["timezone"] }, "cache_control": {"type": "ephemeral"} } ], messages=[ { "role": "user", "content": "What's the weather and time in New York?" } ] ) print(response.model_dump_json()) ``` This example demonstrates caching tool definitions. The `cache_control` parameter is placed on the final tool (`get_time`) to designate all tools as part of the static prefix. All tool definitions, including `get_weather` and any other tools defined before `get_time`, will be cached as a single prefix. This approach is ideal when you have a consistent set of tools to reuse across multiple requests without reprocessing them each time. **First request:** * `input_tokens`: Tokens in the user message * `cache_creation_input_tokens`: Tokens in all tool definitions and system prompt * `cache_read_input_tokens`: 0 (no cache hit on first request) **Subsequent requests within cache lifetime:** * `input_tokens`: Tokens in the user message * `cache_creation_input_tokens`: 0 (no new cache creation) * `cache_read_input_tokens`: Tokens in all cached tool definitions and system prompt ```Python Python theme={null} theme={null} import anthropic client = anthropic.Anthropic() response = client.messages.create( model="MiniMax-M2.7", max_tokens=1024, system=[ { "type": "text", "text": "...long system prompt", "cache_control": {"type": "ephemeral"} } ], messages=[ # ...long conversation history { "role": "user", "content": [ { "type": "text", "text": "Hello, can you tell me more about the solar system?", } ] }, { "role": "assistant", "content": "Certainly! The solar system is the collection of celestial bodies that orbit our Sun. It consists of eight planets, numerous moons, asteroids, comets, and other objects. The planets, in order from closest to farthest from the Sun, are: Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune. Each planet has its own unique characteristics and features. Is there a specific aspect of the solar system you'd like to know more about?" }, { "role": "user", "content": [ { "type": "text", "text": "Good to know." }, { "type": "text", "text": "Tell me more about Mars.", "cache_control": {"type": "ephemeral"} } ] } ] ) print(response.model_dump_json()) ``` This example demonstrates prompt caching in a multi-turn conversation. During each turn, we mark the final block of the final message with `cache_control` to enable incremental caching of the conversation. The system automatically looks up and uses the longest previously cached prefix for subsequent messages. Blocks previously marked with `cache_control` don't need to be marked again—they will still result in cache hits (and cache refreshes) if accessed within 5 minutes. Note that `cache_control` is also placed on the system message. This ensures that if it gets evicted from the cache (after not being used for more than 5 minutes), it will be re-cached on the next request. This approach is ideal for maintaining context in ongoing conversations without repeatedly processing the same information. When set up correctly, you should see the following in the usage response for each request: * `input_tokens`: Tokens in the new user message (typically minimal) * `cache_creation_input_tokens`: Tokens in the new assistant and user turns * `cache_read_input_tokens`: Tokens in the conversation up to the previous turn ```Python Python theme={null} theme={null} import anthropic client = anthropic.Anthropic() response = client.messages.create( model="MiniMax-M2.7", max_tokens=1024, tools=[ { "name": "search_documents", "description": "Search through the knowledge base", "input_schema": { "type": "object", "properties": { "query": { "type": "string", "description": "Search query" } }, "required": ["query"] } }, { "name": "get_document", "description": "Retrieve a specific document by ID", "input_schema": { "type": "object", "properties": { "doc_id": { "type": "string", "description": "Document ID" } }, "required": ["doc_id"] }, "cache_control": {"type": "ephemeral"} } ], system=[ { "type": "text", "text": "You are a helpful research assistant with access to a document knowledge base.\n\n# Instructions\n- Always search for relevant documents before answering\n- Provide citations for your sources\n- Be objective and accurate in your responses\n- If multiple documents contain relevant information, synthesize them\n- Acknowledge when information is not available in the knowledge base", "cache_control": {"type": "ephemeral"} }, { "type": "text", "text": "# Knowledge Base Context\n\nHere are the relevant documents for this conversation:\n\n## Document 1: Solar System Overview\nThe solar system consists of the Sun and all objects that orbit it...\n\n## Document 2: Planetary Characteristics\nEach planet has unique features. Mercury is the smallest planet...\n\n## Document 3: Mars Exploration\nMars has been a target of exploration for decades...\n\n[Additional documents...]", "cache_control": {"type": "ephemeral"} } ], messages=[ { "role": "user", "content": "Can you search for information about Mars rovers?" }, { "role": "assistant", "content": [ { "type": "tool_use", "id": "tool_1", "name": "search_documents", "input": {"query": "Mars rovers"} } ] }, { "role": "user", "content": [ { "type": "tool_result", "tool_use_id": "tool_1", "content": "Found 3 relevant documents: Document 3 (Mars Exploration), Document 7 (Rover Technology), Document 9 (Mission History)" } ] }, { "role": "assistant", "content": [ { "type": "text", "text": "I found 3 relevant documents about Mars rovers. Let me get more details from the Mars Exploration document." } ] }, { "role": "user", "content": [ { "type": "text", "text": "Yes, please tell me about the Perseverance rover specifically.", "cache_control": {"type": "ephemeral"} } ] } ] ) print(response.model_dump_json()) ``` This comprehensive example demonstrates how to use all 4 available cache breakpoints to optimize different parts of your prompt: This pattern is especially powerful for: * RAG applications with large document contexts * Agent systems that use multiple tools * Long-running conversations that maintain context * Applications that need to optimize different parts of the prompt independently # API Overview Source: https://platform.minimax.io/docs/api-reference/api-overview Overview of MiniMax API capabilities including language, speech, video, image, music, and file management. ## Get API Key * **Pay-as-you-go**:Visit [API Keys > Create new secret key](https://platform.minimax.io/user-center/basic-information/interface-key) to get your **API Key** Pay-as-you-go supports all modality models, including language, Video, Speech, and Image. * **Token Plan**:Visit [Billing > Token Plan](https://platform.minimax.io/user-center/payment/token-plan) to view your **Subscription Key** The Subscription Key is used for Token Plan subscriptions and purchased Credits. It is separate from pay-as-you-go API Keys. See [Token Plan Overview](/docs/token-plan/intro) for details. *** ## Large Language Model The Large Language Model API uses **MiniMax M3**, **MiniMax M2.7**, **MiniMax M2.7 highspeed**, **MiniMax M2.5**, **MiniMax M2.5 highspeed**, **MiniMax M2.1**, **MiniMax M2.1 highspeed**, and **MiniMax M2** to generate conversational content and trigger tool calls based on the provided context. It can be accessed via **HTTP requests**, the **Anthropic SDK** (Recommended), or the **OpenAI SDK**. **Supported Models** | Model Name | Context Window | Description | | :--------------------- | :------------- | :-------------------------------------------------------------------------------------------------------------------------------------------- | | MiniMax-M3 | 1,000,000 | **Latest M-series language model for agentic reasoning, tool use, coding, and long-context tasks** (output speed approximately 100+ tps) | | MiniMax-M2.7 | 204,800 | **Beginning the journey of recursive self-improvement. (output speed approximately 60 tps)** | | MiniMax-M2.7-highspeed | 204,800 | **M2.7 highspeed: Same performance, faster and more agile (output speed approximately 100 tps)** | | MiniMax-M2.5 | 204,800 | **Peak Performance. Ultimate Value. Master the Complex (output speed approximately 60 tps)** | | MiniMax-M2.5-highspeed | 204,800 | **M2.5 highspeed: Same performance, faster and more agile (output speed approximately 100 tps)** | | MiniMax-M2.1 | 204,800 | **Powerful Multi-Language Programming Capabilities with Comprehensively Enhanced Programming Experience (output speed approximately 60 tps)** | | MiniMax-M2.1-highspeed | 204,800 | **Faster and More Agile (output speed approximately 100 tps)** | | MiniMax-M2 | 204,800 | **Agentic capabilities, Advanced reasoning** | Please note: The maximum token count refers to the total number of input and output tokens. Use Anthropic SDK with MiniMax models Use OpenAI SDK with MiniMax models *** ## Video Model This API supports video generation from multimodal input (text, images, video, audio), covering text-to-video, image-to-video, first-and-last-frame, and reference-to-video scenarios. **Supported Models** | Model | Description | | :------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | MiniMax-H3 | Multimodal video generation model supporting text / image / first-and-last-frame / reference input, 768P / 2K resolution, 4–15s duration. | | MiniMax-H3-Max | Fast generation model. Supports text-to-video and image-to-video (first / last frame) only; reference input is not supported. 480P / 768P resolution (no 2K), 5–15s duration. | **API Usage Guide** Both models share the same `content[]` request protocol and query endpoints — switching models only requires changing the `model` field. MiniMax-H3 tasks are asynchronous. There are three creation endpoints—**Create Video Generation Task**, **Create H3-Context-IR Task**, and **Create Video Regeneration Task**—and shared endpoints for querying, listing, and cancelling or deleting tasks; MiniMax-H3-Max supports the **Create Video Generation Task** endpoint only. The workflow is as follows: 1. Create a video generation task, create an H3-Context-IR task with the same multimodal input, or create a video regeneration task for a source video that meets the MiniMax-H3 768P output specifications. A regeneration request must contain exactly one source-video item with `role=base_video`. All three endpoints return a `task_id` on success. 2. Use **Query Task** with the `task_id` to retrieve its status and result. When a video task succeeds, get its output URL from `content.url`; when an H3-Context-IR task succeeds, get the enhanced prompt from `content.prompt`. You can also use **List Tasks** and distinguish `generation`, `h3_context_ir`, and `regeneration` with `task_type`. 3. Use **Cancel or Delete Task** to cancel a queued task or delete a succeeded or failed task record. Create a video generation task from multimodal content input Deeply interpret multimodal video-generation context and produce a structured, enhanced prompt Regenerate a video that meets the MiniMax-H3 768P output specifications as a 2K video Query task status by task\_id and get the video download URL List tasks from the last 7 days and filter by task type Cancel a queued task or delete a succeeded or failed task record *** ## Speech Model The speech models provide **speech synthesis**, **voice cloning**, and **voice design**, supporting 40 languages and 300+ system voices, with synchronous or asynchronous generation. All interfaces are stateless: each call only processes the provided input, does not store user data, and involves no business-logic state. **Supported Models** | Model | Description | | :--------------- | :------------------------------------------------------------------------------------------------------- | | speech-2.8-hd | Latest HD model. Ultra-realistic quality featuring sound tags. | | speech-2.8-turbo | Latest Turbo model. Seamless speed meets natural flow. | | speech-2.6-hd | HD model with outstanding prosody and excellent cloning similarity. | | speech-2.6-turbo | Turbo model with support for 40 languages. | | speech-02-hd | Superior rhythm and stability, with outstanding performance in replication similarity and sound quality. | | speech-02-turbo | Superior rhythm and stability, with enhanced multilingual capabilities and excellent performance. | **API Overview** Four capabilities share the models above: 1. **Synchronous speech synthesis (T2A)**: real-time text-to-speech, up to **10,000 characters** per request; 300+ system and cloned voices, adjustable volume / pitch / speed, proportional mixing, streaming output, and `mp3` / `pcm` / `flac` / `wav` formats. Available over **HTTP** and **WebSocket**. 2. **Asynchronous long-text synthesis**: up to **1 million characters** per request, ideal for entire books; supports sentence-level timestamps (subtitles). Create a task to get a `task_id`, then use the returned `file_id` with the File API to download (the download URL is valid for **9 hours**). 3. **Voice cloning**: upload the audio to clone to get a `file_id` (optionally upload sample audio to improve quality), then call the cloning API to produce a custom `voice_id`. Individual or enterprise verification is required. 4. **Voice design**: generate a personalized voice from a description prompt; the resulting `voice_id` can be used directly with the synthesis APIs above. Voices produced by cloning and voice design are **temporary**: the fee is charged only on first use in speech synthesis (previews within those APIs do not count). If the voice is not used by any speech synthesis API within **168 hours (7 days)**, it is deleted. | Support Languages | | | | ----------------- | ------------- | ------------- | | 1. Chinese | 15. Turkish | 28. Malay | | 2. Cantonese | 16. Dutch | 29. Persian | | 3. English | 17. Ukrainian | 30. Slovak | | 4. Spanish | 18. Thai | 31. Swedish | | 5. French | 19. Polish | 32. Croatian | | 6. Russian | 20. Romanian | 33. Filipino | | 7. German | 21. Greek | 34. Hungarian | | 8. Portuguese | 22. Czech | 35. Norwegian | | 9. Arabic | 23. Finnish | 36. Slovenian | | 10. Italian | 24. Hindi | 37. Catalan | | 11. Japanese | 25. Bulgarian | 38. Nynorsk | | 12. Korean | 26. Danish | 39. Tamil | | 13. Indonesian | 27. Hebrew | 40. Afrikaans | | 14. Vietnamese | | | Synchronous speech synthesis via HTTP Streaming speech synthesis via WebSocket Create a long-text speech generation task Query speech generation task status Upload audio file to clone Execute voice cloning Generate personalized voices from descriptions *** ## Image Generation This API supports images generations from text or references, allowing custom aspect ratios and resolutions for diverse needs. **API Description** You can generate images by creating an image generation task using text prompts and/or reference images. **Model List** | Model | Description | | :------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | image-01 | A high-quality image generation model that produces fine-grained details. Supports both text-to-image and image-to-image generation (with subject reference for people). | Generate image from text description Generate image from reference image *** ## Music Generation Starting August 20, 2026, the paid APIs (Music Generation and Lyrics Generation) will no longer be available to new users; existing paying users can continue to use the current API services. The free music generation APIs (Music-3.0-free, Music-2.6-free, music-cover-free) will be discontinued. To experience or use music generation capabilities, please visit [MiniMax Audio](https://www.minimax.io/audio), or use the open-source [MiniMax Music 3 model on Hugging Face](https://huggingface.co/MiniMaxAI/MiniMax-Music3). This API generates a vocal song based on a music description (prompt) and lyrics. **Models** | Model | Usage | | :-------- | :--------------------------------------------------------------------------------------------------------------------- | | music-3.0 | The latest music generation model. Supports user-provided musical inspiration and lyrics to create AI-generated music. | Generate music from description and lyrics *** ## File Management This API is for file management and is used with other MiniMax APIs. **API Description** This API includes 5 endpoints: **Upload**, **List**, **Retrieve**, **Retrieve Content**, **Delete**. Supported file formats, capacity, and size limits are defined by the **Upload File** API documentation — see [Upload File](/docs/api-reference/file-management-upload). Upload files to the platform Get list of uploaded files *** ## Tools **Web Search** `web_search` is a server-side web search tool hosted and executed by MiniMax. The model can retrieve up-to-date information while generating a response and answer based on the search results. It is available through both the Anthropic Messages API and the OpenAI Responses API. See [Web Search](/docs/guides/server-tools#web_search) for interface details and examples. **Official MCP** MiniMax provides official Model Context Protocol (MCP) server implementations: * [Python version](https://github.com/MiniMax-AI/MiniMax-MCP) * [JavaScript version](https://github.com/MiniMax-AI/MiniMax-MCP-JS) Both support speech synthesis, voice cloning, video generation, and music generation. For details, refer to the [MiniMax MCP User Guide](/docs/guides/mcp-guide). # Error Codes Source: https://platform.minimax.io/docs/api-reference/errorcode This document lists common MiniMax API error codes and solutions to help developers quickly resolve issues. | Error Code | Message | Solution | | :--------- | :----------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------- | | 1000 | unknown error | Please retry your requests later. | | 1001 | request timeout | Please retry your requests later. | | 1002 | rate limit | Please retry your requests later. | | 1004 | not authorized / token not match group / cookie is missing, log in again | please check your API Key and make sure it is correct and active. | | 1008 | insufficient balance | Please check your account balance. | | 1024 | internal error | Please retry your requests later. | | 1026 | input new\_sensitive | Please change your input content. | | 1027 | output new\_sensitive | Please change your input content. | | 1033 | system error / mysql failed | Please retry your requests later. | | 1039 | token limit | Please retry your requests later. | | 1041 | conn limit | Please contact us if the issue persists. | | 1042 | invisible character ratio limit | Please check your input content for invisible or illegal characters. | | 1043 | The asr similarity check failed | Please check file\_id and text\_validation. | | 1044 | clone prompt similarity check failed | Please check clone prompt audio and prompt words. | | 2013 | invalid params / glyph definition format error | Please check the request parameters. | | 20132 | invalid samples or voice\_id | Please check your file\_id(in Voice Cloning API), voice\_id(in T2A v2 API, T2A Large v2 API) and contact us if the issue persists. | | 2037 | voice duration too short / voice duration too long | Please adjust the duration of your file\_id for voice clone. | | 2039 | voice clone voice id duplicate | Please check the voice\_id to ensure no duplication with the existing ones. | | 2042 | You don't have access to this voice\_id | Please check whether you are the creator of this voice\_id and contact us if the issue persists. | | 2045 | rate growth limit | Please avoid sudden increases and decreases in requests. | | 2048 | prompt audio too long | Please adjust the duration of the prompt\_audio file (\< 8s). | | 2049 | invalid API Key | Please check your API Key and make sure it is correct and active. | | 2056 | usage limit exceeded | Please wait for the resource release in the next 5-hour window. | # Delete File Source: https://platform.minimax.io/docs/api-reference/file-management-delete api-reference/file/management/api/openapi.json POST /v1/files/delete Delete files on the MiniMax API Platform. # List Files Source: https://platform.minimax.io/docs/api-reference/file-management-list api-reference/file/management/api/openapi.json GET /v1/files/list List files on the MiniMax API Platform. # Retrieve File Source: https://platform.minimax.io/docs/api-reference/file-management-retrieve api-reference/file/management/api/openapi.json GET /v1/files/retrieve Retrieve files on the MiniMax API Platform. # Retrieve Content Source: https://platform.minimax.io/docs/api-reference/file-management-retrieve-content api-reference/file/management/api/openapi.json GET /v1/files/retrieve_content Download the contents of a generated file. # Upload File Source: https://platform.minimax.io/docs/api-reference/file-management-upload api-reference/file/management/api/openapi.json POST /v1/files/upload Upload a file on the MiniMax API Platform. # Image-to-Image Generation Source: https://platform.minimax.io/docs/api-reference/image-generation-i2i api-reference/image/generation/api/image-to-image.json POST /v1/image_generation Use this API to generate images from image input. # Text to Image Generation Source: https://platform.minimax.io/docs/api-reference/image-generation-t2i api-reference/image/generation/api/text-to-image.json POST /v1/image_generation Use this API to generate images from text input. # Lyrics Generation Source: https://platform.minimax.io/docs/api-reference/lyrics-generation POST /v1/lyrics_generation Use this API to generate lyrics, supporting full song creation and lyrics editing/continuation. Starting August 20, 2026, the paid APIs (Music Generation and Lyrics Generation) will no longer be available to new users; existing paying users can continue to use the current API services. The free music generation APIs (Music-3.0-free, Music-2.6-free, music-cover-free) will be discontinued. To experience or use music generation capabilities, please visit [MiniMax Audio](https://www.minimax.io/audio), or use the open-source [MiniMax Music 3 model on Hugging Face](https://huggingface.co/MiniMaxAI/MiniMax-Music3). # List Models Source: https://platform.minimax.io/docs/api-reference/models/anthropic/list-models api-reference/models/anthropic/api/list-models.json GET /anthropic/v1/models Returns a list of all available models compatible with Anthropic API specification. # Retrieve Model Source: https://platform.minimax.io/docs/api-reference/models/anthropic/retrieve-model api-reference/models/anthropic/api/retrieve-model.json GET /anthropic/v1/models/{model_id} Retrieves details for a specific model, compatible with Anthropic API specification. # List Models Source: https://platform.minimax.io/docs/api-reference/models/openai/list-models api-reference/models/openai/api/list-models.json GET /v1/models Returns a list of all available models compatible with OpenAI API specification. # Retrieve Model Source: https://platform.minimax.io/docs/api-reference/models/openai/retrieve-model api-reference/models/openai/api/retrieve-model.json GET /v1/models/{model_id} Retrieves details for a specific model, compatible with OpenAI API specification. # Music Cover Preprocess Source: https://platform.minimax.io/docs/api-reference/music-cover-preprocess POST /v1/music_cover_preprocess Preprocess reference audio to extract features and lyrics for two-step cover generation. Starting August 20, 2026, the paid APIs (Music Generation and Lyrics Generation) will no longer be available to new users; existing paying users can continue to use the current API services. The free music generation APIs (Music-3.0-free, Music-2.6-free, music-cover-free) will be discontinued. To experience or use music generation capabilities, please visit [MiniMax Audio](https://www.minimax.io/audio), or use the open-source [MiniMax Music 3 model on Hugging Face](https://huggingface.co/MiniMaxAI/MiniMax-Music3). # Music Generation Source: https://platform.minimax.io/docs/api-reference/music-generation POST /v1/music_generation Use this API to generate a song from lyrics and a prompt. Starting August 20, 2026, the paid APIs (Music Generation and Lyrics Generation) will no longer be available to new users; existing paying users can continue to use the current API services. The free music generation APIs (Music-3.0-free, Music-2.6-free, music-cover-free) will be discontinued. To experience or use music generation capabilities, please visit [MiniMax Audio](https://www.minimax.io/audio), or use the open-source [MiniMax Music 3 model on Hugging Face](https://huggingface.co/MiniMaxAI/MiniMax-Music3). # Create Response Source: https://platform.minimax.io/docs/api-reference/responses-create api-reference/text/api/openapi-responses.json POST /v1/responses Call MiniMax models via the OpenAI Responses API compatible main endpoint. Generates model replies, supports streaming and non-streaming. ## Reasoning Control For `MiniMax-M3`, the `reasoning` field controls whether the response can include reasoning output. * If `reasoning` is omitted, reasoning is disabled by default and the response does not include an output item with `type: "reasoning"`. * `reasoning: {"effort": "none"}` is the default behavior and disables reasoning output for `MiniMax-M3`. * Values `minimal`, `low`, `medium`, and `high` are accepted for compatibility and enable reasoning output, but they do not tune MiniMax-M3's reasoning depth. * For M2.x models, reasoning cannot be disabled; `reasoning: {"effort": "none"}` is accepted but reasoning remains on. ```json theme={null} { "model": "MiniMax-M3", "input": "Which is larger, 9.11 or 9.9?" } ``` ```json theme={null} { "model": "MiniMax-M3", "input": "Which is larger, 9.11 or 9.9?", "reasoning": { "effort": "minimal" } } ``` # Estimate Input Tokens Source: https://platform.minimax.io/docs/api-reference/responses-input-tokens api-reference/text/api/openapi-responses.json POST /v1/responses/input_tokens Estimate the input token count of a request without invoking the model. Useful for evaluating request cost or checking context length limits before calling the main endpoint. # Create Speech Generation Task Source: https://platform.minimax.io/docs/api-reference/speech-t2a-async-create api-reference/speech/t2a-async/api/openapi.json POST /v1/t2a_async_v2 Use this API to create an asynchronous Text-to-Speech task. ### Returned File Information The return result for a single file input is shown below.\ If the input is a compressed package containing multiple files, a corresponding folder will be generated for each file. The contents inside each folder are the same as those for a single file input. ### Input File Type: txt File * Output Files: * Audio File: Format follows the request body settings. * Subtitle File: Sentence-level subtitle information. * Extra JSON File: Additional information related to the audio file. ### Input File Type: json File * `title` Field Output Files (if this field is empty, no files will be generated) * Audio File: Format follows the request body settings * Subtitle File: Sentence-level subtitle information * Extra JSON File: Additional information related to the audio file * `content` Field Output Files (if this field is empty, no files will be generated) * Audio File: Format follows the request body settings * Subtitle File: Sentence-level subtitle information * Extra JSON File: Additional information related to the audio file * `extra` Field Output Files (if this field is empty, no files will be generated) * Audio File: Format follows the request body settings * Subtitle File: Sentence-level subtitle information * Extra JSON File: Additional information related to the audio file # Query Speech Generation Task Status Source: https://platform.minimax.io/docs/api-reference/speech-t2a-async-query api-reference/speech/t2a-async/api/openapi.json GET /v1/query/t2a_async_query_v2 Use this API to query the status of an asynchronous Text-to-Speech task. **Note: This API allows a maximum of 10 queries per second.** # Text to Speech (T2A) HTTP Source: https://platform.minimax.io/docs/api-reference/speech-t2a-http api-reference/speech/t2a/api/openapi.json POST /v1/t2a_v2 Use this API for synchronous t2a over HTTP. Alternative Endpoint, Reduced Time to First Audio (TTFA): `https://api-uw.minimax.io/v1/t2a_v2` # Text to Speech (T2A) WebSocket Source: https://platform.minimax.io/docs/api-reference/speech-t2a-websocket Use this API for synchronous t2a over WebSocket. This example streams and plays the returned audio in real time while also saving the complete audio file. Note: To enable real-time audio playback, you must first install the [mpv player](https://mpv.io/installation/). Additionally, make sure to set your API Key in the environment variable `MINIMAX_API_KEY`. ```python theme={null} import asyncio import websockets import json import ssl import subprocess import os model = "speech-2.8-hd" file_format = "mp3" class StreamAudioPlayer: def __init__(self): self.mpv_process = None def start_mpv(self): """Start MPV player process""" try: mpv_command = ["mpv", "--no-cache", "--no-terminal", "--", "fd://0"] self.mpv_process = subprocess.Popen( mpv_command, stdin=subprocess.PIPE, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, ) print("MPV player started") return True except FileNotFoundError: print("Error: mpv not found. Please install mpv") return False except Exception as e: print(f"Failed to start mpv: {e}") return False def play_audio_chunk(self, hex_audio): """Play audio chunk""" try: if self.mpv_process and self.mpv_process.stdin: audio_bytes = bytes.fromhex(hex_audio) self.mpv_process.stdin.write(audio_bytes) self.mpv_process.stdin.flush() return True except Exception as e: print(f"Play failed: {e}") return False return False def stop(self): """Stop player""" if self.mpv_process: if self.mpv_process.stdin and not self.mpv_process.stdin.closed: self.mpv_process.stdin.close() try: self.mpv_process.wait(timeout=20) except subprocess.TimeoutExpired: self.mpv_process.terminate() async def establish_connection(api_key): """Establish WebSocket connection""" url = "wss://api.minimax.io/ws/v1/t2a_v2" headers = {"Authorization": f"Bearer {api_key}"} ssl_context = ssl.create_default_context() ssl_context.check_hostname = False ssl_context.verify_mode = ssl.CERT_NONE try: ws = await websockets.connect(url, additional_headers=headers, ssl=ssl_context) connected = json.loads(await ws.recv()) if connected.get("event") == "connected_success": print("Connection successful") return ws return None except Exception as e: print(f"Connection failed: {e}") return None async def start_task(websocket): """Send task start request""" start_msg = { "event": "task_start", "model": model, "voice_setting": { "voice_id": "male-qn-qingse", "speed": 1, "vol": 1, "pitch": 0, "english_normalization": False } "audio_setting": { "sample_rate": 32000, "bitrate": 128000, "format": file_format, "channel": 1 } } await websocket.send(json.dumps(start_msg)) response = json.loads(await websocket.recv()) return response.get("event") == "task_started" async def continue_task_with_stream_play(websocket, text, player): """Send continue request and stream play audio""" await websocket.send(json.dumps({ "event": "task_continue", "text": text })) chunk_counter = 1 total_audio_size = 0 audio_data = b"" while True: try: response = json.loads(await websocket.recv()) if "data" in response and "audio" in response["data"]: audio = response["data"]["audio"] if audio: print(f"Playing chunk #{chunk_counter}") audio_bytes = bytes.fromhex(audio) if player.play_audio_chunk(audio): total_audio_size += len(audio_bytes) audio_data += audio_bytes chunk_counter += 1 if response.get("is_final"): print(f"Audio synthesis completed: {chunk_counter-1} chunks") if player.mpv_process and player.mpv_process.stdin: player.mpv_process.stdin.close() # Save audio to file with open(f"output.{file_format}", "wb") as f: f.write(audio_data) print(f"Audio saved as output.{file_format}") estimated_duration = total_audio_size * 0.0625 / 1000 wait_time = max(estimated_duration + 5, 10) return wait_time except Exception as e: print(f"Error: {e}") break return 10 async def close_connection(websocket): """Close connection""" if websocket: try: await websocket.send(json.dumps({"event": "task_finish"})) await websocket.close() except Exception: pass async def main(): API_KEY = os.getenv("MINIMAX_API_KEY") TEXT = "The real danger is not that computers start thinking like people(sighs), but that people start thinking like computers. Computers can only help us with simple tasks." player = StreamAudioPlayer() try: if not player.start_mpv(): return ws = await establish_connection(API_KEY) if not ws: return if not await start_task(ws): print("Task startup failed") return wait_time = await continue_task_with_stream_play(ws, TEXT, player) await asyncio.sleep(wait_time) except Exception as e: print(f"Error: {e}") finally: player.stop() if 'ws' in locals(): await close_connection(ws) if __name__ == "__main__": asyncio.run(main()) ``` # Text to Speech (T2A) WebSocket (Bidirectional) Source: https://platform.minimax.io/docs/api-reference/speech-t2a-websocket-bidi WebSocket text-to-speech with streaming text input: send text character by character and let the server buffer it into sentences. ## Differences from `/ws/v1/t2a_v2` This API targets **streaming text input** — piping an LLM's streaming output straight into speech, token by token. | | [`/ws/v1/t2a_v2`](/docs/api-reference/speech-t2a-websocket) | `/ws/v1/t2a_v2_bidi` (this API) | | -------------------------------- | ----------------------------------------------------------- | ---------------------------------------------- | | Sentence buffering | **Client** must detect sentence boundaries | **Server** buffers automatically | | Sending text char by char | One synthesis per character, choppy audio | Buffered into full sentences first | | Interruption | Not supported, must close the connection | `task_cancel`, and you can continue afterwards | | Sentence boundary events | None | `sentence_start` / `sentence_end` | | `task_finish` | Closes the connection immediately | Flushes the buffer first, then closes | | Flush without ending the session | None | `task_flush` | The voice, audio and pronunciation parameters of `task_start` are **identical** to `/ws/v1/t2a_v2`, so an existing integration can reuse them as-is. ## Event flow 1. Establish the connection and receive `connected_success` 2. Send `task_start` and receive `task_started` 3. Send `task_continue` (**at any granularity, including a single character**); the server buffers the text and starts synthesizing * `sentence_start` is returned when a sentence starts synthesizing * audio arrives in chunks via `task_continued` * `sentence_end` is returned when that sentence is done 4. Send `task_cancel` to interrupt; after `task_canceled` you may keep sending `task_continue` 5. When a turn is over and you want its tail audio right away, send `task_flush`; the session continues after `task_flushed` 6. Send `task_finish`; the server synthesizes any leftover buffered text, then returns `task_finished` and closes the connection Do not conflate the three levels of completion: `is_final` marks the end of audio for one request, `sentence_end` marks the end of the current sentence, and `task_finished` marks the end of the whole session. A connection can host only one synthesis session at a time. Sending `task_start` again after the task has started returns `2206` (illegal event order) and closes the connection. ## Sentence buffering and latency The server detects sentence boundaries from punctuation, so **the punctuation in the text you send directly affects how natural the audio sounds**: | Text situation | Server behaviour | | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | | Ends with sentence-final punctuation (`。!?…!?.` or a newline) | Synthesized **immediately**, no added latency | | Contains secondary punctuation (`,、;:,;:`) | Splits only once enough text has accumulated, so it never emits tiny fragments | | Long text with no punctuation at all | Force-split once it hits the length cap; the boundary is then unrelated to meaning and the audio will sound clipped | | Ends without punctuation, but enough text has accumulated | Flushed after a short silence window | | Ends without punctuation and is short | **Keeps waiting** — the server will not synthesize half a word just to lower latency | The last row has a practical consequence for multi-turn conversations. If a turn ends with text that is both short and unpunctuated, it is not flushed by the short silence window and instead waits for a longer backstop window. Two ways to avoid that wait: **end the last piece with sentence-final punctuation**, or **send `task_flush`** to push it out explicitly. Note that `task_finish` is not a substitute — it closes the connection, so it cannot be used when running multiple turns over one connection. If your application sanitizes an LLM's output before forwarding it, **keep the original punctuation**. Without punctuation the server falls back to splitting purely by length, so pauses land in the wrong places and the audio sounds noticeably unnatural. When the upstream source (for example an LLM) stalls, the audio will contain a matching gap — that is unavoidable. The server will not flush a half-finished sentence to fill the gap, because that would only make the listener hear half a word and then wait anyway. ## Keeping the connection alive A connection that stays idle for roughly 120 seconds is closed by the server with `2201`. "Idle" means the server is neither receiving upstream events nor sending audio. The server **does not send** WebSocket ping frames on its own. If your session has long silent periods (for example while waiting for the user to speak), send pings from the client — the server replies with pong and refreshes the activity timer. Keeping the TCP connection open is not enough to avoid `2201`. ## Send rate and retries `2205` means too much text is queued for synthesis on the server, usually because you are sending faster than synthesis can keep up. `2205` is **not a quota rate limit**, and it is a soft failure: neither the connection nor the session is closed. Just resend that `task_continue` a moment later — **no reconnect and no second `task_start` are needed**. A single `task_continue` longer than 10,000 characters returns `2204`; that piece is skipped and the connection and session likewise stay open. # Speech to Text Source: https://platform.minimax.io/docs/api-reference/speech-to-text api-reference/speech/speech-to-text/api/openapi.json POST /v1/speech_to_text Use this API to transcribe an audio file into text, with support for streaming output, speaker diarization and subtitle export. # AI SDK Source: https://platform.minimax.io/docs/api-reference/text-ai-sdk Call MiniMax models using the AI SDK To meet developers' needs for the [AI SDK](https://ai-sdk.dev) ecosystem, MiniMax provides an official community provider. With simple configuration, you can integrate MiniMax capabilities into the AI SDK ecosystem. ## Quick Start ### 1. Install AI SDK and MiniMax Provider ```bash npm theme={null} npm install ai vercel-minimax-ai-provider ``` ```bash pnpm theme={null} pnpm add ai vercel-minimax-ai-provider ``` ### 2. Configure Environment Variables ```bash theme={null} export MINIMAX_API_KEY=${YOUR_API_KEY} ``` ### 3. Call API ```typescript TypeScript theme={null} import { minimax } from 'vercel-minimax-ai-provider'; import { generateText } from 'ai'; const { text, reasoning } = await generateText({ model: minimax('MiniMax-M3'), system: 'You are a helpful assistant.', prompt: 'Hi, how are you?', }); if (reasoning) { console.log(`Thinking:\n${reasoning}\n`); } console.log(`Text:\n${text}\n`); ``` ### 4. Important Note In multi-turn function call conversations, the complete model response (i.e., the assistant message) must be appended to the conversation history to maintain the continuity of the reasoning chain. * Append the full `result.response.messages` to the message history (includes all assistant and tool messages) ## Supported Models When using the AI SDK, the `MiniMax-M3` `MiniMax-M2.7` `MiniMax-M2.7-highspeed` `MiniMax-M2.5` `MiniMax-M2.5-highspeed` `MiniMax-M2.1` `MiniMax-M2.1-highspeed` `MiniMax-M2` models are supported: | Model Name | Context Window | Description | | :--------------------- | :------------- | :-------------------------------------------------------------------------------------------------------------------------------------------- | | MiniMax-M3 | 1,000,000 | **Latest M-series language model for agentic reasoning, tool use, coding, and long-context tasks** | | MiniMax-M2.7 | 204,800 | **Beginning the journey of recursive self-improvement** (output speed approximately 60 tps) | | MiniMax-M2.7-highspeed | 204,800 | **M2.7 Highspeed: Same performance, faster and more agile (output speed approximately 100 tps)** | | MiniMax-M2.5 | 204,800 | **Peak Performance. Ultimate Value. Master the Complex (output speed approximately 60 tps)** | | MiniMax-M2.5-highspeed | 204,800 | **M2.5 highspeed: Same performance, faster and more agile (output speed approximately 100 tps)** | | MiniMax-M2.1 | 204,800 | **Powerful Multi-Language Programming Capabilities with Comprehensively Enhanced Programming Experience (output speed approximately 60 tps)** | | MiniMax-M2.1-highspeed | 204,800 | **Faster and More Agile (output speed approximately 100 tps)** | | MiniMax-M2 | 204,800 | **Agentic capabilities, Advanced reasoning** | For details on how tps (Tokens Per Second) is calculated, please refer to [FAQ > About APIs](/docs/faq/about-apis#q-how-is-tps-tokens-per-second-calculated-for-text-models). The AI SDK compatibility interface currently supports the `MiniMax-M3` `MiniMax-M2.7` `MiniMax-M2.7-highspeed` `MiniMax-M2.5` `MiniMax-M2.5-highspeed` `MiniMax-M2.1` `MiniMax-M2.1-highspeed` `MiniMax-M2` models. For other models, please use the standard MiniMax API interface. ## Compatibility ### Supported Parameters When using the AI SDK, we support the following input parameters: | Parameter | Support Status | Description | | :------------ | :-------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | Fully supported | supports `MiniMax-M3` `MiniMax-M2.7` `MiniMax-M2.7-highspeed` `MiniMax-M2.5` `MiniMax-M2.5-highspeed` `MiniMax-M2.1` `MiniMax-M2.1-highspeed` `MiniMax-M2` models | | `messages` | Partial support | Supports text and tool calls, no image/document input | | `maxTokens` | Fully supported | Maximum number of tokens to generate | | `system` | Fully supported | System prompt | | `temperature` | Fully supported | Range \[0, 2], controls output randomness, recommended value: 1 | | `toolChoice` | Fully supported | Tool selection strategy | | `tools` | Fully supported | Tool definitions | | `topP` | Fully supported | Nucleus sampling parameter, range \[0, 1]. Default 0.95 for `MiniMax-M3` and 0.9 for `MiniMax-M2.x` models | ### Messages Field Support | Field Type | Support Status | Description | | :------------------- | :-------------- | :---------------------------- | | `role="user"` | Fully supported | User text messages | | `role="assistant"` | Fully supported | Assistant responses | | `role="tool"` | Fully supported | Tool call results | | `type="text"` | Fully supported | Text content | | `type="tool-call"` | Fully supported | Tool calls | | `type="tool-result"` | Fully supported | Tool call results | | `type="image"` | Not supported | Image input not supported yet | | `type="file"` | Not supported | File input not supported yet | ## Examples ### Streaming Response ```typescript TypeScript theme={null} import { minimax } from 'vercel-minimax-ai-provider'; import { streamText } from 'ai'; console.log("Starting stream response...\n"); console.log("=".repeat(60)); console.log("Thinking Process:"); console.log("=".repeat(60)); const result = streamText({ model: minimax('MiniMax-M3'), system: 'You are a helpful assistant.', prompt: 'Hi, how are you?', onError({ error }) { console.error(error); }, }); let inText = false; for await (const part of result.fullStream) { if (part.type === 'reasoning') { // Stream output thinking process process.stdout.write(part.text); } else if (part.type === 'text') { if (!inText) { inText = true; console.log("\n" + "=".repeat(60)); console.log("Response Content:"); console.log("=".repeat(60)); } // Stream output text content process.stdout.write(part.text); } } console.log("\n"); ``` ## Important Notes 1. The AI SDK compatibility interface currently supports the `MiniMax-M3` `MiniMax-M2.7` `MiniMax-M2.7-highspeed` `MiniMax-M2.5` `MiniMax-M2.5-highspeed` `MiniMax-M2.1` `MiniMax-M2.1-highspeed` `MiniMax-M2` models 2. The `temperature` parameter range is \[0, 2], values outside this range will return an error 3. Image and document type inputs are not currently supported 4. The default `minimax` provider instance uses the Anthropic-compatible API format. Use `minimaxOpenAI` if you need the OpenAI-compatible format. 5. For more information, see the [MiniMax AI Provider on AI SDK](https://ai-sdk.dev/providers/community-providers/minimax) and the [GitHub repository](https://github.com/MiniMax-AI/vercel-minimax-ai-provider) # Anthropic SDK Source: https://platform.minimax.io/docs/api-reference/text-anthropic-api Call MiniMax models using the Anthropic SDK To meet developers' needs for the Anthropic API ecosystem, our API now supports the Anthropic API format. With simple configuration, you can integrate MiniMax capabilities into the Anthropic API ecosystem. ## Quick Start ### 1. Install Anthropic SDK ```bash Python theme={null} pip install anthropic ``` ```bash Node.js theme={null} npm install @anthropic-ai/sdk ``` ### 2. Configure Environment Variables ```bash theme={null} export ANTHROPIC_BASE_URL=https://api.minimax.io/anthropic export ANTHROPIC_API_KEY=${YOUR_API_KEY} ``` ### 3. Call API ```python Python theme={null} import anthropic client = anthropic.Anthropic() message = client.messages.create( model="MiniMax-M3", max_tokens=1000, system="You are a helpful assistant.", messages=[ { "role": "user", "content": [ { "type": "text", "text": "Hi, how are you?" } ] } ] ) for block in message.content: if block.type == "thinking": print(f"Thinking:\n{block.thinking}\n") elif block.type == "text": print(f"Text:\n{block.text}\n") ``` ### 4. Important Note In multi-turn function call conversations, the complete model response (i.e., the assistant message) must be append to the conversation history to maintain the continuity of the reasoning chain. * Append the full `response.content` list to the message history (includes all content blocks: thinking/text/tool\_use) ## Supported Models When using the Anthropic SDK, the `MiniMax-M3` `MiniMax-M2.7` `MiniMax-M2.7-highspeed` `MiniMax-M2.5` `MiniMax-M2.5-highspeed` `MiniMax-M2.1` `MiniMax-M2.1-highspeed` `MiniMax-M2` model is supported: | Model Name | Context Window | Description | | :--------------------- | :------------- | :-------------------------------------------------------------------------------------------------------------------------------------------- | | MiniMax-M3 | 1,000,000 | **Latest M-series language model for agentic reasoning, tool use, coding, and long-context tasks** | | MiniMax-M2.7 | 204,800 | **Beginning the journey of recursive self-improvement** (output speed approximately 60 tps) | | MiniMax-M2.7-highspeed | 204,800 | **M2.7 Highspeed: Same performance, faster and more agile (output speed approximately 100 tps)** | | MiniMax-M2.5 | 204,800 | **Peak Performance. Ultimate Value. Master the Complex (output speed approximately 60 tps)** | | MiniMax-M2.5-highspeed | 204,800 | **M2.5 highspeed: Same performance, faster and more agile (output speed approximately 100 tps)** | | MiniMax-M2.1 | 204,800 | **Powerful Multi-Language Programming Capabilities with Comprehensively Enhanced Programming Experience (output speed approximately 60 tps)** | | MiniMax-M2.1-highspeed | 204,800 | **Faster and More Agile (output speed approximately 100 tps)** | | MiniMax-M2 | 204,800 | **Agentic capabilities, Advanced reasoning** | For details on how tps (Tokens Per Second) is calculated, please refer to [FAQ > About APIs](/docs/faq/about-apis#q-how-is-tps-tokens-per-second-calculated-for-text-models). The Anthropic API compatibility interface currently only supports the `MiniMax-M3` `MiniMax-M2.7` `MiniMax-M2.7-highspeed` `MiniMax-M2.5` `MiniMax-M2.5-highspeed` `MiniMax-M2.1` `MiniMax-M2.1-highspeed` `MiniMax-M2` model. For other models, please use the standard MiniMax API interface. ## Compatibility ### Supported Parameters When using the Anthropic SDK, we support the following input parameters: | Parameter | Support Status | Description | | :------------------- | :-------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | Fully supported | supports `MiniMax-M3` `MiniMax-M2.7` `MiniMax-M2.7-highspeed` `MiniMax-M2.5` `MiniMax-M2.5-highspeed` `MiniMax-M2.1` `MiniMax-M2.1-highspeed` `MiniMax-M2` model | | `messages` | Partial support | `MiniMax-M3` supports text, image, video, tool use, tool result, and thinking blocks. The M2.7, M2.5, M2.1, and M2 series support text and tool-call content blocks only; they do not support image or video input | | `max_tokens` | Fully supported | Maximum number of tokens to generate | | `stream` | Fully supported | Streaming response | | `system` | Fully supported | System prompt | | `temperature` | Fully supported | Range \[0, 2], controls output randomness, recommended value: 1 | | `tool_choice` | Fully supported | Tool selection strategy | | `tools` | Fully supported | Tool definitions | | `top_p` | Fully supported | Nucleus sampling parameter, range \[0, 1]. Default 0.95 for `MiniMax-M3` and 0.9 for M2.x models | | `metadata` | Fully Supported | Metadata | | `thinking` | Fully Supported | Thinking is off by default for MiniMax-M3 and can be enabled with `adaptive`. Thinking cannot be disabled for M2.x models. | | `service_tier` | Fully Supported | Request admission tier. Supported values are `standard` and `priority`; if omitted, requests use `standard`. The `priority` [price](/docs/guides/pricing-paygo) is 1.5 times the `standard` price and ensures priority admission so the request is processed ahead of other requests, leading to faster responses and fewer failures. | | `top_k` | Ignored | This parameter will be ignored | | `stop_sequences` | Ignored | This parameter will be ignored | | `mcp_servers` | Ignored | This parameter will be ignored | | `context_management` | Ignored | This parameter will be ignored | | `container` | Ignored | This parameter will be ignored | ### Thinking Control For `MiniMax-M3`, the `thinking` parameter controls whether the model can emit `thinking` content blocks. * If `thinking` is omitted, thinking is off by default and the response does not include `thinking` blocks. * Set `thinking: {"type": "adaptive"}` to explicitly enable thinking. For MiniMax-M3, `adaptive` is equivalent to thinking on. * Set `thinking: {"type": "disabled"}` to explicitly keep MiniMax-M3 thinking output off. * For M2.x models, thinking cannot be disabled; `thinking: {"type": "disabled"}` is accepted but thinking remains on. When a response includes `thinking` blocks, preserve them unchanged in later turns, especially in tool-use conversations. ### Messages Field Support | Field Type | Support Status | Description | | :------------------- | :-------------- | :--------------------------------------------------------------------------------- | | `type="text"` | Fully supported | Text messages | | `type="image"` | M3 only | Image input via URL or base64. Supports JPEG, PNG, GIF, WEBP | | `type="video"` | M3 only | Video input via URL, base64, or `mm_file://{file_id}`. Supports MP4, AVI, MOV, MKV | | `type="tool_use"` | Fully supported | Tool calls | | `type="tool_result"` | Fully supported | Tool call results | | `type="thinking"` | Fully supported | Reasoning content. Return the block unchanged in multi-turn thinking conversations | For `MiniMax-M3`, URL or base64 videos can be up to 50 MB, images can be up to 10 MB, and the request body can be up to 64 MB. For larger videos, upload through the Files API and pass `mm_file://{file_id}`; Files API videos can be up to 512 MB. Image token usage depends on image size and content. Use this as a rough single-image heuristic; check `POST /anthropic/v1/messages/count_tokens` or response `usage` for exact usage: | `detail` | Rough single-image token usage | | :-------- | :------------------------------------------ | | `low` | Usually a few hundred tokens, up to \~600 | | `default` | Often \~1k-3k tokens, up to \~5k | | `high` | Often several thousand tokens, up to \~15k+ | The Anthropic-compatible API also supports `POST /anthropic/v1/messages/count_tokens` for `MiniMax-M3` token estimation. This endpoint returns input token usage without generating model output. ## Examples ### Streaming Response ```python Python theme={null} import anthropic client = anthropic.Anthropic() print("Starting stream response...\n") print("=" * 60) print("Thinking Process:") print("=" * 60) stream = client.messages.create( model="MiniMax-M3", max_tokens=1000, system="You are a helpful assistant.", messages=[ {"role": "user", "content": [{"type": "text", "text": "Hi, how are you?"}]} ], stream=True, ) reasoning_buffer = "" text_buffer = "" for chunk in stream: if chunk.type == "content_block_start": if hasattr(chunk, "content_block") and chunk.content_block: if chunk.content_block.type == "text": print("\n" + "=" * 60) print("Response Content:") print("=" * 60) elif chunk.type == "content_block_delta": if hasattr(chunk, "delta") and chunk.delta: if chunk.delta.type == "thinking_delta": # Stream output thinking process new_thinking = chunk.delta.thinking if new_thinking: print(new_thinking, end="", flush=True) reasoning_buffer += new_thinking elif chunk.delta.type == "text_delta": # Stream output text content new_text = chunk.delta.text if new_text: print(new_text, end="", flush=True) text_buffer += new_text print("\n") ``` ## Important Notes 1. The Anthropic API compatibility interface currently only supports the `MiniMax-M3` `MiniMax-M2.7` `MiniMax-M2.7-highspeed` `MiniMax-M2.5` `MiniMax-M2.5-highspeed` `MiniMax-M2.1` `MiniMax-M2.1-highspeed` `MiniMax-M2` model 2. The `temperature` parameter range is \[0, 2], values outside this range will return an error 3. Some Anthropic parameters (such as `top_k`, `stop_sequences`, `mcp_servers`, `context_management`, `container`) will be ignored 4. `MiniMax-M3` supports image and video input through Anthropic-compatible content blocks. The M2.7, M2.5, M2.1, and M2 series support text and tool-call content blocks only # Messages API Source: https://platform.minimax.io/docs/api-reference/text-chat-anthropic api-reference/text/api/openapi-chat-anthropic.json POST /anthropic/v1/messages Use the Anthropic API compatible Messages format to call MiniMax models. ✨ **New model — `MiniMax-M3`** **Core capabilities**: **Coding/Agentic SOTA**, **1M long context**, **multimodal**. **What's new in `MiniMax-M3`:** 1. Image and video understanding — see the example code on the right 2. Control thinking via the `thinking` parameter # Chat Completions API Source: https://platform.minimax.io/docs/api-reference/text-chat-openai api-reference/text/api/openapi-chat-openai.json POST /v1/chat/completions Use the OpenAI API compatible Chat Completions format to call MiniMax models. ✨ **New model — `MiniMax-M3`** **Core capabilities**: **Coding/Agentic SOTA**, **1M long context**, **multimodal**. **What's new in `MiniMax-M3`:** 1. Image and video understanding — see the example code on the right 2. Control thinking via the `thinking` parameter # OpenAI SDK Source: https://platform.minimax.io/docs/api-reference/text-openai-api Call MiniMax models using the OpenAI SDK To meet developers' needs for the OpenAI API ecosystem, our API now supports the OpenAI API format. With simple configuration, you can integrate MiniMax capabilities into the OpenAI API ecosystem. ## Quick Start ### 1. Install OpenAI SDK ```bash Python theme={null} pip install openai ``` ```bash Node.js theme={null} npm install openai ``` ### 2. Configure Environment Variables ```bash theme={null} export OPENAI_BASE_URL=https://api.minimax.io/v1 export OPENAI_API_KEY=${YOUR_API_KEY} ``` ### 3. Call API ```python Python theme={null} from openai import OpenAI client = OpenAI() response = client.chat.completions.create( model="MiniMax-M3", messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Hi, how are you?"}, ], # Set reasoning_split=True to separate thinking content into reasoning_details field extra_body={"reasoning_split": True}, ) print(f"Thinking:\n{response.choices[0].message.reasoning_details[0]['text']}\n") print(f"Text:\n{response.choices[0].message.content}\n") ``` ### 4. Important Note In multi-turn function call conversations, the complete model response (i.e., the assistant message) must be append to the conversation history to maintain the continuity of the reasoning chain. * Append the full `response_message` object (including the `tool_calls` field) to the message history * For native OpenAI API with `MiniMax-M3` `MiniMax-M2.7` `MiniMax-M2.7-highspeed` `MiniMax-M2.5` `MiniMax-M2.5-highspeed` `MiniMax-M2.1` `MiniMax-M2.1-highspeed` `MiniMax-M2` models, the `content` field will contain `` tag content, which must be preserved completely * In the Interleaved Thinking compatible format, by enabling the additional parameter (`reasoning_split=True`), the model's thinking content is provided separately via the `reasoning_details` field, which must also be preserved completely ## Supported Models When using the OpenAI SDK, the following MiniMax models are supported: | Model Name | Context Window | Description | | :--------------------- | :------------- | :-------------------------------------------------------------------------------------------------------------------------------------------- | | MiniMax-M3 | 1,000,000 | **Latest M-series language model for agentic reasoning, tool use, coding, and long-context tasks** | | MiniMax-M2.7 | 204,800 | **Beginning the journey of recursive self-improvement** (output speed approximately 60 tps) | | MiniMax-M2.7-highspeed | 204,800 | **M2.7 Highspeed: Same performance, faster and more agile (output speed approximately 100 tps)** | | MiniMax-M2.5 | 204,800 | **Peak Performance. Ultimate Value. Master the Complex (output speed approximately 60 tps)** | | MiniMax-M2.5-highspeed | 204,800 | **M2.5 highspeed: Same performance, faster and more agile (output speed approximately 100 tps)** | | MiniMax-M2.1 | 204,800 | **Powerful Multi-Language Programming Capabilities with Comprehensively Enhanced Programming Experience (output speed approximately 60 tps)** | | MiniMax-M2.1-highspeed | 204,800 | **Faster and More Agile (output speed approximately 100 tps)** | | MiniMax-M2 | 204,800 | **Agentic capabilities, Advanced reasoning** | For details on how tps (Tokens Per Second) is calculated, please refer to [FAQ > About APIs](/docs/faq/about-apis#q-how-is-tps-tokens-per-second-calculated-for-text-models). For more model information, please refer to the standard MiniMax API documentation. ## Multimodal Input OpenAI-compatible Chat Completions support text, image, and video input for `MiniMax-M3`. Use `image_url` content parts for images and `video_url` content parts for videos. The `detail` field accepts `low`, `default`, or `high` and defaults to `default`; `max_long_side_pixel` can be used to control the longest side. Images support JPEG, PNG, GIF, and WEBP. Videos support MP4, AVI, MOV, and MKV; `fps` defaults to 1 and accepts values from 0.2 to 5. URL or base64 videos can be up to 50 MB, images can be up to 10 MB, and the request body can be up to 64 MB. For larger videos, upload through the Files API and pass `mm_file://{file_id}`; Files API videos can be up to 512 MB. Image token usage depends on image size and content. Use this as a rough single-image heuristic; check response `usage` or token counting where available for exact usage: | `detail` | Rough single-image token usage | | :-------- | :------------------------------------------ | | `low` | Usually a few hundred tokens, up to \~600 | | `default` | Often \~1k-3k tokens, up to \~5k | | `high` | Often several thousand tokens, up to \~15k+ | ```python Python theme={null} response = client.chat.completions.create( model="MiniMax-M3", messages=[ { "role": "user", "content": [ {"type": "text", "text": "Summarize what is happening here."}, { "type": "image_url", "image_url": { "url": "https://example.com/image.png", "detail": "default", }, }, { "type": "video_url", "video_url": { "url": "mm_file://file_id", "detail": "default", }, }, ], } ], ) ``` ## MiniMax-M3 Request Parameters `MiniMax-M3` supports these additional Chat Completions parameters through the OpenAI-compatible API: | Parameter | Description | | :----------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `thinking` | Controls MiniMax-M3 thinking. `type` can be `disabled` or `adaptive`; when omitted, thinking is on by default. For M2.x models, thinking cannot be disabled. | | `stream_options.include_usage` | When streaming, set to `true` to include token usage in the stream. | | `max_tokens` | Legacy generation length limit. | | `max_completion_tokens` | Generation length limit; use this field for new integrations. | | `temperature` | Sampling temperature. Range `[0, 2]`, default `1`. | | `top_p` | Nucleus sampling. Range `[0, 1]`. Default `0.95` for `MiniMax-M3` and `0.9` for M2.x models. | | `tools` | Function tool definitions. | | `reasoning_split` | Output-format switch. When enabled, separates thinking content into `reasoning_content` and `reasoning_details`. | | `service_tier` | Request admission tier. Supported values are `standard` and `priority`; if omitted, requests use `standard`. The `priority` [price](/docs/guides/pricing-paygo) is 1.5 times the `standard` price and ensures priority admission so the request is processed ahead of other requests, leading to faster responses and fewer failures. | ### Thinking Control For `MiniMax-M3`, the `thinking` parameter controls whether the model can emit thinking content. * If `thinking` is omitted, thinking is on by default and the response includes thinking content. * Set `thinking: {"type": "adaptive"}` to explicitly keep thinking on. For MiniMax-M3, `adaptive` is equivalent to thinking on. * Set `thinking: {"type": "disabled"}` to skip thinking and answer directly. * For M2.x models, thinking cannot be disabled; `thinking: {"type": "disabled"}` is accepted but thinking remains on. `reasoning_split` does not enable or disable thinking. It only controls how thinking content is returned: when `true`, thinking is exposed through `reasoning_content` and `reasoning_details`; when `false`, native Chat Completions responses keep thinking inside the `content` field with `...` tags. ```python Python theme={null} response = client.chat.completions.create( model="MiniMax-M3", messages=[{"role": "user", "content": "Hi, how are you?"}], extra_body={ "thinking": {"type": "adaptive"}, }, ) ``` ## Examples ### Streaming Response ```python Python theme={null} from openai import OpenAI client = OpenAI() print("Starting stream response...\n") print("=" * 60) print("Thinking Process:") print("=" * 60) stream = client.chat.completions.create( model="MiniMax-M3", messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Hi, how are you?"}, ], # Set reasoning_split=True to separate thinking content into reasoning_details field extra_body={"reasoning_split": True}, stream=True, ) reasoning_buffer = "" text_buffer = "" for chunk in stream: if ( hasattr(chunk.choices[0].delta, "reasoning_details") and chunk.choices[0].delta.reasoning_details ): for detail in chunk.choices[0].delta.reasoning_details: if "text" in detail: reasoning_text = detail["text"] new_reasoning = reasoning_text[len(reasoning_buffer) :] if new_reasoning: print(new_reasoning, end="", flush=True) reasoning_buffer = reasoning_text if chunk.choices[0].delta.content: content_text = chunk.choices[0].delta.content new_text = content_text[len(text_buffer) :] if text_buffer else content_text if new_text: print(new_text, end="", flush=True) text_buffer = content_text print("\n" + "=" * 60) print("Response Content:") print("=" * 60) print(f"{text_buffer}\n") ``` ### Tool Use & Interleaved Thinking Learn how to use M3 Tool Use and Interleaved Thinking capabilities with OpenAI SDK, please refer to the following documentation. Learn how to leverage MiniMax-M3 tool calling and interleaved thinking capabilities to enhance performance in complex tasks. ## Important Notes 1. The `temperature` parameter range is \[0, 2], recommended value: 1.0, values outside this range will return an error 2. Some OpenAI parameters (such as `presence_penalty`, `frequency_penalty`, `logit_bias`, etc.) will be ignored 3. Image and video inputs are supported by `MiniMax-M3` through OpenAI-compatible message content parts; audio input is not currently supported 4. The `n` parameter only supports value 1 5. The deprecated `function_call` is not supported, please use the `tools` parameter # Text Generation Source: https://platform.minimax.io/docs/api-reference/text-post api-reference/text/api/openapi.json POST /v1/text/chatcompletion_v2 Use this API to create chat completions. # Prompt Caching Source: https://platform.minimax.io/docs/api-reference/text-prompt-caching Prompt caching effectively reduces latency and costs. # Features * **Automatic Caching**: Passive caching that automatically identifies repeated context content without changing API call methods (*In contrast, the caching mode that requires explicitly setting parameters in the Anthropic API is called "Explicit Prompt Caching", see [Explicit Prompt Caching (Anthropic API)](/docs/api-reference/anthropic-api-compatible-cache)*) * **Cost Reduction**: Input tokens that hit the cache are billed at a lower price, significantly saving costs * **Speed Improvement**: Reduces processing time for repeated content, accelerating model response This mechanism is particularly suitable for the following scenarios: * System prompt reuse: In multi-turn conversations, system prompts typically remain unchanged * Fixed tool lists: Tools used in a category of tasks are often consistent * Multi-turn conversation history: In complex conversations, historical messages often contain a lot of repeated information Scenarios that meet the above conditions can effectively save token consumption and speed up response times using the caching mechanism. # Code Examples **Install SDK** ```bash theme={null} theme={null} pip install anthropic ``` **Environment Variable Setup** ```bash theme={null} theme={null} export ANTHROPIC_BASE_URL=https://api.minimax.io/anthropic export ANTHROPIC_API_KEY=${YOUR_API_KEY} ``` **First Request - Establish Cache** ```python theme={null} theme={null} import anthropic client = anthropic.Anthropic() response1 = client.messages.create( model="MiniMax-M3", system="You are an AI assistant tasked with analyzing literary works. Your goal is to provide insightful commentary on themes, characters, and writing style.\n", messages=[ { "role": "user", "content": [ { "type": "text", "text": "" } ] }, ], max_tokens=10240, ) print("First request result:") for block in response1.content: if block.type == "thinking": print(f"Thinking:\n{block.thinking}\n") elif block.type == "text": print(f"Output:\n{block.text}\n") print(f"Input Tokens: {response1.usage.input_tokens}") print(f"Output Tokens: {response1.usage.output_tokens}") print(f"Cache Hit Tokens: {response1.usage.cache_read_input_tokens}") ``` **Second Request - Reuse Cache** ```python theme={null} theme={null} response2 = client.messages.create( model="MiniMax-M3", system="You are an AI assistant tasked with analyzing literary works. Your goal is to provide insightful commentary on themes, characters, and writing style.\n", messages=[ { "role": "user", "content": [ { "type": "text", "text": "" } ] }, ], max_tokens=10240, ) print("\nSecond request result:") for block in response2.content: if block.type == "thinking": print(f"Thinking:\n{block.thinking}\n") elif block.type == "text": print(f"Output:\n{block.text}\n") print(f"Input Tokens: {response2.usage.input_tokens}") print(f"Output Tokens: {response2.usage.output_tokens}") print(f"Cache Hit Tokens: {response2.usage.cache_read_input_tokens}") ``` **Response includes context cache token usage information:** ```json theme={null} theme={null} { "usage": { "input_tokens": 108, "output_tokens": 91, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 14813 } } ``` **Install SDK** ```bash theme={null} theme={null} pip install openai ``` **Environment Variable Setup** ```bash theme={null} theme={null} export OPENAI_BASE_URL=https://api.minimax.io/v1 export OPENAI_API_KEY=${YOUR_API_KEY} ``` **First Request - Establish Cache** ```python theme={null} theme={null} from openai import OpenAI client = OpenAI() response1 = client.chat.completions.create( model="MiniMax-M3", messages=[ {"role": "system", "content": "You are an AI assistant tasked with analyzing literary works. Your goal is to provide insightful commentary on themes, characters, and writing style.\n"}, {"role": "user", "content": ""}, ], # Set reasoning_split=True to separate thinking content into reasoning_details field extra_body={"reasoning_split": True}, ) print("First request result:") print(f"Response: {response1.choices[0].message.content}") print(f"Total Tokens: {response1.usage.total_tokens}") print(f"Cached Tokens: {response1.usage.prompt_tokens_details.cached_tokens if hasattr(response1.usage, 'prompt_tokens_details') else 0}") ``` **Second Request - Reuse Cache** ```python theme={null} theme={null} response2 = client.chat.completions.create( model="MiniMax-M3", messages=[ {"role": "system", "content": "You are an AI assistant tasked with analyzing literary works. Your goal is to provide insightful commentary on themes, characters, and writing style.\n"}, {"role": "user", "content": ""}, ], # Set reasoning_split=True to separate thinking content into reasoning_details field extra_body={"reasoning_split": True}, ) print("\nSecond request result:") print(f"Response: {response2.choices[0].message.content}") print(f"Total Tokens: {response2.usage.total_tokens}") print(f"Cached Tokens: {response2.usage.prompt_tokens_details.cached_tokens if hasattr(response2.usage, 'prompt_tokens_details') else 0}") ``` **Response includes context cache token usage information:** ```json theme={null} theme={null} { "usage": { "prompt_tokens": 1200, "completion_tokens": 300, "total_tokens": 1500, "prompt_tokens_details": { "cached_tokens": 800 } } } ``` # Important Notes * Caching applies to API calls with 512 or more input tokens * Caching uses prefix matching, constructed in the order of "tool list → system prompts → user messages". Changes to any module's content may affect caching effectiveness # Best Practices * Place static or repeated content (including tool list, system prompts, user messages) at the beginning of the conversation, and put dynamic user information at the end of the conversation to maximize cache utilization * Monitor cache performance through the usage tokens returned by the API, and regularly analyze to optimize your usage strategy # Pricing Prompt caching uses differentiated pricing: * Cache hit tokens: Billed at discounted price * New input tokens: Billed at standard input price * Output tokens: Billed at standard output price > See the [Pay as You Go pricing](/docs/guides/pricing-paygo) page for details. Pricing example: ``` Assuming the MiniMax-M3 standard price for input ≤512k tokens: input is $0.60/1M tokens, output is $2.40/1M tokens, and cache hit is $0.12/1M tokens: Single request token usage details: - Total input tokens: 50000 - Cache hit tokens: 45000 - New input content tokens: 5000 - Output tokens: 1000 Billing calculation: - New input content cost: 5000 × 0.60/1000000 = $0.003 - Cache cost: 45000 × 0.12/1000000 = $0.0054 - Output cost: 1000 × 2.40/1000000 = $0.0024 - Total cost: 0.003 + 0.0054 + 0.0024 = $0.0108 Compared to no caching (50000 × 0.60/1000000 + 1000 × 2.40/1000000 = $0.0324), saves about 66.7% ``` For MiniMax-M3, long-context pricing applies when input tokens are greater than 512k, including cache-hit tokens. # Further Reading # Cache Comparison | | Prompt Caching (Passive) | Explicit Prompt Caching (Anthropic API) | | :--------------- | :------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------ | | Usage | Automatically identifies and caches repeated content | Explicitly set cache\_control in API | | Billing | Cache hit tokens billed at discounted price
No additional charge for cache writes | Cache hit tokens billed at discounted price
First-time cache writes incur additional charges | | Expiration | Expiration time automatically adjusted based on system load | 5-minute expiration, automatically renewed with continued use | | Supported Models | MiniMax-M3
MiniMax-M2.7 series
MiniMax-M2.5 series
MiniMax-M2.1 series | MiniMax-M2.7 series
MiniMax-M2.5 series
MiniMax-M2.1 series
MiniMax-M2 series | # Create Video Agent Task Source: https://platform.minimax.io/docs/api-reference/video-agent-create POST /v1/video_template_generation Use this API to create video Agent tasks. # Query Video Template Generation Task Source: https://platform.minimax.io/docs/api-reference/video-agent-query GET /v1/query/video_template_generation Use this API to query the task status of generated videos. # Video Download Source: https://platform.minimax.io/docs/api-reference/video-generation-download api-reference/video/generation/api/openapi.json GET /v1/files/retrieve Use this API to download generated videos. # Create First & Last Frame Video Generation Task Source: https://platform.minimax.io/docs/api-reference/video-generation-fl2v api-reference/video/generation/api/start-end-to-video.json POST /v1/video_generation Use this API to create a video generation task from start and end frame images, with optional text input. # Image-to-Video Task Source: https://platform.minimax.io/docs/api-reference/video-generation-i2v api-reference/video/generation/api/image-to-video.json POST /v1/video_generation Use this API to create a video generation task from image, with optional text input. # Query Video Generation Task Status Source: https://platform.minimax.io/docs/api-reference/video-generation-query api-reference/video/generation/api/openapi.json GET /v1/query/video_generation # Subject-Reference to Video Generation Task Source: https://platform.minimax.io/docs/api-reference/video-generation-s2v api-reference/video/generation/api/subject-reference-to-video.json POST /v1/video_generation # Create Text-to-Video Generation Task Source: https://platform.minimax.io/docs/api-reference/video-generation-t2v api-reference/video/generation/api/text-to-video.json POST /v1/video_generation Use this API to create a video generation task from text input. # Create Video Generation Task Source: https://platform.minimax.io/docs/api-reference/video-generation-v2-create api-reference/video/generation/api/v2-video-generation.json POST /v2/video_generation Video generation V2 endpoint. Provide multimodal input via the content array (text / image / video / audio); switch between MiniMax H3 and MiniMax H3 Max with the `model` field to support text-to-video, image-to-video (first & last frame), and reference-to-video, with output up to 2K.

Note: To use MiniMax H3 or MiniMax H3 Max, please select the [Pay-as-you-go API](/docs/guides/pricing-paygo#video). # Cancel or Delete Task Source: https://platform.minimax.io/docs/api-reference/video-generation-v2-delete api-reference/video/generation/api/v2-video-generation.json DELETE /v2/video_generation/{task_id} Cancel a queued task or delete a succeeded or failed video generation, H3-Context-IR, or video regeneration task record based on its current status. This endpoint automatically performs a cancel or delete based on the task's **current status**, as follows: | Task status | Action | Description | | :---------- | :---------- | :------------------------------------------------------------- | | `queued` | `cancelled` | Cancel the task; processing has not started, no charge | | `succeeded` | `deleted` | Delete the task record | | `failed` | `deleted` | Delete the task record | | `running` | — | Not allowed, returns an error (cannot cancel while processing) | | `cancelled` | — | Not allowed, returns an error | # Create H3-Context-IR Task Source: https://platform.minimax.io/docs/api-reference/video-generation-v2-h3-context-ir api-reference/video/generation/api/v2-video-generation.json POST /v2/h3_context_ir Deeply interpret multimodal context and generate a structured, semantically enriched video prompt. This endpoint only returns an enhanced video prompt. It does not create a video generation task. H3-Context-IR deeply interprets multimodal context across text, images, audio, and video. It analyzes relationships among the inputs and between those inputs and the intended output, performs complex reasoning, and converts that understanding into a structured representation with richer semantic detail while preserving the user's original intent as much as possible. H3-Context-IR is a complex system and its implementation is not open sourced. This API can be used both to validate the official Full 2K-Workflow results and in production workflows. After creating the task, use [Query Task](/docs/api-reference/video-generation-v2-query) or [List Tasks](/docs/api-reference/video-generation-v2-list). H3-Context-IR tasks have `task_type=h3_context_ir`; when the task succeeds, retrieve the enhanced prompt from `content.prompt`. # List Tasks Source: https://platform.minimax.io/docs/api-reference/video-generation-v2-list api-reference/video/generation/api/v2-video-generation.json GET /v2/query/video_generation List tasks from the last 7 days with pagination. Supports filtering by status, task ID, model, and task type. # Query Task Source: https://platform.minimax.io/docs/api-reference/video-generation-v2-query api-reference/video/generation/api/v2-video-generation.json GET /v2/query/video_generation/{task_id} Query the status and result of a single video generation, H3-Context-IR, or video regeneration task from the last 7 days by task_id. # Create Video Regeneration Task Source: https://platform.minimax.io/docs/api-reference/video-generation-v2-regeneration api-reference/video/generation/api/v2-video-generation.json POST /v2/video_regeneration Regenerate a source video that meets the MiniMax-H3 768P output specifications into a 2K video. Two methods are supported (choose one): * **By task ID**: pass an existing generation task's `source_task_id` * **By source video**: pass `base_video` in `content` This endpoint only regenerates videos that meet the MiniMax-H3 768P output specifications to produce 2K output. It does not perform general-purpose processing of arbitrary videos. Regeneration tasks have `task_type=regeneration` and can be managed through the shared H3 [Query Task](/docs/api-reference/video-generation-v2-query), [List Tasks](/docs/api-reference/video-generation-v2-list), and [Cancel or Delete Task](/docs/api-reference/video-generation-v2-delete) endpoints. # Voice Clone Source: https://platform.minimax.io/docs/api-reference/voice-cloning-clone api-reference/speech/voice-cloning/api/openapi.json POST /v1/voice_clone Use this API for rapid voice cloning. If a cloned voice is not used within 7 days, the system will delete it. # Upload Audio for Voice Cloning Source: https://platform.minimax.io/docs/api-reference/voice-cloning-uploadcloneaudio api-reference/speech/voice-cloning/api/upload-file.json POST /v1/files/upload Use this API to upload audio files for voice cloning. # Upload Prompt Auido Source: https://platform.minimax.io/docs/api-reference/voice-cloning-uploadprompt api-reference/speech/voice-cloning/api/upload-prompt.json POST /v1/files/upload Use this API to upload prompt audio file. Providing this file helps to enhance the voice similarity and stability of the Text-to-Speech output. # Voice Design Source: https://platform.minimax.io/docs/api-reference/voice-design-design api-reference/speech/voice-design/api/openapi.json POST /v1/voice_design Use this API to design custom voices by inputting text. # Delete Voice Source: https://platform.minimax.io/docs/api-reference/voice-management-delete api-reference/speech/voice-management/api/openapi.json POST /v1/delete_voice Use this API to delete generated voices. This API is used to delete a specified voice\_id. Deletions apply only to voice\_id values generated through [Voice Clone API](/docs/api-reference/voice-cloning-clone) and [Voice Design API](/docs/api-reference/voice-design-design). ⚠️ Note: Once deleted, the voice\_id cannot be reused. # Get Voice Source: https://platform.minimax.io/docs/api-reference/voice-management-get api-reference/speech/voice-management/api/openapi.json POST /v1/get_voice Use this API to list available voices by category. This API allows you to query **all available voice IDs** (`voice_id`) under the **current account**. This includes system voices, quick cloning voices, voices generated by the text-to-voice API, and human/accompaniment vocals generated by the music API. Voice Cloning voices are in an inactive state and need to be used at least once before they can be queried through this API. # Code blocks Source: https://platform.minimax.io/docs/essentials/code Display inline code and code blocks ## Inline code To denote a `word` or `phrase` as code, enclose it in backticks (\`). ``` To denote a `word` or `phrase` as code, enclose it in backticks (`). ``` ## Code blocks Use [fenced code blocks](https://www.markdownguide.org/extended-syntax/#fenced-code-blocks) by enclosing code in three backticks and follow the leading ticks with the programming language of your snippet to get syntax highlighting. Optionally, you can also write the name of your code after the programming language. ```java HelloWorld.java theme={null} class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } } ``` ````md theme={null} ```java HelloWorld.java class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } } ``` ```` # Images and embeds Source: https://platform.minimax.io/docs/essentials/images Add image, video, and other HTML elements ## Image ### Using Markdown The [markdown syntax](https://www.markdownguide.org/basic-syntax/#images) lets you add images using the following code ```md theme={null} ![title](/path/image.jpg) ``` Note that the image file size must be less than 5MB. Otherwise, we recommend hosting on a service like [Cloudinary](https://cloudinary.com/) or [S3](https://aws.amazon.com/s3/). You can then use that URL and embed. ### Using embeds To get more customizability with images, you can also use [embeds](/docs/writing-content/embed) to add images ```html theme={null} ``` ## Embeds and HTML elements ``` # Markdown syntax Source: https://platform.minimax.io/docs/essentials/markdown Text, title, and styling in standard markdown ## Titles Best used for section headers. ```md theme={null} ## Titles ``` ### Subtitles Best used for subsection headers. ```md theme={null} ### Subtitles ``` Each **title** and **subtitle** creates an anchor and also shows up on the table of contents on the right. ## Text formatting We support most markdown formatting. Simply add `**`, `_`, or `~` around text to format it. | Style | How to write it | Result | | ------------- | ----------------- | ----------------- | | Bold | `**bold**` | **bold** | | Italic | `_italic_` | *italic* | | Strikethrough | `~strikethrough~` | ~~strikethrough~~ | You can combine these. For example, write `**_bold and italic_**` to get ***bold and italic*** text. You need to use HTML to write superscript and subscript text. That is, add `` or `` around your text. | Text Size | How to write it | Result | | ----------- | ------------------------ | ---------------------- | | Superscript | `superscript` | superscript | | Subscript | `subscript` | subscript | ## Linking to pages You can add a link by wrapping text in `[]()`. You would write `[link to google](https://google.com)` to [link to google](https://google.com). Links to pages in your docs need to be root-relative. Basically, you should include the entire folder path. For example, `[link to text](/writing-content/text)` links to the page "Text" in our components section. Relative links like `[link to text](../text)` will open slower because we cannot optimize them as easily. ## Blockquotes ### Singleline To create a blockquote, add a `>` in front of a paragraph. > Dorothy followed her through many of the beautiful rooms in her castle. ```md theme={null} > Dorothy followed her through many of the beautiful rooms in her castle. ``` ### Multiline > Dorothy followed her through many of the beautiful rooms in her castle. > > The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood. ```md theme={null} > Dorothy followed her through many of the beautiful rooms in her castle. > > The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood. ``` ### LaTeX Mintlify supports [LaTeX](https://www.latex-project.org) through the Latex component. 8 x (vk x H1 - H2) = (0,1) ```md theme={null} 8 x (vk x H1 - H2) = (0,1) ``` # Navigation Source: https://platform.minimax.io/docs/essentials/navigation The navigation field in docs.json defines the pages that go in the navigation menu The navigation menu is the list of links on every website. You will likely update `docs.json` every time you add a new page. Pages do not show up automatically. ## Navigation syntax Our navigation syntax is recursive which means you can make nested navigation groups. You don't need to include `.mdx` in page names. ```json Regular Navigation theme={null} "navigation": { "tabs": [ { "tab": "Docs", "groups": [ { "group": "Getting Started", "pages": ["quickstart"] } ] } ] } ``` ```json Nested Navigation theme={null} "navigation": { "tabs": [ { "tab": "Docs", "groups": [ { "group": "Getting Started", "pages": [ "quickstart", { "group": "Nested Reference Pages", "pages": ["nested-reference-page"] } ] } ] } ] } ``` ## Folders Simply put your MDX files in folders and update the paths in `docs.json`. For example, to have a page at `https://yoursite.com/your-folder/your-page` you would make a folder called `your-folder` containing an MDX file called `your-page.mdx`. You cannot use `api` for the name of a folder unless you nest it inside another folder. Mintlify uses Next.js which reserves the top-level `api` folder for internal server calls. A folder name such as `api-reference` would be accepted. ```json Navigation With Folder theme={null} "navigation": { "tabs": [ { "tab": "Docs", "groups": [ { "group": "Group Name", "pages": ["your-folder/your-page"] } ] } ] } ``` ## Hidden pages MDX files not included in `docs.json` will not show up in the sidebar but are accessible through the search bar and by linking directly to them. # Reusable snippets Source: https://platform.minimax.io/docs/essentials/reusable-snippets Reusable, custom snippets to keep content in sync One of the core principles of software development is DRY (Don't Repeat Yourself). This is a principle that applies to documentation as well. If you find yourself repeating the same content in multiple places, you should consider creating a custom snippet to keep your content in sync. ## Creating a custom snippet **Pre-condition**: You must create your snippet file in the `snippets` directory. Any page in the `snippets` directory will be treated as a snippet and will not be rendered into a standalone page. If you want to create a standalone page from the snippet, import the snippet into another file and call it as a component. ### Default export 1. Add content to your snippet file that you want to re-use across multiple locations. Optionally, you can add variables that can be filled in via props when you import the snippet. ```mdx snippets/my-snippet.mdx theme={null} Hello world! This is my content I want to reuse across pages. My keyword of the day is {word}. ``` The content that you want to reuse must be inside the `snippets` directory in order for the import to work. 2. Import the snippet into your destination file. ```mdx destination-file.mdx theme={null} --- title: My title description: My Description --- import MySnippet from '/snippets/path/to/my-snippet.mdx'; ## Header Lorem impsum dolor sit amet. ``` ### Reusable variables 1. Export a variable from your snippet file: ```mdx snippets/path/to/custom-variables.mdx theme={null} export const myName = 'my name'; export const myObject = { fruit: 'strawberries' }; ``` 2. Import the snippet from your destination file and use the variable: ```mdx destination-file.mdx theme={null} --- title: My title description: My Description --- import { myName, myObject } from '/snippets/path/to/custom-variables.mdx'; Hello, my name is {myName} and I like {myObject.fruit}. ``` ### Reusable components 1. Inside your snippet file, create a component that takes in props by exporting your component in the form of an arrow function. ```mdx snippets/custom-component.mdx theme={null} export const MyComponent = ({ title }) => (

{title}

... snippet content ...

); ``` MDX does not compile inside the body of an arrow function. Stick to HTML syntax when you can or use a default export if you need to use MDX. 2. Import the snippet into your destination file and pass in the props ```mdx destination-file.mdx theme={null} --- title: My title description: My Description --- import { MyComponent } from '/snippets/custom-component.mdx'; Lorem ipsum dolor sit amet. ``` # Global Settings Source: https://platform.minimax.io/docs/essentials/settings Mintlify gives you complete control over the look and feel of your documentation using the docs.json file Every Mintlify site needs a `docs.json` file with the core configuration settings. Learn more about the [properties](#properties) below. ## Properties Name of your project. Used for the global title. Example: `mintlify` An array of groups with all the pages within that group The name of the group. Example: `Settings` The relative paths to the markdown files that will serve as pages. Example: `["customization", "page"]` Path to logo image or object with path to "light" and "dark" mode logo images Path to the logo in light mode Path to the logo in dark mode Where clicking on the logo links you to Path to the favicon image Hex color codes for your global theme The primary color. Used for most often for highlighted content, section headers, accents, in light mode The primary color for dark mode. Used for most often for highlighted content, section headers, accents, in dark mode The primary color for important buttons The color of the background in both light and dark mode The hex color code of the background in light mode The hex color code of the background in dark mode Array of `name`s and `url`s of links you want to include in the topbar The name of the button. Example: `Contact us` The url once you click on the button. Example: `https://mintlify.com/docs` Link shows a button. GitHub shows the repo information at the url provided including the number of GitHub stars. If `link`: What the button links to. If `github`: Link to the repository to load GitHub information from. Text inside the button. Only required if `type` is a `link`. Array of version names. Only use this if you want to show different versions of docs with a dropdown in the navigation bar. An array of the anchors, includes the `icon`, `color`, and `url`. The [Font Awesome](https://fontawesome.com/search?q=heart) icon used to feature the anchor. Example: `comments` The name of the anchor label. Example: `Community` The start of the URL that marks what pages go in the anchor. Generally, this is the name of the folder you put your pages in. The hex color of the anchor icon background. Can also be a gradient if you pass an object with the properties `from` and `to` that are each a hex color. Used if you want to hide an anchor until the correct docs version is selected. Pass `true` if you want to hide the anchor until you directly link someone to docs inside it. One of: "brands", "duotone", "light", "sharp-solid", "solid", or "thin" Override the default configurations for the top-most anchor. The name of the top-most anchor Font Awesome icon. One of: "brands", "duotone", "light", "sharp-solid", "solid", or "thin" An array of navigational tabs. The name of the tab label. The start of the URL that marks what pages go in the tab. Generally, this is the name of the folder you put your pages in. Configuration for API settings. Learn more about API pages at [API Components](/docs/api-playground/demo). The base url for all API endpoints. If `baseUrl` is an array, it will enable for multiple base url options that the user can toggle. The authentication strategy used for all API endpoints. The name of the authentication parameter used in the API playground. If method is `basic`, the format should be `[usernameName]:[passwordName]` The default value that's designed to be a prefix for the authentication input field. E.g. If an `inputPrefix` of `AuthKey` would inherit the default input result of the authentication field as `AuthKey`. Configurations for the API playground Whether the playground is showing, hidden, or only displaying the endpoint with no added user interactivity `simple` Learn more at the [playground guides](/docs/api-playground/demo) Enabling this flag ensures that key ordering in OpenAPI pages matches the key ordering defined in the OpenAPI file. This behavior will soon be enabled by default, at which point this field will be deprecated. A string or an array of strings of URL(s) or relative path(s) pointing to your OpenAPI file. Examples: ```json Absolute theme={null} "openapi": "https://example.com/openapi.json" ``` ```json Relative theme={null} "openapi": "/openapi.json" ``` ```json Multiple theme={null} "openapi": ["https://example.com/openapi1.json", "/openapi2.json", "/openapi3.json"] ``` An object of social media accounts where the key:property pair represents the social media platform and the account url. Example: ```json theme={null} { "x": "https://x.com/mintlify", "website": "https://mintlify.com" } ``` One of the following values `website`, `facebook`, `x`, `discord`, `slack`, `github`, `linkedin`, `instagram`, `hacker-news` Example: `x` The URL to the social platform. Example: `https://x.com/mintlify` Configurations to enable feedback buttons Enables a button to allow users to suggest edits via pull requests Enables a button to allow users to raise an issue about the documentation Customize the dark mode toggle. Set if you always want to show light or dark mode for new users. When not set, we default to the same mode as the user's operating system. Set to true to hide the dark/light mode toggle. You can combine `isHidden` with `default` to force your docs to only use light or dark mode. For example: ```json Only Dark Mode theme={null} "modeToggle": { "default": "dark", "isHidden": true } ``` ```json Only Light Mode theme={null} "modeToggle": { "default": "light", "isHidden": true } ``` A background image to be displayed behind every page. See example with [Infisical](https://infisical.com/docs) and [FRPC](https://frpc.io). # About Account Source: https://platform.minimax.io/docs/faq/about-account Find answers to common MiniMax account questions on billing, invoices, balance alerts, and resource management. ## Q: Founding account **A:** We offer two ways to fund your account: **Online Payment** and **Bank Transfer**. You can find the entry buttons for both top-up methods within your [Account > Billing > Balance](https://platform.minimax.io/user-center/payment/balance). Please choose the method that best suits your needs. *** ## Q: Balance alert **A:** To prevent business disruptions caused by an insufficient account balance, we recommend enabling the **balance alert** feature. You can set a balance threshold by navigating to [Account > Billing > Balance](https://platform.minimax.io/user-center/payment/balance). When your account balance falls below this threshold, the MiniMax Open Platform will notify you via email. Please monitor these notifications and top up your account in a timely manner. *** ## Q: Autobilling **A:** We also offer an **Autobilling** feature to ensure your services run without interruption. You can enable and configure this feature under [Account > Billing > Balance](https://platform.minimax.io/user-center/payment/balance). You can configure a balance threshold and payment method. When your account balance drops below this threshold, we will automatically top it up. If the payment fails, we will send you an email notification. This ensures your API requests will not fail due to an insufficient balance, preventing any service interruptions. *** ## Q: Delete account **A:** If you no longer wish to use MiniMax's service, you can permanently delete your account. # About APIs Source: https://platform.minimax.io/docs/faq/about-apis Find answers to common questions about managing your MiniMax AI account. ## Q: Obtaining Your API Key **A:** Go to [Account > API Keys](https://platform.minimax.io/user-center/basic-information/interface-key) to create and manage your **pay-as-you-go API Key**. Go to [Billing > Token Plan](https://platform.minimax.io/user-center/payment/token-plan) to view your **Subscription Key**, which is used for Token Plan subscriptions and purchased Credits. Your API Key is an essential credential for all API calls. Do not share your API Key with others, or expose it in the browser or other client-side code. In order to protect the security of your account, we may also automatically disable any API Key that has leaked publicly. *** ## Q: How is TPS (Tokens Per Second) calculated for LLMs? **A:** TPS measures the number of tokens generated per second, and is used to evaluate the inference output speed of a model. The formula is: $$ \text{TPS} = \frac{\text{Number of output tokens}}{\text{Time of last token} - \text{Time of first token}} $$ In other words, timing starts when the model outputs the first token and ends when the last token is generated. The total number of tokens produced is then divided by that elapsed time (in seconds). TPS may fluctuate during actual usage. The TPS values indicated on each model page are reference values. *** ## Q: Is the validity period of voice\_id only 7 days? **A:** About the validity period of voice\_id, it’s important to clarify the following: The system-generated voice\_id is initially in an inactive state. If not activated in time, it will automatically expire 7 days after generation. To ensure the long-term validity of your voice\_id, we recommend that users synthesize audio within 7 days via the T2A v2 or T2A Large interface. This will let the system permanently save the voice\_id. Previewing during voice\_clone does not activate the voice\_id. *** ## Q: The default value of the channel parameter **A:** Both mono and multi-channel audio can be used normally. Mono is often chosen as the default due to its better compatibility and superior sound focus, which typically results in clearer audio quality. *** ## Q: The function of the timbre weights parameter **A:** The timbre weights parameter is primarily used in scenarios involving the mixing of multiple `voice_ids`. Its main functions include: * Reducing copyright risks by adjusting the weights of different `voice_ids` to create unique sound effects. * Creating new sound styles through the blending of voices, providing more possibilities for social interactions. In practical applications, it is recommended to perform an audio cloning after adjusting the timbre weights parameter to achieve a satisfactory sound, thereby generating a new and satisfactory `voice_id`. *** ## Q: The function of the language\_boosts parameter **A:** The primary function of the `language_boosts` parameter is to help the model more accurately recognize text and synthesize audio according to different language texts (such as "Spanish", "French", "Chinese", "Chinese,Yue", etc.). This parameter ensures that the model does not mispronounce homophones or characters that have different pronunciations in different language contexts. Under normal circumstances, the `language_boosts` parameter does not affect the accent of the cloned voice. *** ## Q: The function of the english\_normalization parameter The `english_normalization` parameter is used for normalizing English text. When processing English text, this parameter significantly improves the model's pronunciation of numbers and dates, reducing the likelihood of mispronunciations. However, it is important to note that using this parameter may cause a delay in the synthesized audio duration. Additionally, if the text includes mathematical formulas, this parameter will also activate the corresponding text normalization function to ensure correct pronunciation of the formulas. *** ## Q: Can I retrieve audio from a failed stream using the trace\_id? **A:** We do not provide a service to retrieve audio through the `trace_id` at present. *** ## Q: How to query / delete voice\_id and get public voices? **A:** We do provide **Delete Voice API** to delete client-side `voice_ids`, and **Get Voice API** to query all available `voice_ids` under the current account. This includes system voices, clone voices, voice design voices and vocal voices from the music generation API. *** ## Q: The main application scenarios for the T2A Large v2 asynchronous ultra-long text-to-speech generation interface? This interface supports a maximum single text input of up to **1 million characters**. Its primary application scenarios include creating audiobooks for books, allowing for the efficient utilization of system idle resources to perform asynchronous batch audio synthesis tasks. *** ## Q: What is the purpose of the data.status field within the data parameter in the Response return of the T2A v2 interface? The `data.status` field is used to indicate the status of the streaming generation process, with the following specific meanings: * **Status 1:** Indicates that the streaming generation process is currently in progress. * **Status 2:** Indicates that the synthesis has completed. *** ## Q: What languages does voice cloning support? * For the original voice to be cloned: **Any language can be used.** * For the synthesized voice after cloning: The system supports **40 languages** as listed on the official website. It is best for the original voice and the target synthesis language to be the same. If they are different, there may be an accent issue. For example, if you have Trump speak Japanese, it might have an American accent. ## Q: Where can I find the pricing and rate limits for older or deprecated models? For information on legacy models, please consult our dedicated [Historical Model Pricing and Rate](/docs/faq/history-modelinfo) page for a detailed reference on their past pricing structures and usage constraints. # Contact Us Source: https://platform.minimax.io/docs/faq/contact-us This page provides MiniMax official contact channels, including email support, enabling you to quickly get technical assistance and business inquiries. ### Brand Resources **Logo & Brand Assets:** [Download MiniMax Brand Package](https://file.cdn.minimax.io/public/MiniMax_Logo.zip) Includes platform logos, icons, and other brand assets. Please follow the brand usage guidelines. *** ### Business Inquiries, Invoicing & Refunds **Email:** [api@minimaxi.com](mailto:api@minimaxi.com) **Discord:** [Join our Discord](https://www.minimax.io/discord) # System Voice ID List Source: https://platform.minimax.io/docs/faq/system-voice-id You can also obtain the latest system voice information through the [Get Voice API](/docs/api-reference/voice-management-get) | No. | Language | Voice\_id | Voice\_name | | :-- | :----------------- | :------------------------------------------- | :------------------------ | | 1 | English | English\_expressive\_narrator | Expressive Narrator | | 2 | English | English\_radiant\_girl | Radiant Girl | | 3 | English | English\_magnetic\_voiced\_man | Magnetic-voiced Male | | 4 | English | English\_compelling\_lady1 | Compelling Lady | | 5 | English | English\_Aussie\_Bloke | Aussie Bloke | | 6 | English | English\_captivating\_female1 | Captivating Female | | 7 | English | English\_Upbeat\_Woman | Upbeat Woman | | 8 | English | English\_Trustworth\_Man | Trustworthy Man | | 9 | English | English\_CalmWoman | Calm Woman | | 10 | English | English\_UpsetGirl | Upset Girl | | 11 | English | English\_Gentle-voiced\_man | Gentle-voiced Man | | 12 | English | English\_Whispering\_girl | Whispering girl | | 13 | English | English\_Diligent\_Man | Diligent Man | | 14 | English | English\_Graceful\_Lady | Graceful Lady | | 15 | English | English\_ReservedYoungMan | Reserved Young Man | | 16 | English | English\_PlayfulGirl | Playful Girl | | 17 | English | English\_ManWithDeepVoice | Man With Deep Voice | | 18 | English | English\_MaturePartner | Mature Partner | | 19 | English | English\_FriendlyPerson | Friendly Guy | | 20 | English | English\_MatureBoss | Bossy Lady | | 21 | English | English\_Debator | Male Debater | | 22 | English | English\_LovelyGirl | Lovely Girl | | 23 | English | English\_Steadymentor | Reliable Man | | 24 | English | English\_Deep-VoicedGentleman | Deep-voiced Gentleman | | 25 | English | English\_Wiselady | Wise Lady | | 26 | English | English\_CaptivatingStoryteller | Captivating Storyteller | | 27 | English | English\_DecentYoungMan | Decent Young Man | | 28 | English | English\_SentimentalLady | Sentimental Lady | | 29 | English | English\_ImposingManner | Imposing Queen | | 30 | English | English\_SadTeen | Teen Boy | | 31 | English | English\_PassionateWarrior | Passionate Warrior | | 32 | English | English\_WiseScholar | Wise Scholar | | 33 | English | English\_Soft-spokenGirl | Soft-Spoken Girl | | 34 | English | English\_SereneWoman | Serene Woman | | 35 | English | English\_ConfidentWoman | Confident Woman | | 36 | English | English\_PatientMan | Patient Man | | 37 | English | English\_Comedian | Comedian | | 38 | English | English\_BossyLeader | Bossy Leader | | 39 | English | English\_Strong-WilledBoy | Strong-Willed Boy | | 40 | English | English\_StressedLady | Stressed Lady | | 41 | English | English\_AssertiveQueen | Assertive Queen | | 42 | English | English\_AnimeCharacter | Female Narrator | | 43 | English | English\_Jovialman | Jovial Man | | 44 | English | English\_WhimsicalGirl | Whimsical Girl | | 45 | English | English\_Kind-heartedGirl | Kind-Hearted Girl | | 46 | Chinese (Mandarin) | Chinese (Mandarin)\_Reliable\_Executive | Reliable Executive | | 47 | Chinese (Mandarin) | Chinese (Mandarin)\_News\_Anchor | News Anchor | | 48 | Chinese (Mandarin) | Chinese (Mandarin)\_Unrestrained\_Young\_Man | Unrestrained Young Man | | 49 | Chinese (Mandarin) | Chinese (Mandarin)\_Mature\_Woman | Mature Woman | | 50 | Chinese (Mandarin) | Arrogant\_Miss | Arrogant Miss | | 51 | Chinese (Mandarin) | Robot\_Armor | Robot Armor | | 52 | Chinese (Mandarin) | Chinese (Mandarin)\_Kind-hearted\_Antie | Kind-hearted Antie | | 53 | Chinese (Mandarin) | Chinese (Mandarin)\_HK\_Flight\_Attendant | HK Flight Attendant | | 54 | Chinese (Mandarin) | Chinese (Mandarin)\_Humorous\_Elder | Humorous Elder | | 55 | Chinese (Mandarin) | Chinese (Mandarin)\_Gentleman | Gentleman | | 56 | Chinese (Mandarin) | Chinese (Mandarin)\_Warm\_Bestie | Warm Bestie | | 57 | Chinese (Mandarin) | Chinese (Mandarin)\_Stubborn\_Friend | Stubborn Friend | | 58 | Chinese (Mandarin) | Chinese (Mandarin)\_Sweet\_Lady | Sweet Lady | | 59 | Chinese (Mandarin) | Chinese (Mandarin)\_Southern\_Young\_Man | Southern Young Man | | 60 | Chinese (Mandarin) | Chinese (Mandarin)\_Wise\_Women | Wise Women | | 61 | Chinese (Mandarin) | Chinese (Mandarin)\_Gentle\_Youth | Gentle Youth | | 62 | Chinese (Mandarin) | Chinese (Mandarin)\_Warm\_Girl | Warm Girl | | 63 | Chinese (Mandarin) | Chinese (Mandarin)\_Male\_Announcer | Male Announcer | | 64 | Chinese (Mandarin) | Chinese (Mandarin)\_Kind-hearted\_Elder | Kind-hearted Elder | | 65 | Chinese (Mandarin) | Chinese (Mandarin)\_Cute\_Spirit | Cute Spirit | | 66 | Chinese (Mandarin) | Chinese (Mandarin)\_Radio\_Host | Radio Host | | 67 | Chinese (Mandarin) | Chinese (Mandarin)\_Lyrical\_Voice | Lyrical Voice | | 68 | Chinese (Mandarin) | Chinese (Mandarin)\_Straightforward\_Boy | Straightforward Boy | | 69 | Chinese (Mandarin) | Chinese (Mandarin)\_Sincere\_Adult | Sincere Adult | | 70 | Chinese (Mandarin) | Chinese (Mandarin)\_Gentle\_Senior | Gentle Senior | | 71 | Chinese (Mandarin) | Chinese (Mandarin)\_Crisp\_Girl | Crisp Girl | | 72 | Chinese (Mandarin) | Chinese (Mandarin)\_Pure-hearted\_Boy | Pure-hearted Boy | | 73 | Chinese (Mandarin) | Chinese (Mandarin)\_Soft\_Girl | Soft Girl | | 74 | Chinese (Mandarin) | Chinese (Mandarin)\_IntellectualGirl | Intellectual Girl | | 75 | Chinese (Mandarin) | Chinese (Mandarin)\_Warm\_HeartedGirl | Warm-hearted Girl | | 76 | Chinese (Mandarin) | Chinese (Mandarin)\_Laid\_BackGirl | Laid-back Girl | | 77 | Chinese (Mandarin) | Chinese (Mandarin)\_ExplorativeGirl | Explorative Girl | | 78 | Chinese (Mandarin) | Chinese (Mandarin)\_Warm-HeartedAunt | Warm-hearted Aunt | | 79 | Chinese (Mandarin) | Chinese (Mandarin)\_BashfulGirl | Bashful Girl | | 80 | Japanese | Japanese\_IntellectualSenior | Intellectual Senior | | 81 | Japanese | Japanese\_DecisivePrincess | Decisive Princess | | 82 | Japanese | Japanese\_LoyalKnight | Loyal Knight | | 83 | Japanese | Japanese\_DominantMan | Dominant Man | | 84 | Japanese | Japanese\_SeriousCommander | Serious Commander | | 85 | Japanese | Japanese\_ColdQueen | Cold Queen | | 86 | Japanese | Japanese\_DependableWoman | Dependable Woman | | 87 | Japanese | Japanese\_GentleButler | Gentle Butler | | 88 | Japanese | Japanese\_KindLady | Kind Lady | | 89 | Japanese | Japanese\_CalmLady | Calm Lady | | 90 | Japanese | Japanese\_OptimisticYouth | Optimistic Youth | | 91 | Japanese | Japanese\_GenerousIzakayaOwner | Generous Izakaya Owner | | 92 | Japanese | Japanese\_SportyStudent | Sporty Student | | 93 | Japanese | Japanese\_InnocentBoy | Innocent Boy | | 94 | Japanese | Japanese\_GracefulMaiden | Graceful Maiden | | 95 | Cantonese | Cantonese\_ProfessionalHost (F) | Professional Female Host | | 96 | Cantonese | Cantonese\_GentleLady | Gentle Lady | | 97 | Cantonese | Cantonese\_ProfessionalHost (M) | Professional Male Host | | 98 | Cantonese | Cantonese\_PlayfulMan | Playful Man | | 99 | Cantonese | Cantonese\_CuteGirl | Cute Girl | | 100 | Cantonese | Cantonese\_KindWoman | Kind Woman | | 101 | Korean | Korean\_AirheadedGirl | Airheaded Girl | | 102 | Korean | Korean\_AthleticGirl | Athletic Girl | | 103 | Korean | Korean\_AthleticStudent | Athletic Student | | 104 | Korean | Korean\_BraveAdventurer | Brave Adventurer | | 105 | Korean | Korean\_BraveFemaleWarrior | Brave Female Warrior | | 106 | Korean | Korean\_BraveYouth | Brave Youth | | 107 | Korean | Korean\_CalmGentleman | Calm Gentleman | | 108 | Korean | Korean\_CalmLady | Calm Lady | | 109 | Korean | Korean\_CaringWoman | Caring Woman | | 110 | Korean | Korean\_CharmingElderSister | Charming Elder Sister | | 111 | Korean | Korean\_CharmingSister | Charming Sister | | 112 | Korean | Korean\_CheerfulBoyfriend | Cheerful Boyfriend | | 113 | Korean | Korean\_CheerfulCoolJunior | Cheerful Cool Junior | | 114 | Korean | Korean\_CheerfulLittleSister | Cheerful Little Sister | | 115 | Korean | Korean\_ChildhoodFriendGirl | Childhood Friend Girl | | 116 | Korean | Korean\_CockyGuy | Cocky Guy | | 117 | Korean | Korean\_ColdGirl | Cold Girl | | 118 | Korean | Korean\_ColdYoungMan | Cold Young Man | | 119 | Korean | Korean\_ConfidentBoss | Confident Boss | | 120 | Korean | Korean\_ConsiderateSenior | Considerate Senior | | 121 | Korean | Korean\_DecisiveQueen | Decisive Queen | | 122 | Korean | Korean\_DominantMan | Dominant Man | | 123 | Korean | Korean\_ElegantPrincess | Elegant Princess | | 124 | Korean | Korean\_EnchantingSister | Enchanting Sister | | 125 | Korean | Korean\_EnthusiasticTeen | Enthusiastic Teen | | 126 | Korean | Korean\_FriendlyBigSister | Friendly Big Sister | | 127 | Korean | Korean\_GentleBoss | Gentle Boss | | 128 | Korean | Korean\_GentleWoman | Gentle Woman | | 129 | Korean | Korean\_HaughtyLady | Haughty Lady | | 130 | Korean | Korean\_InnocentBoy | Innocent Boy | | 131 | Korean | Korean\_IntellectualMan | Intellectual Man | | 132 | Korean | Korean\_IntellectualSenior | Intellectual Senior | | 133 | Korean | Korean\_LonelyWarrior | Lonely Warrior | | 134 | Korean | Korean\_MatureLady | Mature Lady | | 135 | Korean | Korean\_MysteriousGirl | Mysterious Girl | | 136 | Korean | Korean\_OptimisticYouth | Optimistic Youth | | 137 | Korean | Korean\_PlayboyCharmer | Playboy Charmer | | 138 | Korean | Korean\_PossessiveMan | Possessive Man | | 139 | Korean | Korean\_QuirkyGirl | Quirky Girl | | 140 | Korean | Korean\_ReliableSister | Reliable Sister | | 141 | Korean | Korean\_ReliableYouth | Reliable Youth | | 142 | Korean | Korean\_SassyGirl | Sassy Girl | | 143 | Korean | Korean\_ShyGirl | Shy Girl | | 144 | Korean | Korean\_SoothingLady | Soothing Lady | | 145 | Korean | Korean\_StrictBoss | Strict Boss | | 146 | Korean | Korean\_SweetGirl | Sweet Girl | | 147 | Korean | Korean\_ThoughtfulWoman | Thoughtful Woman | | 148 | Korean | Korean\_WiseElf | Wise Elf | | 149 | Korean | Korean\_WiseTeacher | Wise Teacher | | 150 | Spanish | Spanish\_SereneWoman | Serene Woman | | 151 | Spanish | Spanish\_MaturePartner | Mature Partner | | 152 | Spanish | Spanish\_CaptivatingStoryteller | Captivating Storyteller | | 153 | Spanish | Spanish\_Narrator | Narrator | | 154 | Spanish | Spanish\_WiseScholar | Wise Scholar | | 155 | Spanish | Spanish\_Kind-heartedGirl | Kind-hearted Girl | | 156 | Spanish | Spanish\_DeterminedManager | Determined Manager | | 157 | Spanish | Spanish\_BossyLeader | Bossy Leader | | 158 | Spanish | Spanish\_ReservedYoungMan | Reserved Young Man | | 159 | Spanish | Spanish\_ConfidentWoman | Confident Woman | | 160 | Spanish | Spanish\_ThoughtfulMan | Thoughtful Man | | 161 | Spanish | Spanish\_Strong-WilledBoy | Strong-willed Boy | | 162 | Spanish | Spanish\_SophisticatedLady | Sophisticated Lady | | 163 | Spanish | Spanish\_RationalMan | Rational Man | | 164 | Spanish | Spanish\_AnimeCharacter | Anime Character | | 165 | Spanish | Spanish\_Deep-tonedMan | Deep-toned Man | | 166 | Spanish | Spanish\_Fussyhostess | Fussy hostess | | 167 | Spanish | Spanish\_SincereTeen | Sincere Teen | | 168 | Spanish | Spanish\_FrankLady | Frank Lady | | 169 | Spanish | Spanish\_Comedian | Comedian | | 170 | Spanish | Spanish\_Debator | Debator | | 171 | Spanish | Spanish\_ToughBoss | Tough Boss | | 172 | Spanish | Spanish\_Wiselady | Wise Lady | | 173 | Spanish | Spanish\_Steadymentor | Steady Mentor | | 174 | Spanish | Spanish\_Jovialman | Jovial Man | | 175 | Spanish | Spanish\_SantaClaus | Santa Claus | | 176 | Spanish | Spanish\_Rudolph | Rudolph | | 177 | Spanish | Spanish\_Intonategirl | Intonate Girl | | 178 | Spanish | Spanish\_Arnold | Arnold | | 179 | Spanish | Spanish\_Ghost | Ghost | | 180 | Spanish | Spanish\_HumorousElder | Humorous Elder | | 181 | Spanish | Spanish\_EnergeticBoy | Energetic Boy | | 182 | Spanish | Spanish\_WhimsicalGirl | Whimsical Girl | | 183 | Spanish | Spanish\_StrictBoss | Strict Boss | | 184 | Spanish | Spanish\_ReliableMan | Reliable Man | | 185 | Spanish | Spanish\_SereneElder | Serene Elder | | 186 | Spanish | Spanish\_AngryMan | Angry Man | | 187 | Spanish | Spanish\_AssertiveQueen | Assertive Queen | | 188 | Spanish | Spanish\_CaringGirlfriend | Caring Girlfriend | | 189 | Spanish | Spanish\_PowerfulSoldier | Powerful Soldier | | 190 | Spanish | Spanish\_PassionateWarrior | Passionate Warrior | | 191 | Spanish | Spanish\_ChattyGirl | Chatty Girl | | 192 | Spanish | Spanish\_RomanticHusband | Romantic Husband | | 193 | Spanish | Spanish\_CompellingGirl | Compelling Girl | | 194 | Spanish | Spanish\_PowerfulVeteran | Powerful Veteran | | 195 | Spanish | Spanish\_SensibleManager | Sensible Manager | | 196 | Spanish | Spanish\_ThoughtfulLady | Thoughtful Lady | | 197 | Portuguese | Portuguese\_SentimentalLady | Sentimental Lady | | 198 | Portuguese | Portuguese\_BossyLeader | Bossy Leader | | 199 | Portuguese | Portuguese\_Wiselady | Wise lady | | 200 | Portuguese | Portuguese\_Strong-WilledBoy | Strong-willed Boy | | 201 | Portuguese | Portuguese\_Deep-VoicedGentleman | Deep-voiced Gentleman | | 202 | Portuguese | Portuguese\_UpsetGirl | Upset Girl | | 203 | Portuguese | Portuguese\_PassionateWarrior | Passionate Warrior | | 204 | Portuguese | Portuguese\_AnimeCharacter | Anime Character | | 205 | Portuguese | Portuguese\_ConfidentWoman | Confident Woman | | 206 | Portuguese | Portuguese\_AngryMan | Angry Man | | 207 | Portuguese | Portuguese\_CaptivatingStoryteller | Captivating Storyteller | | 208 | Portuguese | Portuguese\_Godfather | Godfather | | 209 | Portuguese | Portuguese\_ReservedYoungMan | Reserved Young Man | | 210 | Portuguese | Portuguese\_SmartYoungGirl | Smart Young Girl | | 211 | Portuguese | Portuguese\_Kind-heartedGirl | Kind-hearted Girl | | 212 | Portuguese | Portuguese\_Pompouslady | Pompous lady | | 213 | Portuguese | Portuguese\_Grinch | Grinch | | 214 | Portuguese | Portuguese\_Debator | Debator | | 215 | Portuguese | Portuguese\_SweetGirl | Sweet Girl | | 216 | Portuguese | Portuguese\_AttractiveGirl | Attractive Girl | | 217 | Portuguese | Portuguese\_ThoughtfulMan | Thoughtful Man | | 218 | Portuguese | Portuguese\_PlayfulGirl | Playful Girl | | 219 | Portuguese | Portuguese\_GorgeousLady | Gorgeous Lady | | 220 | Portuguese | Portuguese\_LovelyLady | Lovely Lady | | 221 | Portuguese | Portuguese\_SereneWoman | Serene Woman | | 222 | Portuguese | Portuguese\_SadTeen | Sad Teen | | 223 | Portuguese | Portuguese\_MaturePartner | Mature Partner | | 224 | Portuguese | Portuguese\_Comedian | Comedian | | 225 | Portuguese | Portuguese\_NaughtySchoolgirl | Naughty Schoolgirl | | 226 | Portuguese | Portuguese\_Narrator | Narrator | | 227 | Portuguese | Portuguese\_ToughBoss | Tough Boss | | 228 | Portuguese | Portuguese\_Fussyhostess | Fussy hostess | | 229 | Portuguese | Portuguese\_Dramatist | Dramatist | | 230 | Portuguese | Portuguese\_Steadymentor | Steady Mentor | | 231 | Portuguese | Portuguese\_Jovialman | Jovial Man | | 232 | Portuguese | Portuguese\_CharmingQueen | Charming Queen | | 233 | Portuguese | Portuguese\_SantaClaus | Santa Claus | | 234 | Portuguese | Portuguese\_Rudolph | Rudolph | | 235 | Portuguese | Portuguese\_Arnold | Arnold | | 236 | Portuguese | Portuguese\_CharmingSanta | Charming Santa | | 237 | Portuguese | Portuguese\_CharmingLady | Charming Lady | | 238 | Portuguese | Portuguese\_Ghost | Ghost | | 239 | Portuguese | Portuguese\_HumorousElder | Humorous Elder | | 240 | Portuguese | Portuguese\_CalmLeader | Calm Leader | | 241 | Portuguese | Portuguese\_GentleTeacher | Gentle Teacher | | 242 | Portuguese | Portuguese\_EnergeticBoy | Energetic Boy | | 243 | Portuguese | Portuguese\_ReliableMan | Reliable Man | | 244 | Portuguese | Portuguese\_SereneElder | Serene Elder | | 245 | Portuguese | Portuguese\_GrimReaper | Grim Reaper | | 246 | Portuguese | Portuguese\_AssertiveQueen | Assertive Queen | | 247 | Portuguese | Portuguese\_WhimsicalGirl | Whimsical Girl | | 248 | Portuguese | Portuguese\_StressedLady | Stressed Lady | | 249 | Portuguese | Portuguese\_FriendlyNeighbor | Friendly Neighbor | | 250 | Portuguese | Portuguese\_CaringGirlfriend | Caring Girlfriend | | 251 | Portuguese | Portuguese\_PowerfulSoldier | Powerful Soldier | | 252 | Portuguese | Portuguese\_FascinatingBoy | Fascinating Boy | | 253 | Portuguese | Portuguese\_RomanticHusband | Romantic Husband | | 254 | Portuguese | Portuguese\_StrictBoss | Strict Boss | | 255 | Portuguese | Portuguese\_InspiringLady | Inspiring Lady | | 256 | Portuguese | Portuguese\_PlayfulSpirit | Playful Spirit | | 257 | Portuguese | Portuguese\_ElegantGirl | Elegant Girl | | 258 | Portuguese | Portuguese\_CompellingGirl | Compelling Girl | | 259 | Portuguese | Portuguese\_PowerfulVeteran | Powerful Veteran | | 260 | Portuguese | Portuguese\_SensibleManager | Sensible Manager | | 261 | Portuguese | Portuguese\_ThoughtfulLady | Thoughtful Lady | | 262 | Portuguese | Portuguese\_TheatricalActor | Theatrical Actor | | 263 | Portuguese | Portuguese\_FragileBoy | Fragile Boy | | 264 | Portuguese | Portuguese\_ChattyGirl | Chatty Girl | | 265 | Portuguese | Portuguese\_Conscientiousinstructor | Conscientious Instructor | | 266 | Portuguese | Portuguese\_RationalMan | Rational Man | | 267 | Portuguese | Portuguese\_WiseScholar | Wise Scholar | | 268 | Portuguese | Portuguese\_FrankLady | Frank Lady | | 269 | Portuguese | Portuguese\_DeterminedManager | Determined Manager | | 270 | French | French\_Male\_Speech\_New | Level-Headed Man | | 271 | French | French\_Female\_News Anchor | Patient Female Presenter | | 272 | French | French\_CasualMan | Casual Man | | 273 | French | French\_MovieLeadFemale | Movie Lead Female | | 274 | French | French\_FemaleAnchor | Female Anchor | | 275 | French | French\_MaleNarrator | Male Narrator | | 276 | Indonesian | Indonesian\_SweetGirl | Sweet Girl | | 277 | Indonesian | Indonesian\_ReservedYoungMan | Reserved Young Man | | 278 | Indonesian | Indonesian\_CharmingGirl | Charming Girl | | 279 | Indonesian | Indonesian\_CalmWoman | Calm Woman | | 280 | Indonesian | Indonesian\_ConfidentWoman | Confident Woman | | 281 | Indonesian | Indonesian\_CaringMan | Caring Man | | 282 | Indonesian | Indonesian\_BossyLeader | Bossy Leader | | 283 | Indonesian | Indonesian\_DeterminedBoy | Determined Boy | | 284 | Indonesian | Indonesian\_GentleGirl | Gentle Girl | | 285 | German | German\_FriendlyMan | Friendly Man | | 286 | German | German\_SweetLady | Sweet Lady | | 287 | German | German\_PlayfulMan | Playful Man | | 288 | Russian | Russian\_HandsomeChildhoodFriend | Handsome Childhood Friend | | 289 | Russian | Russian\_BrightHeroine | Bright Queen | | 290 | Russian | Russian\_AmbitiousWoman | Ambitious Woman | | 291 | Russian | Russian\_ReliableMan | Reliable Man | | 292 | Russian | Russian\_CrazyQueen | Crazy Girl | | 293 | Russian | Russian\_PessimisticGirl | Pessimistic Girl | | 294 | Russian | Russian\_AttractiveGuy | Attractive Guy | | 295 | Russian | Russian\_Bad-temperedBoy | Bad-tempered Boy | | 296 | Italian | Italian\_BraveHeroine | Brave Heroine | | 297 | Italian | Italian\_Narrator | Narrator | | 298 | Italian | Italian\_WanderingSorcerer | Wandering Sorcerer | | 299 | Italian | Italian\_DiligentLeader | Diligent Leader | | 300 | Dutch | Dutch\_kindhearted\_girl | Kind-hearted girl | | 301 | Dutch | Dutch\_bossy\_leader | Bossy leader | | 302 | Vietnamese | Vietnamese\_kindhearted\_girl | Kind-hearted girl | | 303 | Arabic | Arabic\_CalmWoman | Calm Woman | | 304 | Arabic | Arabic\_FriendlyGuy | Friendly Guy | | 305 | Turkish | Turkish\_CalmWoman | Calm Woman | | 306 | Turkish | Turkish\_Trustworthyman | Trustworthy man | | 307 | Ukrainian | Ukrainian\_CalmWoman | Calm Woman | | 308 | Ukrainian | Ukrainian\_WiseScholar | Wise Scholar | | 309 | Thai | Thai\_male\_1\_sample8 | Serene Man | | 310 | Thai | Thai\_male\_2\_sample2 | Friendly Man | | 311 | Thai | Thai\_female\_1\_sample1 | Confident Woman | | 312 | Thai | Thai\_female\_2\_sample2 | Energetic Woman | | 313 | Polish | Polish\_male\_1\_sample4 | Male Narrator | | 314 | Polish | Polish\_male\_2\_sample3 | Male Anchor | | 315 | Polish | Polish\_female\_1\_sample1 | Calm Woman | | 316 | Polish | Polish\_female\_2\_sample3 | Casual Woman | | 317 | Romanian | Romanian\_male\_1\_sample2 | Reliable Man | | 318 | Romanian | Romanian\_male\_2\_sample1 | Energetic Youth | | 319 | Romanian | Romanian\_female\_1\_sample4 | Optimistic Youth | | 320 | Romanian | Romanian\_female\_2\_sample1 | Gentle Woman | | 321 | Greek | greek\_male\_1a\_v1 | Thoughtful Mentor | | 322 | Greek | Greek\_female\_1\_sample1 | Gentle Lady | | 323 | Greek | Greek\_female\_2\_sample3 | Girl Next Door | | 324 | Czech | czech\_male\_1\_v1 | Assured Presenter | | 325 | Czech | czech\_female\_5\_v7 | Steadfast Narrator | | 326 | Czech | czech\_female\_2\_v2 | Elegant Lady | | 327 | Finnish | finnish\_male\_3\_v1 | Upbeat Man | | 328 | Finnish | finnish\_male\_1\_v2 | Friendly Boy | | 329 | Finnish | finnish\_female\_4\_v1 | Assetive Woman | | 330 | Hindi | hindi\_male\_1\_v2 | Trustworthy Advisor | | 331 | Hindi | hindi\_female\_2\_v1 | Tranquil Woman | | 332 | Hindi | hindi\_female\_1\_v2 | News Anchor | # Video Agent Template List Source: https://platform.minimax.io/docs/faq/video-agent-templates This document lists all official MiniMax Video Agent templates with IDs, features, and usage examples. | Template ID | Template
Name | Description | Media Inputs | Text Inputs | Example | | :----------------- | :-------------------------------- | :----------------------------------------------------------------------------------------------------------------------------- | :----------- | :---------- | :-------- | | 392747428568649728 | Diving | Upload a picture to generate a video of the subject in the picture completing a perfect dive | Required | / |