Tool Setup · As of 2026-12-06

MiniMax-M4 & Step-5 Coding API Guide: 1M Context, 131K Output & Claude Code / Cline Integration (Dec 2026)

QCode now serves exact model IDs minimax-m4 and step-5—both featuring 1M context and image input, with 131,072 and 64,000 max output tokens respectively—accessible directly via Anthropic /api and OpenAI /openai/v1.

QCode is an independent third-party API service with no affiliation or endorsement from MiniMax, StepFun, Zhipu, Alibaba Cloud, Anthropic, or OpenAI. Specifications and active listings were verified on 2026-12-06; cited CNY prices reflect vendor official list prices, while live QCode unit prices and plan multipliers are governed by qcode.cc/models.

Updated 2026-12-06

Key Takeaways

  • Exact Model IDs & Case Tolerance: QCode's canonical active IDs are lowercase minimax-m4 and step-5 (synced on qcode.cc/models and GET https://api.qcode.cc/api/v1/models). While the gateway tolerates MiniMax-M4 as a fallback, always use lowercase minimax-m4 in config files and scripts.
  • Context & Max Output Split: Both support a 1M-token context window and image input, differing primarily in single-request output limits: minimax-m4 supports up to 131,072 output tokens on QCode (ideal for full-file rewrites and long patches), while step-5 supports 64,000 output tokens, specializing in native multimodal comprehension and fast agent tool calling.
  • Dual-Protocol Access with One Key: A single cr_ key works in Claude Code via https://api.qcode.cc/api using /model minimax-m4 or /model step-5, and in Cline, OpenCode, or the OpenAI SDK via https://api.qcode.cc/openai/v1 (https://asia.qcode.cc/openai/v1 recommended in Mainland China).
  • Long Multimodal Session TTFT Protection: During continuous UI-screenshot debugging in Claude Code, the QCode gateway automatically trims excess older screenshots via a sliding window (keeping the latest 8 images) so accumulated Base64 payloads do not stall TTFT.
  • Shared Pool with International Flagships: The same cr_ key shares one unified USD credit pool across Claude (claude-sonnet-5-5, claude-opus-5-5, claude-fable-5-2), GPT (gpt-6.2-sol, gpt-6.2-astra), Gemini (gemini-4-neon), and all 11 active Chinese models.
  • Replace Retired Legacy IDs: As of 2026-12-06, legacy IDs qwen3.8-max, qwen3.7-plus, kimi-k3, and glm-5.2 are retired and return standard HTTP 404—migrate to active models.

MiniMax-M4 vs. Step-5: Core Specs & Positioning

In early December 2026, MiniMax-M4 and StepFun Step-5 launched back-to-back, rounding out the Chinese coding model lineup across "ultra-long single-turn output" and "native vision + lean reasoning." Comparing them alongside fellow 1M-context, image-capable flagships glm-5.4 and qwen4-max clarifies where each fits among QCode's 11 active Chinese models across 6 families:

Model ID Context / QCode Max Output Image Input Official Vendor List Price (CNY / 1M tokens) Core Sweet Spot
minimax-m4 1M / 131,072 Supported Input CNY 5 / Output CNY 20 (official list) Full-file generation, multi-step tool calls, batch refactors
step-5 1M / 64,000 Native support Input ~CNY 7 / Output CNY 20 (official list) UI screenshot-to-code, frontend visual debugging, lean agents
glm-5.4 1M / 128,000 Supported Input CNY 8 / Output CNY 28 (official list) Loop Transformer deep reasoning, generalized coding, hard tasks
qwen4-max 1M / 65,536 Supported Input CNY 10 / Output CNY 30 (official list) Large Chinese codebases, cross-module design, doc refactoring

Note: Column 4 lists each vendor's official Mainland China public list prices (verified 2026-12-06) solely to show vendor positioning and relative cost tiers—not QCode billing rates. Always check qcode.cc/models for live QCode USD unit rates and plan multipliers.

Architecturally, each flagship targets a clear profile:

  • minimax-m4 (MiniMax): Released December 3, 2026 on a large sparse MoE architecture focused on high output throughput and 131K long-form generation. It handles full-repo context while writing entire scaffolds or multi-file patches in one pass without mid-edit truncation.
  • step-5 (StepFun): Released December 1, 2026 as a compact, efficient sparse MoE flagship emphasizing native multimodal vision and agent tool calling. Post-training specifically trimmed redundant thinking tokens compared to earlier previews, making iterative screenshot-driven UI edits feel noticeably snappier.
  • Comparison with glm-5.4 & qwen4-max: glm-5.4 runs Zhipu's 28-layer × 2-loop Loop Transformer for deep reasoning, while qwen4-max (released 2026-11-16) packs Alibaba's 2.4T total / 71B active MoE + 328B N-gram Embedding. For lightweight batching or 384K outputs, QCode's catalog also includes glm-5.3, glm-5.3-flash, qwen3.8-flash, kimi-k3.1-pro, deepseek-v4-pro, deepseek-v4.1-flash, and deepseek-v4-flash.

