Use MiniMax in Cline and Roo Code (VS Code)
Configure Cline or Roo Code to run MiniMax-M2.7 and MiniMax-M3 through YiduoChan's OpenAI-compatible API, with the exact base URL, model IDs, context window and per-token prices the extensions need for accurate cost tracking.
Cline and Roo Code are VS Code extensions that run an agentic coding loop: they read files, propose edits, run terminal commands and iterate on the results. Both can send requests to any OpenAI-compatible endpoint, so they work with MiniMax models through YiduoChan without a plugin or wrapper. This guide walks through the configuration for each extension, gives the exact model IDs and per-token prices to enter so the in-editor cost display matches your bill, and covers the settings that matter for long agentic sessions.
What you need
- A YiduoChan account with prepaid credits. Create an account, top up (minimum $5) and generate an API key in the console. Credits are prepaid USD, pay-as-you-go, with no subscription. There are no free credits.
- VS Code with Cline or Roo Code installed from the extension marketplace.
- The three values both extensions ask for, listed below.
| Setting | Value |
|---|---|
| API provider | OpenAI Compatible |
| Base URL | https://yiduochan.com/v1 |
| API key | Your key from the YiduoChan console (sent as Authorization: Bearer <API key>) |
| Model ID | MiniMax-M2.7, MiniMax-M2.7-highspeed or MiniMax-M3 |
Before touching the extension settings, confirm the key works from a terminal. If this call returns a completion, any remaining problem is in the extension configuration, not the account.
curl https://yiduochan.com/v1/chat/completions \
-H "Authorization: Bearer $YIDUOCHAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "MiniMax-M2.7",
"messages": [{"role": "user", "content": "Reply with OK."}]
}'
To list the model IDs the endpoint accepts:
curl https://yiduochan.com/v1/models \
-H "Authorization: Bearer $YIDUOCHAN_API_KEY"
Model IDs and prices
Enter the IDs exactly as shown. Prices are USD per 1M tokens and are the same numbers YiduoChan bills against, so entering them in the extension gives you a cost estimate that tracks the console.
| Model ID | Input | Output | Cache read | Cache write | Notes |
|---|---|---|---|---|---|
MiniMax-M2.7 | $0.30 | $1.20 | $0.06 | $0.375 | Default choice for agentic coding |
MiniMax-M2.7-highspeed | $0.60 | $2.40 | $0.06 | $0.375 | Same quality as M2.7, lower latency |
MiniMax-M3 (prompts up to 512K tokens) | $0.30 | $1.20 | $0.06 | — | 1,048,576-token context |
MiniMax-M3 (prompts 512K to 1M tokens) | $0.60 | $2.40 | $0.12 | — | Applies once a single prompt exceeds 512K tokens |
Cline and Roo Code accept one input price and one output price per model. For MiniMax-M3, enter the up-to-512K tier. If a task grows a prompt past 512K tokens, the extension's estimate will undercount that request; the console usage log always shows the actual charge. Details on each model are on the MiniMax-M2.7 and MiniMax-M3 pages, and the current price list is at /pricing.
Set up Cline
- Open the Cline panel in the VS Code sidebar and click the settings gear.
- Set API Provider to OpenAI Compatible.
- Set Base URL to
https://yiduochan.com/v1. Do not append/chat/completions; Cline adds the path itself. - Paste your key into the API Key field.
- Set Model ID to
MiniMax-M2.7(or one of the other IDs above). - Expand the model configuration section and fill in the context window, output limit and prices from the table in the next section.
- Save, then send a short task such as "list the files in this workspace" to confirm the extension receives a response and shows a non-zero cost.
Cline can use different providers for Plan mode and Act mode. A practical split is MiniMax-M3 for Plan, where reading a large slice of the repository in one pass is useful, and MiniMax-M2.7 for Act, where each turn is smaller and the standard price applies to more of the traffic. If you keep one model for both, MiniMax-M2.7 is the sensible default.
Cline model configuration values
| Field | MiniMax-M2.7 | MiniMax-M2.7-highspeed | MiniMax-M3 |
|---|---|---|---|
| Context Window Size | Extension default | Extension default | 1048576 |
| Max Output Tokens | Extension default | Extension default | Extension default |
| Input Price / 1M tokens | 0.30 | 0.60 | 0.30 |
| Output Price / 1M tokens | 1.20 | 2.40 | 1.20 |
| Cache Reads Price / 1M tokens | 0.06 | 0.06 | 0.06 |
| Cache Writes Price / 1M tokens | 0.375 | 0.375 | Leave empty |
| Supports Images | Off | Off | Off |
The context window value only tells the extension when to start truncating or condensing conversation history; it does not change what the API accepts. For MiniMax-M2.7 and MiniMax-M2.7-highspeed, leave the extension default; the model details are on the MiniMax-M2.7 page. For MiniMax-M3 the published window is 1,048,576 tokens, so enter that exact figure. Field labels differ slightly between Cline releases; if your version does not show cache price fields, skip them and the estimate will count cached input at the full input price.
Set up Roo Code
Roo Code uses configuration profiles, so you can save one profile per MiniMax model and switch between them, or bind different profiles to its Code, Architect, Ask and Debug modes.
- Open the Roo Code panel and click the settings gear, then the Providers tab.
- Create a new configuration profile (for example
yiduochan-m2.7) so the settings do not overwrite an existing provider. - Set API Provider to OpenAI Compatible.
- Set Base URL to
https://yiduochan.com/v1. - Paste the key into API Key.
- In the Model field, type
MiniMax-M2.7. Roo Code may offer a dropdown populated from/v1/models; typing the ID manually works regardless. - Open the model settings below the model field and enter the context window, prices and cache prices using the same values as the Cline table above. If a prompt caching toggle is shown, enable it.
- Leave image support and computer use disabled; these are text models.
- Save and run a small task to confirm the cost readout updates.
Repeat the profile for MiniMax-M3 with a context window of 1048576 if you want a profile for very large codebases. Because the profile stores the price fields, the per-task cost shown in the Roo Code task header will use the correct rate whichever profile is active.
Prompt caching and what the cost display means
An agentic loop resends the system prompt, tool definitions and the whole conversation on every turn, so most input tokens in a session are repeats of earlier turns. Cached input is where the cost difference shows up: for MiniMax-M2.7 a cache read is billed at $0.06 per 1M tokens against $0.30 for uncached input, one fifth of the standard rate, while a cache write is $0.375. For MiniMax-M3 the cache read price is $0.06 up to 512K tokens and $0.12 from 512K to 1M.
Cline and Roo Code compute their cost figure locally from the token counts reported in each response's usage object, multiplied by the prices you entered. When the usage object reports cached tokens, the extension applies the cache read price to them; when it does not, every input token is priced at the standard input rate and the estimate is higher than the actual charge. Treat the in-editor number as a running estimate and the YiduoChan console usage log as the billing record. Failed requests are never charged, whatever the extension displays.
Recommended settings for agentic coding
- Default model:
MiniMax-M2.7. Switch toMiniMax-M2.7-highspeedwhen turnaround time matters more than cost; it offers the same quality at double the input and output price, with lower latency; cache read and cache write prices are unchanged. - Large repositories: use
MiniMax-M3when a task needs the 1M-token window. Keep an eye on prompt size, since the price doubles above 512K tokens per prompt. - Context window: leave the extension default for
MiniMax-M2.7andMiniMax-M2.7-highspeed; enter 1048576 forMiniMax-M3. - Streaming: leave the extension default.
- Temperature: leave the extension default unless you have measured a reason to change it.
- Project rules: put repository-specific instructions in Cline's rules file or Roo Code's rules directory rather than repeating them in every prompt, so they are sent consistently on every turn.
- Spend control: prepaid credits act as a hard ceiling. Top up in $5, $10, $20, $50, $100, $200, $500 or a custom amount; credits are valid for 12 months.
Troubleshooting
- 401 Unauthorized. The key is missing, truncated or pasted with whitespace. Re-copy it from the console. The extension sends it as
Authorization: Bearer <API key>; you do not add the wordBeareryourself. - Model not found. The model ID is misspelled. The accepted IDs are exactly
MiniMax-M2.7,MiniMax-M2.7-highspeedandMiniMax-M3. Run the/v1/modelscall above to see the list. - 404 or unexpected response. Check the base URL: it must be
https://yiduochan.com/v1, with the/v1suffix and without/chat/completions. - Insufficient balance. Credits are prepaid; top up in the console (minimum $5). The failed request is not charged.
- Cost shows $0.00. The price fields are empty. Enter the input and output prices from the table; the extension does not fetch prices from the endpoint.
- Image or browser tool errors. Image support or computer use is enabled for a text model. Turn both off in the model settings.
If a problem persists after these checks, email [email protected] with the request time and the model ID.
Using Claude Code instead?
If your editor of choice is Claude Code rather than a VS Code extension, the setup is different: it uses the Anthropic-compatible Messages endpoint at /v1/messages, configured with ANTHROPIC_BASE_URL=https://yiduochan.com, ANTHROPIC_AUTH_TOKEN=<API key> and ANTHROPIC_MODEL=MiniMax-M2.7 or MiniMax-M3. The full walkthrough, including the optional ANTHROPIC_DEFAULT_HAIKU_MODEL=MiniMax-M2.7-highspeed setting and the note that count_tokens is not available, is in the Claude Code guide. An overview of every MiniMax model available through YiduoChan is on the MiniMax overview page.
FAQ
Does Cline support MiniMax models?
Yes. Select the OpenAI Compatible provider, set the base URL to https://yiduochan.com/v1, paste your YiduoChan API key and enter MiniMax-M2.7 or MiniMax-M3 as the model ID; no plugin is required.
What model ID do I enter in Roo Code for MiniMax M2.7?
Exactly MiniMax-M2.7. The other accepted IDs are MiniMax-M2.7-highspeed and MiniMax-M3.
What context window should I set for MiniMax-M3 in Cline or Roo Code?
Enter 1048576, the model's published 1M-token context. For MiniMax-M2.7 leave the extension default; the setting only controls when the extension condenses history.
Why does Cline or Roo Code show $0.00 cost for MiniMax?
The price fields are empty; the extensions do not fetch prices from the endpoint. Enter $0.30 input and $1.20 output per 1M tokens for MiniMax-M2.7 and the estimate will track your bill.
Does prompt caching reduce MiniMax costs in Cline and Roo Code?
Cache reads are billed at $0.06 per 1M tokens for MiniMax-M2.7, one fifth of the $0.30 input rate, and the YiduoChan console usage log shows the actual charge for each request.
Can I use MiniMax with Claude Code instead of a VS Code extension?
Yes. Claude Code uses the Anthropic-compatible endpoint with ANTHROPIC_BASE_URL=https://yiduochan.com and ANTHROPIC_MODEL=MiniMax-M2.7; see the Claude Code guide at /minimax/claude-code/.