
# MiniMax Provider

The [MiniMax](https://www.minimax.io) provider offers access to the MiniMax-M
series of language models through the MiniMax API, including models with
reasoning capabilities.

API keys can be obtained from the [MiniMax Platform](https://platform.minimax.io).

## Setup

The MiniMax provider is available via the `@ai-sdk/minimax` module. You can install it with:

<InstallPackages packages="@ai-sdk/minimax" />

## Provider Instance

You can import the default provider instance `minimax` from `@ai-sdk/minimax`:

```ts
import { minimax } from '@ai-sdk/minimax';
```

For custom configuration, you can import `createMiniMax` and create a provider instance with your settings:

```ts
import { createMiniMax } from '@ai-sdk/minimax';

const minimax = createMiniMax({
  apiKey: process.env.MINIMAX_API_KEY ?? '',
});
```

You can use the following optional settings to customize the MiniMax provider instance:

- **baseURL** _string_

  Use a different URL prefix for API calls.
  The default prefix is `https://api.minimax.io/v1`

- **apiKey** _string_

  API key that is being sent using the `Authorization` header. It defaults to
  the `MINIMAX_API_KEY` environment variable

- **headers** _Record&lt;string,string&gt;_

  Custom headers to include in the requests

- **fetch** _(input: RequestInfo, init?: RequestInit) => Promise&lt;Response&gt;_

  Custom [fetch](https://developer.mozilla.org/en-US/docs/Web/API/fetch) implementation

## Language Models

You can create language models using a provider instance:

```ts
import { minimax } from '@ai-sdk/minimax';
import { generateText } from 'ai';

const { text } = await generateText({
  model: minimax('minimax-m3'),
  prompt: 'Write a vegetarian lasagna recipe for 4 people.',
});
```

You can also use the `.chat()` or `.languageModel()` factory methods:

```ts
const model = minimax.chat('minimax-m3');
// or
const model = minimax.languageModel('minimax-m3');
```

MiniMax language models can be used in the `streamText` function
(see [AI SDK Core](/docs/ai-sdk-core)).

### Reasoning

MiniMax-M models can produce intermediate reasoning ("thinking") before their
final response. You control this behavior through provider options. The reasoning
output is streamed through the standard AI SDK reasoning parts.

```ts
import { minimax, type MiniMaxLanguageModelOptions } from '@ai-sdk/minimax';
import { generateText } from 'ai';

const { text, reasoningText } = await generateText({
  model: minimax('minimax-m3'),
  providerOptions: {
    minimax: {
      thinking: { type: 'adaptive' },
    } satisfies MiniMaxLanguageModelOptions,
  },
  prompt: 'How many "r"s are in the word "strawberry"?',
});

console.log(reasoningText);
console.log(text);
```

See [AI SDK UI: Chatbot](/docs/ai-sdk-ui/chatbot#reasoning) for more details on how to integrate reasoning into your chatbot.

### Provider Options

The following optional provider options are available for MiniMax language models:

- **thinking** _object_

  Controls the model's reasoning ("thinking") behavior.
  - **type** _'adaptive' | 'disabled'_
    - `'adaptive'`: the model decides when to reason (deep reasoning enabled)
    - `'disabled'`: the model responds directly without reasoning, for higher
      throughput and lower latency

  When omitted, the model uses its provider-side default.

  <Note>
    Thinking control is only supported on `minimax-m3`. The M2.x models always
    think, so `'disabled'` has no effect on them.
  </Note>

## Model Capabilities

| Model                    | Image Input | Object Generation | Tool Usage | Tool Streaming |
| ------------------------ | ----------- | ----------------- | ---------- | -------------- |
| `minimax-m3`             | <Cross />   | <Check />         | <Check />  | <Check />      |
| `minimax-m2.7`           | <Cross />   | <Check />         | <Check />  | <Check />      |
| `minimax-m2.7-highspeed` | <Cross />   | <Check />         | <Check />  | <Check />      |
| `minimax-m2.5`           | <Cross />   | <Check />         | <Check />  | <Check />      |
| `minimax-m2.5-highspeed` | <Cross />   | <Check />         | <Check />  | <Check />      |
| `minimax-m2.1`           | <Cross />   | <Check />         | <Check />  | <Check />      |
| `minimax-m2.1-highspeed` | <Cross />   | <Check />         | <Check />  | <Check />      |
| `minimax-m2`             | <Cross />   | <Check />         | <Check />  | <Check />      |

<Note>
  Please see the [MiniMax docs](https://platform.minimax.io/docs) for a full
  list of available models. You can also pass any available provider model ID as
  a string if needed.
</Note>


## Navigation

- [AI Gateway](/providers/ai-sdk-providers/ai-gateway)
- [xAI Grok](/providers/ai-sdk-providers/xai)
- [Vercel](/providers/ai-sdk-providers/vercel)
- [OpenAI](/providers/ai-sdk-providers/openai)
- [Azure OpenAI](/providers/ai-sdk-providers/azure)
- [Anthropic](/providers/ai-sdk-providers/anthropic)
- [Open Responses](/providers/ai-sdk-providers/open-responses)
- [Claude Platform on AWS](/providers/ai-sdk-providers/anthropic-aws)
- [Amazon Bedrock](/providers/ai-sdk-providers/amazon-bedrock)
- [Groq](/providers/ai-sdk-providers/groq)
- [Fal](/providers/ai-sdk-providers/fal)
- [AssemblyAI](/providers/ai-sdk-providers/assemblyai)
- [DeepInfra](/providers/ai-sdk-providers/deepinfra)
- [Deepgram](/providers/ai-sdk-providers/deepgram)
- [Black Forest Labs](/providers/ai-sdk-providers/black-forest-labs)
- [Gladia](/providers/ai-sdk-providers/gladia)
- [LMNT](/providers/ai-sdk-providers/lmnt)
- [Google](/providers/ai-sdk-providers/google)
- [Hume](/providers/ai-sdk-providers/hume)
- [Google Vertex AI](/providers/ai-sdk-providers/google-vertex)
- [Rev.ai](/providers/ai-sdk-providers/revai)
- [Baseten](/providers/ai-sdk-providers/baseten)
- [Hugging Face](/providers/ai-sdk-providers/huggingface)
- [QuiverAI](/providers/ai-sdk-providers/quiverai)
- [Mistral AI](/providers/ai-sdk-providers/mistral)
- [Together.ai](/providers/ai-sdk-providers/togetherai)
- [Cohere](/providers/ai-sdk-providers/cohere)
- [Fireworks](/providers/ai-sdk-providers/fireworks)
- [Voyage AI](/providers/ai-sdk-providers/voyage)
- [DeepSeek](/providers/ai-sdk-providers/deepseek)
- [Moonshot AI](/providers/ai-sdk-providers/moonshotai)
- [Alibaba](/providers/ai-sdk-providers/alibaba)
- [MiniMax](/providers/ai-sdk-providers/minimax)
- [Cerebras](/providers/ai-sdk-providers/cerebras)
- [Replicate](/providers/ai-sdk-providers/replicate)
- [Prodia](/providers/ai-sdk-providers/prodia)
- [Perplexity](/providers/ai-sdk-providers/perplexity)
- [Luma](/providers/ai-sdk-providers/luma)
- [ByteDance](/providers/ai-sdk-providers/bytedance)
- [Kling AI](/providers/ai-sdk-providers/klingai)
- [ElevenLabs](/providers/ai-sdk-providers/elevenlabs)
- [Cartesia](/providers/ai-sdk-providers/cartesia)


[Full Sitemap](/sitemap.md)