Why 131K Output and Native Multimodality Matter in Agentic Coding

For single-turn Q&A, 4K or 8K output suffices. Inside autonomous agent loops like Claude Code or Cline—planning, reading files, applying patches, and running tests—single-request output ceilings and visual input efficiency directly determine whether tasks finish cleanly in one pass.

Why 131,072 Max Output Prevents Broken Full-File Rewrites

A single coding-agent response packs three components: explicit or implicit reasoning, structured tool_use / function-call arguments, and full code blocks or unified diffs. Tighter output ceilings cause two common failures:

  1. Mid-file truncation on large modules: Generating a full module with types, API handlers, unit tests, and config—or migrating a thousand-line legacy file—can hit the output cap, leaving unclosed tool-call JSON and forcing multi-turn recovery that multiplies input token costs.
  2. Fragmented multi-step plans: Complex refactors often list affected files and dependency graphs before emitting consecutive patches. minimax-m4's 131,072-token output ceiling on QCode fits both reasoning and complete edits inside one turn, reducing state-loss rework.

How Native Multimodality Speeds Frontend Debugging

In frontend and full-stack work, describing visual issues in prose is slow and error-prone—whether it is a broken 390px mobile responsive table, a console stack trace screenshot, spacing hierarchy in a Figma mockup, or spike patterns on a monitoring dashboard.

With native multimodal image input and reliable multi-step tool calling, dragging a screenshot into Claude Code or sending image_url to step-5 closes the loop in one turn: spot the visual defect, locate the component and stylesheet, generate a minimal fix patch, and suggest verification steps. Tighter thinking-token budgets also keep rapid interactive UI iteration fast.

Solving Multi-Turn Screenshot Bloat: QCode Sliding-Window Trimming

During iterative UI debugging ("edit CSS -> screenshot -> edit again -> screenshot again"), after ten turns, a simple follow-up message would normally re-upload a dozen high-res Base64 PNGs—ballooning request payloads to megabytes, inflating input token bills, and pushing TTFT to several seconds or more.

To solve this, the QCode gateway enforces automatic sliding-window image trimming on long multimodal sessions: once historical images exceed the threshold, the gateway retains the 8 most recent images for current visual context and trims older redundant image payloads. Text history and code context remain intact while TTFT stays consistently fast without constantly running /clear.

Task-Based Model Pairing Recommendations

Development Scenario First Choice Alternative / Pairing Selection Rationale
Full-file creation, long scripts, large patches minimax-m4 deepseek-v4-pro 131K output avoids truncation; high throughput
UI screenshot replication, CSS fixes, visual agents step-5 glm-5.4 Steady native vision and crisp tool calling
Complex deep reasoning, cross-module architecture claude-opus-5-5 glm-5.4 / qwen4-max Primary flagship for hard design; Chinese models for cross-checks
High-frequency batch edits, search summaries, unit tests deepseek-v4.1-flash qwen3.8-flash / glm-5.3-flash Fast, low-latency tier suited for subagent calls

Configuration in Claude Code, Cline & the OpenAI SDK

QCode routes protocols by request path, while the API key itself is model-agnostic. With one cr_ key, Chinese models work across both Anthropic Messages and OpenAI Chat Completions.

1. Direct Claude Code Setup (Anthropic /api Endpoint)

If your environment already points Claude Code to QCode, keep ANTHROPIC_BASE_URL unchanged and switch models via CLI flags or session commands:

export ANTHROPIC_BASE_URL="https://api.qcode.cc/api"
export ANTHROPIC_AUTH_TOKEN="cr_your_key"

# Launch directly with MiniMax-M4
claude --model minimax-m4

Inside an interactive session, switch models anytime on the fly:

/model step-5
/model minimax-m4
/model glm-5.4
/model qwen4-max
/model claude-sonnet-5-5

To persist a split setup—such as primary coding on minimax-m4 (or claude-sonnet-5-5) with lightweight tasks routed elsewhere—configure ~/.claude/settings.json:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.qcode.cc/api",
    "ANTHROPIC_AUTH_TOKEN": "cr_your_key",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "minimax-m4",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "step-5"
  },
  "model": "minimax-m4"
}

