MiniMax M2.7 API — OpenAI-Compatible Access
How to call MiniMax M2.7 via the OpenAI-compatible SDK — no new SDK required.
Why / When to Use
Use when building an app that calls MiniMax M2.7 (or M2.7-highspeed) and you want to reuse existing OpenAI SDK knowledge. Supports together.ai as a managed alternative.
Core Concept / Commands
Via OpenAI SDK (recommended)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.minimax.io/v1",
apiKey: process.env.MINIMAX_API_KEY,
});
const response = await client.chat.completions.create({
model: "minimax-m2.7",
messages: [{ role: "user", content: "Your prompt here" }],
temperature: 0.7,
max_tokens: 4096,
});Via Together AI (managed infra alternative)
// base URL: https://api.together.xyz/v1/chat/completions
// model string: MiniMaxAI/MiniMax-M2.7Key Options / Variants
Recommended parameters for best performance:
temperature: 1.0top_p: 0.95top_k: 40
Gotchas
- Model string is
minimax-m2.7on MiniMax direct,MiniMaxAI/MiniMax-M2.7on Together AI. - MiniMax also supports Anthropic SDK — just change
base_urlandapi_key.
Source
Conversation: “MUI vs Tailwind/shadcn comparison” — 2026-05-30