Install
openclaw skills install @runapi-ai/runapi-minimaxCall the MiniMax API (MiniMax-M3, MiniMax-M2.7, MiniMax-M2.7-highspeed, MiniMax-M2.5, MiniMax-M2.5-highspeed, MiniMax-M2.1, MiniMax-M2) through RunAPI using the official OpenAI SDK or compatible clients. Use when the user asks for MiniMax text chat, streaming completions, Anthropic or Gemini protocol compatibility, or when they want to point an existing OpenAI SDK setup at RunAPI as the base URL.
openclaw skills install @runapi-ai/runapi-minimaxUse the official OpenAI SDK or any OpenAI-compatible HTTP client and switch
the base URL to https://runapi.ai/v1. This skill covers MiniMax text
models. For Hailuo video generation, install the separate Hailuo skill.
OPENAI_API_KEY=YOUR_RUNAPI_TOKEN
OPENAI_BASE_URL=https://runapi.ai/v1
Get a RunAPI API Key at https://runapi.ai/api_keys.
from openai import OpenAI
client = OpenAI(
api_key="YOUR_RUNAPI_TOKEN",
base_url="https://runapi.ai/v1",
)
response = client.chat.completions.create(
model="MiniMax-M3",
messages=[{"role": "user", "content": "Draft a support response."}],
)
print(response.choices[0].message.content)
print(response.usage)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "YOUR_RUNAPI_TOKEN",
baseURL: "https://runapi.ai/v1",
});
const response = await client.chat.completions.create({
model: "MiniMax-M3",
messages: [{ role: "user", content: "Draft a support response." }],
});
stream = client.chat.completions.create(
model="MiniMax-M2.7-highspeed",
messages=[{"role": "user", "content": "Write a short status update."}],
stream=True,
)
for chunk in stream:
delta = chunk.choices[0].delta.content
if delta:
print(delta, end="", flush=True)
Streaming runs through a regional edge proxy so the request does not hold a Rails/Puma thread. Long generations should always stream.
MiniMax text models are also available through RunAPI's Anthropic-compatible
and Gemini contents client surfaces. RunAPI bridges those request and
response shapes to the OpenAI-compatible chat request format, so use these protocol
paths only when an existing tool expects those formats:
curl -X POST "https://runapi.ai/v1/messages" \
-H "x-api-key: YOUR_RUNAPI_TOKEN" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "MiniMax-M2",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Draft a concise answer."}]
}'
curl -X POST \
"https://runapi.ai/v1beta/models/MiniMax-M2:streamGenerateContent" \
-H "x-goog-api-key: YOUR_RUNAPI_TOKEN" \
-H "Content-Type: application/json" \
-d '{"contents":[{"role":"user","parts":[{"text":"Hello!"}]}]}'
For new app code, prefer the OpenAI-compatible setup.
curl https://runapi.ai/v1/models \
-H "Authorization: Bearer YOUR_RUNAPI_TOKEN"
| Model ID | Use when |
|---|---|
MiniMax-M3 | Latest MiniMax text chat |
MiniMax-M2.7 | MiniMax M2.7 compatibility |
MiniMax-M2.7-highspeed | Faster MiniMax M2.7 requests |
MiniMax-M2.5 | MiniMax M2.5 compatibility |
MiniMax-M2.5-highspeed | Faster MiniMax M2.5 requests |
MiniMax-M2.1 | MiniMax M2.1 compatibility |
MiniMax-M2 | MiniMax M2 compatibility |
OPENAI_API_KEY, RUNAPI_TOKEN, or a secret manager; never
inline them in commits or shell history.https://runapi.ai/v1.