Tip: Claude Code shows a conservative 200K context estimate for non-Anthropic model IDs. This is only a client-side display heuristic and does not restrict the model's 1M context window on QCode. To return to native Claude for heavy refactoring, run /model claude-opus-5-5 without restarting your terminal.

2. Cline / Roo Code / OpenCode Setup (OpenAI /openai/v1 Endpoint)

In Cline, Roo Code, and similar IDE extensions, select OpenAI Compatible and fill in three fields:

  • Base URL: https://api.qcode.cc/openai/v1 (https://asia.qcode.cc/openai/v1 recommended in Mainland China; https://us.qcode.cc/openai/v1 optional for US nodes; no trailing slash)
  • API Key: Your cr_... key
  • Model ID: Manually type minimax-m4 or step-5 (dropdowns are often empty in OpenAI-compatible mode—manual exact lowercase entry works directly)

Never enter the Anthropic endpoint https://api.qcode.cc/api into an OpenAI Compatible plugin, or protocol mismatch will trigger a 404.

3. End-to-End curl Connectivity Check

After getting your key, run a quick curl check to verify routing and model IDs (use asia.qcode.cc from Mainland China):

export QCODE_API_KEY="cr_your_key"

# Test minimax-m4 (OpenAI Chat Completions)
curl -sS https://asia.qcode.cc/openai/v1/chat/completions \
  -H "Authorization: Bearer $QCODE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax-m4",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Write a TypeScript fetch wrapper with exponential backoff retries and strict types."}
    ]
  }'

To inspect the live catalog programmatically (synced with qcode.cc/models):

curl -sS https://api.qcode.cc/api/v1/models

4. Python OpenAI SDK Example (Including Multimodal Image Input)

With the official openai Python SDK, point base_url to /openai/v1 for both text generation and vision inputs. The example below uses minimax-m4 for long module generation and step-5 to inspect a UI layout screenshot:

import base64
from pathlib import Path
from openai import OpenAI

client = OpenAI(
    api_key="cr_your_key",
    # Mainland China: https://asia.qcode.cc/openai/v1
    # Global default: https://api.qcode.cc/openai/v1; US option: https://us.qcode.cc/openai/v1
    base_url="https://asia.qcode.cc/openai/v1",
)

# Example 1: Generate a substantial module with minimax-m4
code_resp = client.chat.completions.create(
    model="minimax-m4",
    max_tokens=8192,
    messages=[
        {"role": "system", "content": "You are a senior backend engineer. Output runnable code and essential comments only."},
        {"role": "user", "content": "Write a rate-limited concurrent scraper in Python asyncio with a semaphore and graceful shutdown."},
    ],
)
print(code_resp.choices[0].message.content)

# Example 2: Inspect a local UI screenshot for CSS issues with step-5
img_b64 = base64.b64encode(Path("mobile-layout-bug.png").read_bytes()).decode("utf-8")
vision_resp = client.chat.completions.create(
    model="step-5",
    max_tokens=4096,
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "In this 390px mobile screenshot, the table wraps and squishes. Provide the minimal CSS fix."},
                {"type": "image_url", "image_url": {"url": f"data:image/png;base64,{img_b64}"}},
            ],
        }
    ],
)
print(vision_resp.choices[0].message.content)

Common Pitfalls: Casing, Output Caps & Retired IDs

In practice, 90% of integration errors come down to three issues: model ID formatting, exceeding max_tokens limits, or copying retired IDs from older tutorials.

1. Casing & Hyphen Rules: Standardize on Lowercase

Announcements and docs often display MiniMax-M4, Step-5, GLM-5.4, or Qwen4-Max, but QCode's canonical API model IDs are strictly lowercase:

  • Correct: minimax-m4, step-5, glm-5.4, qwen4-max, kimi-k3.1-pro, deepseek-v4-pro, deepseek-v4.1-flash.
  • Note on MiniMax: QCode's gateway includes fallback casing tolerance for MiniMax-M4, so both route cleanly. However, to prevent split usage reports or local client validation issues, always standardize on lowercase minimax-m4 everywhere. All other models require exact lowercase character-for-character matching.

2. max_tokens Bounds & Streaming Timeouts

Single-request output caps vary across Chinese flagships on QCode:

  • minimax-m4: up to 131,072 tokens
  • step-5: up to 64,000 tokens
  • glm-5.4 / glm-5.3 / glm-5.3-flash / qwen3.8-flash: up to 128,000 tokens
  • qwen4-max: up to 65,536 tokens
  • kimi-k3.1-pro: up to 131,072 tokens (note: reasoning tokens count toward both output limits and output billing)
  • deepseek-v4-pro / deepseek-v4.1-flash / deepseek-v4-flash: up to 384,000 tokens

