# MiniMax

[MiniMax](https://platform.minimax.io/docs/guides/quickstart) provides hosted generative models through its platform API. Applications call MiniMax through stable AISIX aliases while the gateway keeps the upstream credential out of client code.

## Prerequisites[​](#prerequisites "Direct link to Prerequisites")

Before starting, prepare the following:

* One AISIX setup:

  <!-- -->

  * For AISIX Enterprise or AISIX Cloud, an environment with an attached gateway and a write-scoped admin token. For AISIX Enterprise, follow the [AISIX Enterprise getting-started guide](https://docs.api7.ai/ai-gateway/getting-started/aisix-cloud-quickstart.md). To request AISIX Cloud access, [contact API7](https://api7.ai/contact).
  * For the open-source AISIX gateway, prepare either a local AISIX installation or the Docker setup from the [AISIX OSS getting-started guide](https://docs.api7.ai/ai-gateway/getting-started/gateway-quickstart.md). Configure the gateway to load a declarative resources file.

* A MiniMax API key from the [MiniMax platform](https://platform.minimax.io/).

* `curl` and `jq`.

## Set the Correct Base URL[​](#set-the-correct-base-url "Direct link to Set the Correct Base URL")

MiniMax publishes two upstream surfaces for the same models:

| Surface                                                                            | Root                               | Request format          |
| ---------------------------------------------------------------------------------- | ---------------------------------- | ----------------------- |
| [OpenAI SDK](https://platform.minimax.io/docs/api-reference/text-openai-api)       | `https://api.minimax.io/v1`        | OpenAI chat completions |
| [Anthropic SDK](https://platform.minimax.io/docs/api-reference/text-anthropic-api) | `https://api.minimax.io/anthropic` | Anthropic Messages      |

The community catalog entry for `minimax` publishes `https://api.minimax.io/anthropic/v1`, the Anthropic-compatible surface written out with the version segment that the Anthropic SDK would otherwise append, while the catalog default assigns the `openai` adapter. Those two do not fit together. If you omit `api_base`, AISIX accepts the provider key, fills in that catalog value, and then sends OpenAI-shaped chat-completions requests to an endpoint that expects Anthropic-shaped Messages requests, and every call through the alias fails at the upstream.

caution

Always set `api_base` to `https://api.minimax.io/v1` on a `minimax` provider key. The gateway appends the endpoint path, such as `/chat/completions`, to whatever root you configure, so the root must be the one that MiniMax's OpenAI-compatible `/chat/completions` hangs off.

The provider key configured below uses `api_base` for Chat Completions and a separate declared base for Messages and Count Tokens. See [Use the Anthropic-Compatible Surface](#use-the-anthropic-compatible-surface).

## Configure with AISIX Enterprise or AISIX Cloud[​](#configure-with-aisix-enterprise-or-aisix-cloud "Direct link to Configure with AISIX Enterprise or AISIX Cloud")

Export the control-plane connection details:

```
# AISIX_CP is the Admin API base URL; include /api and omit a trailing slash

# The local AISIX Enterprise quickstart uses http://localhost:8080/api

export AISIX_CP="YOUR_AISIX_CONTROL_PLANE_API_URL"

export AISIX_TOKEN="YOUR_ADMIN_TOKEN"

export ENV_ID="YOUR_ENVIRONMENT_ID"
```

Create a provider key, model alias, and caller API key for MiniMax-backed Chat Completions, Messages, and Count Tokens.

MiniMax is a community catalog provider. AISIX connects through the `openai` adapter and authenticates upstream requests with a bearer token. You must also set `api_base` explicitly because the catalog's published base URL is not the root required by the adapter. See [Set the Correct Base URL](#set-the-correct-base-url).

### Create a Provider Key[​](#create-a-provider-key "Direct link to Create a Provider Key")

Create the provider key that stores the MiniMax credential and API root:

```
# Replace with your value

export MINIMAX_API_KEY="YOUR_PROVIDER_API_KEY"



PROVIDER_KEY_ID=$(curl -sS -X POST "$AISIX_CP/provider_keys" \

  -H "Authorization: Bearer $AISIX_TOKEN" \

  -H "Content-Type: application/json" \

  -d '{

    "display_name": "minimax-prod",

    "provider": "minimax",

    "api_key": "'"${MINIMAX_API_KEY}"'",

    "api_base": "https://api.minimax.io/v1",

    "apis": {

      "messages": { "base": "https://api.minimax.io/anthropic" }

    },

    "allowed_environments": ["'"${ENV_ID}"'"]

  }' | jq -r '.provider_key.id')



echo "$PROVIDER_KEY_ID"
```

❶ `provider` is `minimax`. The AISIX Cloud Admin API accepts the value because `minimax` is a models.dev catalog entry, and it derives the adapter from the catalog; the `adapter` field is only accepted on BYO provider keys.

❷ `api_key` stores the MiniMax API key. MiniMax authenticates its OpenAI-compatible surface with HTTP bearer authentication, which is what the `openai` adapter already sends. The value follows the credential-handling behavior in [Provider Keys](https://docs.api7.ai/ai-gateway/models/provider-keys.md#credential-handling).

❸ `api_base` is `https://api.minimax.io/v1`, the `base_url` that MiniMax documents for OpenAI client libraries. It is the single most important field on this page. Omitting it does not fail the create call, because the catalog publishes a default; it fails every later chat request, because that default points at the Anthropic-compatible root.

❹ `apis.messages` declares MiniMax's Anthropic-compatible Messages and Count Tokens routes on their sibling base. Count Tokens is documented for the MiniMax-M3 model used in this guide.

Keep this declaration on a provider key used only by MiniMax-M3 aliases. For another model generation, use a separate provider key without `apis.messages` unless MiniMax documents Count Tokens support for that model.

The command captures the returned provider key ID in `PROVIDER_KEY_ID`.

### Create a Model[​](#create-a-model "Direct link to Create a Model")

MiniMax model IDs are case-sensitive and carry no vendor prefix. They follow the pattern `MiniMax-<generation>`, with a capital `M` on both halves of the vendor name, a decimal generation number, and an optional `-highspeed` suffix on the low-latency variant of a generation. Do not lowercase them, and do not add a `minimax/` prefix carried over from an aggregator.

Current model IDs include the following:

| Model ID                 | Notes                                                                                                    |
| ------------------------ | -------------------------------------------------------------------------------------------------------- |
| `MiniMax-M3`             | Latest generation. Accepts text, image, and video input on the OpenAI-compatible chat-completions route. |
| `MiniMax-M2.7`           | Previous flagship generation, text input only.                                                           |
| `MiniMax-M2.7-highspeed` | Low-latency variant of the same generation.                                                              |

The `MiniMax-M2.5`, `MiniMax-M2.5-highspeed`, `MiniMax-M2.1`, and `MiniMax-M2` IDs remain in the catalog as earlier generations. Check the [MiniMax model documentation](https://platform.minimax.io/docs/api-reference/api-overview) for the current list before you create an alias.

Create the model alias callers will send in requests:

```
MODEL_ID=$(curl -sS -X POST "$AISIX_CP/environments/$ENV_ID/models" \

  -H "Authorization: Bearer $AISIX_TOKEN" \

  -H "Content-Type: application/json" \

  -d '{

    "display_name": "minimax-m3-prod",

    "model_name": "MiniMax-M3",

    "provider_key_id": "'"${PROVIDER_KEY_ID}"'"

  }' | jq -r '.model.id')



echo "$MODEL_ID"
```

❶ `display_name` is the alias callers send in `model`.

❷ `model_name` is the MiniMax model ID, spelled exactly as MiniMax publishes it, for example `MiniMax-M3`.

❸ `provider_key_id` attaches the alias to the MiniMax provider key.

To understand model cost metadata and control-plane pricing, see [Model Aliases](https://docs.api7.ai/ai-gateway/models/model-aliases.md#cost-metadata).

### Create a Caller API Key[​](#create-a-caller-api-key "Direct link to Create a Caller API Key")

Create the caller API key that can access the model alias. The plaintext key is server-generated and returned once in the create response, so capture it now:

```
AISIX_API_KEY=$(curl -sS -X POST "$AISIX_CP/environments/$ENV_ID/api_keys" \

  -H "Authorization: Bearer $AISIX_TOKEN" \

  -H "Content-Type: application/json" \

  -d '{

    "display_name": "minimax-caller",

    "allowed_models": ["'"${MODEL_ID}"'"]

  }' | jq -r '.plaintext')



echo "$AISIX_API_KEY"
```

The `allowed_models` value must reference the model ID captured in the previous step. After the write, the configuration projects to attached gateways automatically.

## Configure with AISIX OSS[​](#configure-with-aisix-oss "Direct link to Configure with AISIX OSS")

Export the upstream credential and choose the caller API key that applications will send to the gateway:

```
export MINIMAX_API_KEY="YOUR_PROVIDER_API_KEY"

export CALLER_API_KEY="YOUR_CALLER_API_KEY"

export CALLER_API_KEY_SHA256="$(printf '%s' "$CALLER_API_KEY" | sha256sum | cut -d ' ' -f 1)"
```

For a new gateway, use this complete resources file. For an existing gateway, merge the entries into its [current file](https://docs.api7.ai/ai-gateway/reference/resources-file.md#apply-resource-examples-safely), preserving its other resources:

resources.yaml

```
_format_version: "2"



provider_keys:

  - id: b58f1360-50e2-4890-905b-28d0e2299e12

    display_name: "minimax-prod"

    provider: "minimax"

    adapter: "openai"

    api_key: ${MINIMAX_API_KEY}

    api_base: "https://api.minimax.io/v1"

    apis:

      messages:

        base: "https://api.minimax.io/anthropic"



models:

  - id: 8cf18dc4-cf20-4b4a-8286-05d22ae6ad71

    display_name: "minimax-m3-prod"

    provider: "minimax"

    model_name: "MiniMax-M3"

    provider_key_id: b58f1360-50e2-4890-905b-28d0e2299e12



api_keys:

  - id: f4a9afe5-6c6a-4fb8-8c92-ecbcdc32fcf2

    display_name: "minimax-caller"

    key_hash: ${CALLER_API_KEY_SHA256}

    allowed_models:

      - "minimax-m3-prod"
```

If AISIX is installed locally, validate the file before loading it:

```
aisix validate --resources resources.yaml
```

After validation, start the gateway with the referenced environment variables in its process environment. Reload an existing gateway only if those variables are already available to the process; otherwise, restart it with the updated environment.

If you use Docker, adapt the validation and startup commands in the [AISIX OSS getting-started guide](https://docs.api7.ai/ai-gateway/getting-started/gateway-quickstart.md). Mount this `resources.yaml` file and pass every environment variable it references with `-e` in both commands. After the resources load, prepare the shared verification request below:

```
export AISIX_API_KEY="$CALLER_API_KEY"
```

## Verify the Provider Connection[​](#verify-the-provider-connection "Direct link to Verify the Provider Connection")

Export the AISIX gateway origin:

```
# AISIX_PROXY has no trailing slash or endpoint path

# The local quickstarts use http://127.0.0.1:3000

export AISIX_PROXY="YOUR_AISIX_GATEWAY_URL"
```

Send a chat-completions request through the AISIX proxy:

```
curl -sS -X POST "$AISIX_PROXY/v1/chat/completions" \

  -H "Authorization: Bearer ${AISIX_API_KEY}" \

  -H "Content-Type: application/json" \

  -d '{

    "model": "minimax-m3-prod",

    "messages": [

      {

        "role": "user",

        "content": "Say hello from MiniMax."

      }

    ]

  }'
```

The gateway returns an OpenAI-compatible response that echoes the caller-facing alias `minimax-m3-prod`.

Verify the MiniMax-M3 Count Tokens route through the same alias:

```
curl -sS -X POST "$AISIX_PROXY/v1/messages/count_tokens" \

  -H "x-api-key: ${AISIX_API_KEY}" \

  -H "anthropic-version: 2023-06-01" \

  -H "Content-Type: application/json" \

  -d '{

    "model": "minimax-m3-prod",

    "messages": [

      {

        "role": "user",

        "content": "Count this MiniMax prompt."

      }

    ]

  }'
```

A successful response contains `input_tokens`. If this request fails while Chat Completions works, check the `apis.messages.base` value and confirm that the alias still targets MiniMax-M3.

If the chat-completions request fails, check these in order:

1. `api_base` on the provider key. An upstream 404, or an upstream error that mentions an unexpected request field, usually means the key is still pointing at `https://api.minimax.io/anthropic/v1` rather than `https://api.minimax.io/v1`.
2. `api_key` on the provider key, if the upstream returns an authentication error.
3. The spelling and capitalization of `model_name`. MiniMax model IDs are case-sensitive.

## Use the Anthropic-Compatible Surface[​](#use-the-anthropic-compatible-surface "Direct link to Use the Anthropic-Compatible Surface")

AISIX can translate Anthropic-shaped requests onto MiniMax Chat Completions, but that bridge cannot preserve MiniMax's complete Anthropic-compatible contract. The provider key in this guide therefore declares the native Messages surface on the same credential and alias. See [Anthropic Messages API](https://docs.api7.ai/ai-gateway/endpoints/anthropic-messages.md) for the native-versus-translated behavior.

The declaration sends `/v1/messages` and `/v1/messages/count_tokens` to `https://api.minimax.io/anthropic` while Chat Completions continues to use `api_base`. MiniMax documents Count Tokens for MiniMax-M3; do not infer the same support for every model listed on the platform.

## Understand the Community Catalog Path[​](#understand-the-community-catalog-path "Direct link to Understand the Community Catalog Path")

A featured provider carries an AISIX-curated adapter, authentication scheme, default base URL, and any request or response rewrites the upstream needs. `minimax` has none of those. The dashboard groups it under the community catalog, and AISIX makes exactly three decisions on its behalf:

* The adapter is `openai`.
* The authentication scheme is HTTP bearer.
* The default base URL is whatever models.dev publishes for the provider, cached in AISIX provider metadata.

Everything else is yours to supply. In practice this means:

* **The base URL is your responsibility.** On this provider the published default is wrong for the assigned adapter, so set it explicitly, as described in [Set the Correct Base URL](#set-the-correct-base-url). AISIX rejects a create call with a 400 error only when models.dev publishes no base URL at all for a provider; `minimax` publishes one, so the request succeeds and the mismatch surfaces later.
* **No request or response rewrites are registered.** AISIX forwards the caller's chat-completions body to MiniMax with no parameter renames, and normalizes reasoning from the canonical `delta.reasoning_content` path. It does not preserve MiniMax's separate `reasoning_details` array. See [Configure Request and Response Overrides](#configure-request-and-response-overrides).
* **The upstream contract is not tracked for you.** When MiniMax changes its wire shape, no catalog entry changes with it. Verify a representative request against a non-production alias after a MiniMax API update.

Usage records still tag the provider key as a catalog key branded `minimax`, and mark it as not featured, so community-catalog traffic stays distinguishable in usage data.

None of this makes `minimax` a lesser upstream. It is a supported catalog provider with the same caller keys, allowlists, rate limits, and usage accounting as any other alias. In AISIX Enterprise and AISIX Cloud, matching budgets also apply. The difference is where the responsibility for the wire contract sits.

## Configure Request and Response Overrides[​](#configure-request-and-response-overrides "Direct link to Configure Request and Response Overrides")

Because `minimax` has no AISIX-curated adapter mapping, the provider key is the only place to record a MiniMax-specific wire difference. AISIX sends top-level request fields unchanged unless you configure `request.param_renames`. MiniMax-M3 currently accepts both `max_tokens` and `max_completion_tokens`, so no rename is required for the model in this guide. Add one only when the selected model requires a different field name.

MiniMax-M3 defaults `reasoning_split` to `false`, which keeps thinking inside `<think>` tags in `content`; AISIX preserves that content. If you set `reasoning_split` to `true`, MiniMax also emits `reasoning_content` and a `reasoning_details` array. On `/v1/chat/completions`, AISIX preserves `reasoning_content` but drops `reasoning_details`; the Responses bridge does not expose either field. The `response.reasoning_field` override cannot retain the array. MiniMax requires the complete array in conversation history for interleaved thinking with tools, so leave split reasoning disabled for multi-turn tool loops through the normalized chat or Responses endpoints. If your application depends on the complete Anthropic thinking and tool-use contract from MiniMax, use the [Anthropic-compatible surface](#use-the-anthropic-compatible-surface).

For a different model that streams scalar reasoning from a nonstandard `delta` path, set `response.reasoning_field` on the provider key to that path. AISIX then maps it to `delta.reasoning_content` for callers. Confirm any override with a streaming request against the configured model.

Overrides apply to every model that references the provider key, so test them against a non-production alias first. See [Provider-Specific Overrides](https://docs.api7.ai/ai-gateway/models/provider-keys.md#configure-provider-specific-overrides).

## Connect the China Platform[​](#connect-the-china-platform "Direct link to Connect the China Platform")

MiniMax operates a separate platform for mainland China, with its own developer console and hostname. It appears in the catalog as a distinct provider ID, `minimax-cn`, and each platform issues its own API keys, so the China platform needs its own provider key.

The same base-URL correction applies: the catalog default points at the Anthropic-compatible root, and the current OpenAI-compatible root is `https://api.minimax.cn/v1`.

```
{

  "display_name": "minimax-cn-prod",

  "provider": "minimax-cn",

  "api_key": "YOUR_MINIMAX_CN_API_KEY",

  "api_base": "https://api.minimax.cn/v1",

  "apis": {

    "messages": { "base": "https://api.minimax.cn/anthropic" }

  },

  "allowed_environments": ["YOUR_ENVIRONMENT_ID"]

}
```

The catalog lists the same model IDs for both platforms. Availability of a given generation is not guaranteed to match, so verify against the [China platform documentation](https://platform.minimax.cn/docs/guides/quickstart) rather than assuming parity.

The `apis.messages` block in this China example has the same MiniMax-M3 boundary. Omit it when the key will serve another generation unless MiniMax documents Count Tokens for that model.

## Endpoint Coverage[​](#endpoint-coverage "Direct link to Endpoint Coverage")

This alias uses the OpenAI-compatible text and multimodal chat surface from MiniMax. MiniMax also provides native image, video, speech, music, and file APIs, but their paths and bodies do not match the normalized media and job contracts in AISIX.

| Route                                          | Behavior with a MiniMax alias                                                                                                                                                                                                                                                                                                 |
| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `/v1/chat/completions`                         | Supported, including `stream: true`. MiniMax-M3 accepts image and video inputs here for multimodal understanding; this route does not generate images or videos.                                                                                                                                                              |
| `/v1/responses`                                | Supported through the [Responses bridge](https://docs.api7.ai/ai-gateway/endpoints/responses-api.md). AISIX translates the request to chat completions; it does not call a MiniMax `/v1/responses` endpoint. OpenAI-specific Responses fields without a chat equivalent are ignored.                                          |
| `/v1/messages` and `/v1/messages/count_tokens` | Sent to MiniMax's Anthropic-compatible routes because this guide declares `apis.messages`. Count Tokens is documented for MiniMax-M3; other model generations may not support it.                                                                                                                                             |
| `/v1/embeddings`                               | Do not assume support. AISIX forwards an OpenAI-shaped embeddings body to `{api_base}/embeddings` without translation, but MiniMax's current public API documentation does not define an OpenAI-compatible embeddings contract or embedding model. See [Embeddings](https://docs.api7.ai/ai-gateway/endpoints/embeddings.md). |
| `/v1/images/generations`                       | Rejected with a 400 error. MiniMax image generation uses the native `/v1/image_generation` contract, which you can access through a passthrough route.                                                                                                                                                                        |
| `/v1/rerank`                                   | Rejected with a 400 error. The route accepts only the `openai`, `cohere`, and `jina` provider values.                                                                                                                                                                                                                         |
| `/v1/videos`                                   | Returns 501 Not Implemented. MiniMax video generation uses the native `/v1/video_generation` contract, which you can access through a passthrough route.                                                                                                                                                                      |
| `/passthrough/minimax/*`                       | Available through a configured [passthrough route](https://docs.api7.ai/ai-gateway/endpoints/provider-passthrough.md) for native routes such as `/image_generation`, `/video_generation`, `/t2a_v2`, and `/files/retrieve`. AISIX forwards the native body and response without translating them.                             |

The `/passthrough/minimax` paths on this page assume a passthrough route claiming that prefix, with MiniMax's API root as its `target_url` and this provider key attached; grant the route name on the caller key's `allowed_routes`. A route relays to one fixed target, so if you configure more than one MiniMax account or base URL, create a separate route per account. AISIX does not rewrite a `model` value in the native body. For the request shapes that record token usage, see [Envelope Detection and Usage](https://docs.api7.ai/ai-gateway/endpoints/provider-passthrough.md#envelope-detection-and-token-usage).

With a route targeting the base in this guide, passthrough requests resolve against `https://api.minimax.io/v1`. That root already ends in a version segment, and the gateway strips one redundant leading version segment from the passthrough path when it matches. Both `/passthrough/minimax/v1/image_generation` and `/passthrough/minimax/image_generation` therefore reach `https://api.minimax.io/v1/image_generation` rather than a doubled `/v1/v1/` URL.

## Next Steps[​](#next-steps "Direct link to Next Steps")

You have now connected AISIX to MiniMax and verified the model alias. Continue with these guides:

* [Model Aliases](https://docs.api7.ai/ai-gateway/models/model-aliases.md): configure routing, retry behavior, or cost metadata for this alias.
* [Routing and Failover](https://docs.api7.ai/ai-gateway/routing/routing-and-failover.md): fail over between MiniMax and a second provider.
* [Provider-Specific Overrides](https://docs.api7.ai/ai-gateway/models/provider-keys.md#configure-provider-specific-overrides): adapt request and response shapes when an upstream API differs from its adapter.
* [Provider Compatibility](https://docs.api7.ai/ai-gateway/providers/compatibility.md): review supported proxy endpoints and provider-specific boundaries.
