Agent Upstart

Cool things people are building with agents — and practical help getting the most out of them.

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:

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

Related playbooks

Sources

Back to: Coding playbooks hub