Kiloport

Tutorial · MiniMax M4 API

How to use the MiniMax M4 API

The quickest way to use MiniMax M4 from code is an OpenAI-compatible endpoint: keep the OpenAI SDK you already use, change the base URL and key, and set the model to minimax-m4. The same settings work in Cline, Roo Code, Continue, Aider and OpenCode.

Get your API key

In short

  • Base URL: https://minimaxm4.io/v1. Model: minimax-m4 or minimax-m4-pro.
  • Works with the official OpenAI SDKs for Python and Node.js.
  • Streaming, tool calls, JSON output and image input are supported.
  • Set reasoning_effort (low, medium, high, xhigh, max) to trade depth for speed.
  • Replies include the model’s reasoning in a separate reasoning field.

Get a key and balance

Sign in on the homepage, create a key, and add a one-time balance from $5. Keys start with sk_minimaxm4-io_ and can be revoked at any time.

  1. Install the SDK. pip install openai, or npm install openai.
  2. Point it at the API. Create the client with base_url https://minimaxm4.io/v1 and your key.
  3. Send a message. Call chat.completions.create with model minimax-m4 and your messages.

Images and tools

To ask about an image, send a user message whose content is a list with a text part and an image_url part. The URL can be https or a base64 data URL for PNG, JPEG, GIF or WebP.

Tool calling uses the standard tools array. M4 thinks between tool calls; when you send the conversation back, keep the assistant message as you received it so the model can continue its reasoning.

Coding agents

Agents that accept an OpenAI-compatible provider work out of the box. Choose the OpenAI Compatible provider, paste the base URL and key, and type minimax-m4 as the model ID. Use minimax-m4-pro for the hardest steps.

  • Cline, Roo Code and Kilo Code: API Provider “OpenAI Compatible”.
  • Aider: aider --model openai/minimax-m4 with OPENAI_API_BASE set.
  • OpenCode: add a provider with @ai-sdk/openai-compatible.

Frequently asked questions

Does the Anthropic SDK work?

This API speaks the OpenAI Chat Completions format. Use the OpenAI SDK or an OpenAI-compatible setting in your tool.

Can I see the model’s reasoning?

Yes. Streaming and non-streaming replies carry the reasoning text in a separate reasoning field next to the answer content.

What happens when my balance runs out?

Requests return HTTP 402 with an insufficient_quota error until you add balance. Nothing is charged for refused requests.

Is minimaxm4.io run by MiniMax?

No. Kiloport (minimaxm4.io) is an independent service that forwards requests to MiniMax M4 through a hosted model provider. It is not affiliated with or endorsed by MiniMax.

Sources

Updated 2026-12-04. Kiloport is an independent service and is not affiliated with or endorsed by MiniMax. MiniMax and MiniMax M4 are used only to name the model this API serves. Model output can be wrong; review it before you rely on it.