MAI Code 2 vs Hy4 flash
Microsoft vs Tencent HunyuanDataset revised
Answer
Hy4 flash costs less per token: $0.07 in and $0.28 out per 1M, against $0.50 in and $2.50 out. MAI Code 2 allows 128,000 output tokens in one response, 2.0x larger than the ceiling of Hy4 flash at 65,536 tokens. Only Hy4 flash publishes weights, so only that one can be self-hosted or audited. No decision turns on context window, inputs, release date.
Within 5% or equal: Context window (1,050,000 tokens and 1,048,576 tokens) · Inputs (Text, Vision, Code) · Release date (2026-11-17 and 2026-11-16)
Where they differ
3 axes with a real gap. The size of each gap is printed under the axis, because a five cent difference and a three times larger ceiling are not the same kind of fact.
| Axis | MAI Code 2 | Hy4 flash |
|---|---|---|
| Max output2.0x larger output ceiling on MAI Code 2 | 128,000 tokens | 65,536 tokens |
| Price, 1M in plus 1M out8.5x cheaper on Hy4 flash | $3.00 | $0.35 |
| Weightsself-hostable: Hy4 flash only | Closed | Open |
Released Nov 17, 2026; Microsoft's frontier agentic coding model with a 1M-token context window, reaching 98% of GPT-6.1 Sol coding quality at 40% of the price and 96% of Claude Opus 5.5 at 5% of the cost; 84.6% on Terminal-Bench 2.1 and 73.2% on DeepSWE 1.1 (max reasoning effort, GitHub Copilot CLI harness, self-reported). The $0.50/$2.50 price is a promotional rate through May 17, 2027; the later rate is $1/$5.
Released Nov 16, 2026 as Tencent's cheapest Hy model, with weights on Hugging Face, ModelScope and GitCode the same day: 220B total parameters including 63.5B of Engram embeddings and 12B active per token, native text and image input, a 1M-token context, and hybrid attention plus LatentMoE that cut the KV cache to a sixth of Hy4. List pricing is $0.07/$0.281 per 1M tokens with cache hits at $0.003, half that on Tencent Cloud TokenHub through Nov 30. Tencent reports WorkIndex 42.1 against 39.7 for Hy4 preview at a twentieth of the cost per task; no independent evaluation exists yet.
Specification
| Field | MAI Code 2 | Hy4 flash |
|---|---|---|
| Context window | 1,050,000 tokens | 1,048,576 tokens |
| Max output | 128,000 tokens | 65,536 tokens |
| Input price / 1M | $0.50 | $0.07 |
| Output price / 1M | $2.50 | $0.28 |
| 1M in + 1M out | $3.00 | $0.35 |
| Weights | Closed (API only) | Open |
| Licence | Microsoft Foundry / Enterprise AI Services Code of Conduct | Tencent Hy License |
| Released | 2026-11-17 | 2026-11-16 |
| Inputs | Text, Vision, Code | Text, Vision, Code |
Benchmarks both laboratories published
Shown side by side only when both records name the same test and the same version.
No benchmark is reported by both laboratories at the same test and version, so no row is shown.
Where MAI Code 2 leads
- Longer single response: 128,000 output tokens vs 65,536 tokens on Hy4 flash.
Where Hy4 flash leads
- Cheaper input: $0.07 vs $0.50 per 1M tokens.
- Open weights under Tencent Hy License: self-hostable and auditable, unlike MAI Code 2.
Common questions
Is MAI Code 2 cheaper than Hy4 flash?
Yes for Hy4 flash. MAI Code 2 lists $0.50 in / $2.50 out per 1M tokens; Hy4 flash lists $0.07 in / $0.28 out. Both are official list prices recorded with a source link.
Which has the larger context window, MAI Code 2 or Hy4 flash?
MAI Code 2 accepts 1,050,000 tokens; Hy4 flash accepts 1,048,576 tokens.
Is MAI Code 2 or Hy4 flash open weights?
Hy4 flash publishes open weights under Tencent Hy License. MAI Code 2 is closed (Microsoft Foundry / Enterprise AI Services Code of Conduct).
When were MAI Code 2 and Hy4 flash released?
MAI Code 2 was released on 2026-11-17 and Hy4 flash on 2026-11-16. MAI Code 2 is the more recent release.
Do MAI Code 2 and Hy4 flash report the same benchmarks?
No. The two records do not publish a score for the same benchmark. Comparing different evaluations would produce a ranking the evidence cannot support.
Related comparisons
Every figure above comes from the primary source on each model page (3 for MAI Code 2, 3 for Hy4 flash). Prices are official list prices per 1M tokens and change without notice. Methodology