Microsoft's MAI Code 2 Halves Input Price to $0.50/M Tokens; DeepSeek Kills 18-Day-Old Web Search Fee — How to Reroute Your API Bills
Author: 一缕82年的清风
Positioning: Architect's practical interpretation · Production environment implementation guide
Article overview: Microsoft's new million-context MAI Code 2 is priced at a 50% discount at $0.5, and DeepSeek withdrew its per-use automatic web search fee that had only been charged for 18 days on November 18. This article calculates the detailed costs based on real development workloads, with a 12-line routing configuration.
On Wednesday afternoon I was checking this month's API bill in the backend when two messages that directly affect my wallet popped up on my phone: Microsoft unveiled its self-developed programming model MAI Code 2 at Ignite 2026, cutting the input price by half to $0.50 per million tokens; at almost the same time, DeepSeek issued a notice canceling the per-use fee for the model's automatic web search that it had just started charging on November 1 and had only collected for 18 days.
After calculating the billing details on both sides, I changed the routing for several of my frequently used resident tools that same evening.
Let's first talk about DeepSeek's "web search toll" that only lasted 18 days. Friends who have written real-time retrieval agents recently probably felt the pain when checking their bills at the beginning of the month.
In mid-October, the official launch of the search and fetch APIs with V4.1-Flash-1017 brought a charge of 5 yuan per thousand successful requests from midnight on November 1. At first glance, a single search costs only half a cent, but it's a completely different story when you actually run automated scripts. My server's morning report inspection script often performs three or four searches in a single conversation turn to verify open-source library version numbers, then fetches two or three detail pages. When I pulled the bill after a week, the inference tokens only cost a few cents, but the per-search fees accounted for the bulk, forcing several friends to disable the official web search and switch to using crawlers instead.
Starting from 12:00 noon Beijing time on November 18, this additional fee has been officially withdrawn. Now, any search and web fetch automatically triggered by the server during model dialogue calls—including the official web search tool and the web_search compatible with the Anthropic API and Responses API—are exempt from the per-use fee. The fetched content is merged into the context, and you only pay the basic token charge.
Two billing boundaries to clarify before changing configuration
Don't rush to enable everything blindly; there is a clear boundary here: the exemption from per-use fees applies only to "searches automatically triggered by the server when calling the model." If your RAG service directly calls the underlying standalone Search or Fetch APIs, you will still be charged 5 yuan per thousand successful requests. Additionally, the web page content fetched will be added to the input token billing. If you fetch five or six long documents containing tens of thousands of characters, it will still be expensive. It is safest to limit the single return count to 3 or fewer in the tool parameters.
After talking about retrieval, let's look at Microsoft's newly launched MAI Code 2.
Over the past two weeks, various new flagship models have been released in succession, often with input prices of two or three dollars per million tokens and output prices of over ten dollars per million tokens. Running a full repository refactor can be painful after an afternoon. Microsoft's MAI Code 2, launched simultaneously in GitHub Copilot and Microsoft Foundry, is very practical: a sparse MoE with a native vision encoder, a total context of 1.05 million tokens (922k input, 128k output), and five levels of reasoning adjustment from low to max.
The most striking point is its 50% discount period lasting until 2027-05-17: within six months, input is only $0.50 per million tokens and output is $2.50 per million tokens (after the period ends, prices revert to $1 and $5). The lightweight version MAI Code 2 Flash gives near-instant responses for daily code completion. I tried a 30,000-line backend project for two nights doing cross-file bug checks, and for tasks that account for 80% of the workload, like changing interfaces and supplementing unit tests, the blind-test experience differed very little from GPT-6.2 Sol or Gemini 4 Neon, but the bill was much thinner.
The cost-saving division ledger I'm currently running
Based on my usual monthly usage of about 40 million input tokens, 5 million output tokens, plus a few hundred web searches per day for error checking:
- Previously, I lazily pushed everything to top-tier flagship models priced at $3 to $8 per million tokens. With multi-turn automatic bug-fix retries, monthly bills often ranged from $200 to $350.
- Now I split into three tiers: 80% of daily work—reading repositories, modifying business code, and supplementing unit tests—goes to the discounted
MAI Code 2(a total of only $32.5); real-time documentation retrieval usesDeepSeek V4.1's built-inweb_searchto avoid per-use fees; only the remaining less than 10% of the trickiest concurrency troubleshooting or architecture design is switched to high-reasoning tiers likeClaude Opus 5.5,GPT-6.2 Astra, orGemini 4 Neonas a safety net.
After this split, I can run comfortably with a monthly cost under $40. The following 12-line minimal routing configuration is what I currently use in my small tools:
from openai import OpenAI
def get_client(scene: str):
if scene == "search": # Use the model's built-in web search, exempt from the 5 yuan/thousand standalone API fee
return OpenAI(base_url="https://api.deepseek.com/v1", api_key=DS_KEY)
return OpenAI(base_url=FOUNDRY_MAI_URL, api_key=MAI_KEY) # 50% discount until 2027-05-17
resp = get_client("search").responses.create(
model="deepseek-chat",
tools=[{"type": "web_search", "max_results": 3}], # Limit to 3 results to prevent long pages bloating the context
input="Check the latest version of FastAPI's async dependency changes under Python 3.14",
)
Two details that are easy to overlook: set a reminder in your phone calendar for mid-May next year when Microsoft's discount expires, so you don't accidentally pay the full price; and if your old code is still hard-calling DeepSeek's standalone Search/Fetch APIs, see if you can merge them into the model's built-in web_search tool flow—every little bit helps.
💡 Follow 【一缕82年的清风】 to gain insight into technology fundamentals and ecosystem evolution
Welcome to discuss in the comments, like, and share