Watch out: Avoid hardcoding max_tokens=128000 in shared scripts when switching to step-5 or qwen4-max, as exceeding the model's ceiling can trigger HTTP 400 validation errors or upstream truncation guards. Also enable stream=True and raise HTTP read timeouts when generating tens of thousands of tokens on minimax-m4 so local sockets do not time out mid-stream.

3. Retired Legacy IDs Returning HTTP 404

When migrating older .env, ~/.claude/settings.json, or Cline profiles, encountering standard HTTP 404 (model_not_found / not_found_error) usually means hitting a legacy ID retired on or before 2026-12-06. Replace them as follows:

Retired Legacy ID (Returns 404) Recommended Replacement (Active ID) Context / QCode Max Output Migration Notes
qwen3.8-max qwen4-max 1M / 65,536 Alibaba's next-gen MoE flagship with image input
qwen3.7-plus qwen3.8-flash or qwen4-max 1M / 128,000 or 65,536 Use Flash for lightweight jobs; Max for heavy coding
kimi-k3 kimi-k3.1-pro 1M / 131,072 Image input supported; thinking counts toward output
glm-5.2 glm-5.4 1M / 128,000 Upgrades to Loop Transformer flagship with image input
glm-5.1, kimi-k2.6, qwen3.7-max, qwen4-max-preview Active family ID or minimax-m4 / step-5 1M / see /models Previously retired IDs—check /models

If 404 persists after updating the ID, double-check that Claude models are not being sent to /openai/v1 or GPT models to /api. See Troubleshooting model_not_found and 404 Errors for full error-message diagnostics.

Frequently Asked Questions

What exact model IDs should I use for MiniMax-M4 and Step-5 on QCode?

Use exact lowercase minimax-m4 and step-5. Although QCode's gateway tolerates MiniMax-M4 as a fallback, sticking to lowercase minimax-m4 across Claude Code, Cline, and automation scripts matches GET https://api.qcode.cc/api/v1/models exactly.

Why does response latency stay stable even after pasting many screenshots in a long session?

In screenshot-heavy sessions like frontend debugging in Claude Code, the QCode gateway automatically trims excess older screenshots via a sliding window, sending only the 8 most recent images upstream. This prevents multi-megabyte Base64 payloads from inflating TTFT while preserving full text context.

How are minimax-m4 and step-5 billed on QCode compared to vendor list prices?

CNY figures in this article's comparison table are official vendor public list prices shown for reference. On QCode, all 11 active Chinese models draw from your unified USD credit pool at the live USD unit rates and plan conversion multipliers shown on qcode.cc/models. Run a small test task first and check token usage in your dashboard.

Does switching to minimax-m4 or step-5 in Claude Code break my existing Claude setup?

No. As long as ANTHROPIC_BASE_URL points to https://api.qcode.cc/api with your cr_ key, you can switch to /model minimax-m4 or /model step-5 anytime, then run /model claude-sonnet-5-5 or /model claude-opus-5-5 to switch back to Claude without editing environment variables or restarting.

What should I do if qwen3.8-max , kimi-k3 , or glm-5.2 suddenly returns 404?

Those legacy IDs were retired on or before 2026-12-06 and now return standard HTTP 404. Update qwen3.8-max to qwen4-max, qwen3.7-plus to qwen3.8-flash or qwen4-max, kimi-k3 to kimi-k3.1-pro, and glm-5.2 to glm-5.4 (or switch to minimax-m4 / step-5).

Plan & Quota Recommendations

Choose a plan matching your actual usage cadence rather than overcommitting upfront:

  • Cross-model benchmarking & on-demand usage: If you want to compare minimax-m4, step-5, glm-5.4, and qwen4-max side by side on your own codebase—or have bursty usage—start with QCode's Pay-As-You-Go Pack (PAYG) with no monthly lock-in.
  • Daily Claude 5 + Chinese flagship hybrid coding: If you code heavily every day in Claude Code, Cline, or OpenCode—using claude-sonnet-5-5 / claude-opus-5-5 for architecture while routing long generation and visual debugging to minimax-m4 and step-5—a daily-quota monthly plan or Elite plan on the Pricing page offers stronger long-term predictability under one unified USD pool.

Check qcode.cc/models for live model availability, USD rates, and plan conversion multipliers.

Plan & Quota Recommendations

One key for both the Anthropic Messages API and OpenAI-compatible APIs. Claude and GPT are billed at the official price ×1.0; live rates are on /models.

Not sure where to start?

Try it for a week

Small Pack: $4 for $30 of quota, valid 7 days

Use it every day

Starter: $9.00/month with $5 of quota every day — just $0.060 per $1 of quota, vs about $0.113 for the Medium Pack