Playbooks · Coding
Z.ai / MiniMax Anthropic API endpoints
Written November 10, 2026
If you have a client built for Anthropic's Messages API — Claude Code, a harness, a script using the Anthropic SDK — you can point it at a cheaper model without rewriting the client. MiniMax and Z.ai both publish Anthropic-compatible endpoints. The base URLs are short, and the part that bites is everything around them: which models work, which fields are ignored, and which plan the endpoint belongs to.
The problem
An Anthropic-compatible client expects Anthropic's API shape: a base URL, a POST /v1/messages route, a model name, and a familiar request body. MiniMax and Z.ai accept that shape, but compatibility is not identity — each one supports a subset of models on the interface, and each one quietly ignores or rejects some fields. Copying the base URL and assuming drop-in behaviour is how a working client starts failing on the second call.
MiniMax
MiniMax's Anthropic-compatible reference gives the endpoint as POST /anthropic/v1/messages, reached through the base URL https://api.minimax.io/anthropic:
curl --request POST \
--url https://api.minimax.io/anthropic/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-M3.1-Flash",
"messages": [{ "role": "user", "content": "Which is bigger, 9.11 or 9.9?" }],
"max_tokens": 4096
}'
With the Anthropic SDK, set ANTHROPIC_BASE_URL=https://api.minimax.io/anthropic and your MiniMax key as ANTHROPIC_API_KEY; the SDK adds the Messages route. MiniMax's docs recommend the Anthropic-compatible path for its advanced model features, and the current models on it are MiniMax-M3.1-Flash and MiniMax-M3, both multimodal models with native text, image, and video input alongside tool use and thinking content blocks. The OpenAI-compatible base is https://api.minimax.io/v1 for clients written the other way. Mainland China accounts use api.minimaxi.com instead of api.minimax.io — use the domain that matches where your API service was bought, not the one nearest you.
Three field differences to know before you send a real request:
- Thinking works differently per model.
MiniMax-M3.1-Flashalways thinks; if you send athinkingblock its type must beadaptive, anddisabledreturns HTTP 400. Tune depth withoutput_config.effort(low,medium,high,xhigh,max; the default ismax).MiniMax-M3does not think unless you sendadaptive. temperatureandtop_phave no effect. The docs say both are not supported yet: M3.1-Flash and M3 always use temperature 1 and top_p 0.95, whatever you pass.tool_choiceonly supportsauto. The model decides whether to call a tool; you cannot force a specific tool.
For max_tokens, MiniMax recommends 131072 for M3.1-Flash and M3, with a maximum of 524288. Do not paste the full endpoint URL into an SDK field that expects only a base URL — the SDK appends the route itself, and appending /v1 twice is the common mistake.
Z.ai
Z.ai's Anthropic-compatible base URL is https://api.z.ai/api/anthropic, set as ANTHROPIC_BASE_URL with ANTHROPIC_AUTH_TOKEN for auth. The compatibility reference records it as documented in the GLM Coding Plan context — the Claude Code guide and the Coding Endpoint table — and notes the docs read that day do not describe a separate pay-as-you-go Anthropic endpoint. That distinction matters: the Anthropic base belongs to the Coding Plan, not to general pay-as-you-go use.
Z.ai's OpenAI-compatible endpoints split the same way. General pay-as-you-go use goes to https://api.z.ai/api/paas/v4/ (chat completions and responses). GLM Coding Plan subscribers use dedicated endpoints instead: OpenAI Chat Completions at https://api.z.ai/api/coding/paas/v4 and OpenAI Responses at https://api.z.ai/api/v1.
Validate the fields first
Before any production call, send one small request through each endpoint you plan to use and read what comes back. Check that the model name is accepted, that thinking blocks arrive in the shape your client expects, and that a field you rely on — temperature, a forced tool call, a service_tier — is honoured rather than silently ignored. MiniMax documents two limitations on its Anthropic-compatible layer and six on its OpenAI-compatible layer; Z.ai documents two on its OpenAI-compatible layer. The docs for the exact endpoint you use are the authority, not the fact that the request returned 200 — an ignored field still returns 200.
Limits
- The MiniMax docs were read from the current reference pages; the Z.ai endpoints come from a compatibility reference that records Z.ai's own documentation as read on October 18, 2026. Neither endpoint was called from here, so no request on this page is a tested result.
- The Z.ai Anthropic endpoint is documented in the GLM Coding Plan context. If you are not on that plan, do not assume the same base URL works for pay-as-you-go use.
- Prices are not given here. Model pricing changes, and the per-token figures belong on the provider's pricing page, not in a page about endpoints.
Related playbooks
- Use your own Anthropic API key with an agent: what it costs, and the billing trap to check first
- Anthropic's no-distillation rule lands November 12
- Claude API effort control: change gear mid-stream
- Gemini API now takes Office files and returns files
Sources
- Create Message — MiniMax API Docs
- MiniMax OpenAI-compatible and Anthropic-compatible API: base URLs and limits — Developers Digest
- Z.ai (GLM) OpenAI-compatible and Anthropic-compatible API: base URLs and limits — Developers Digest
Back to: Coding playbooks hub