← All articles

Migrating Off Bailian-Hosted DeepSeek, GLM, MiniMax, and Moonshot Before the 2026-07-08 Sunset

Aliyun Bailian sunsets a broad wave of third-party-model snapshots on 2026-07-08 — DeepSeek-V3/R1, MiniMax-M2.1, GLM-4.6/4.7, Moonshot Kimi-K2. Concrete replacement matrix, vendor-direct routing through TheRouter, code diffs, and a rollback path.

· TheRouter

Migrating Off Bailian-Hosted DeepSeek, GLM, MiniMax, and Moonshot Before the 2026-07-08 Sunset

On 2026-07-08 Alibaba Cloud Bailian (Model Studio) sunsets a broad set of third-party-model snapshots: DeepSeek-V3 family, DeepSeek-R1 family, MiniMax-M2.1, GLM-4.6, GLM-4.7, Moonshot Kimi-K2-Instruct, kimi-k2-thinking. If you are calling any of these through Bailian's OpenAI-compatible endpoint, you have 28 days to migrate. The Aliyun-recommended replacements are all Qwen models (qwen3.7-max, qwen3-7-plus, qwen3.6-flash). That works if you want to stay on Qwen — but if you specifically chose DeepSeek, GLM, MiniMax, or Moonshot for capability reasons, the cleaner migration is routing-layer drop-in to the vendor-direct API of each model. This guide is the recipe.

We route OpenAI-compatible requests through configured providers and support provider/model routing and fallback where the live product path supports it. We do not claim universal model support, zero downtime, or guaranteed cheapest pricing. Every replacement claim below is verified against the provider's own pricing/docs page at retrieval time.

30-second answer: what's sunsetting and when

  • Sunset date: 2026-07-08 00:00:00 Beijing time (Source: Aliyun Notice 118345, Model Depreciation page, retrieved 2026-06-10).
  • What it affects: Bailian-hosted snapshots of third-party models. Direct vendor APIs (api.deepseek.com, open.bigmodel.cn, platform.kimi.com) are unaffected.
  • What replaces them on Bailian: Qwen3.7/3.6-series — qwen3.7-max, qwen3.7-plus, qwen3.6-flash.
  • What replaces them if you want the same model family: Go vendor-direct. Each affected vendor exposes an OpenAI-compatible API.

Affected model IDs (full table)

From Aliyun Model Depreciation page, the 2026-07-08 wave, third-party section. Retrieved 2026-06-10.

CategoryOld model ID on BailianAliyun-recommended replacement
DeepSeek distilleddeepseek-r1-distill-qwen-7b, deepseek-r1-distill-qwen-14b, deepseek-r1-distill-qwen-32bqwen3.7-plus
DeepSeek V3 familydeepseek-v3, deepseek-v3.1, deepseek-v3.2, deepseek-v3.2-expqwen3.7-plus
DeepSeek R1 familydeepseek-r1, deepseek-r1-0528qwen3.7-plus
MiniMaxMiniMax-M2.1qwen3.7-plus
Zhipu GLMglm-4.7, glm-4.6qwen3.7-plus
MoonshotMoonshot-Kimi-K2-Instruct, kimi-k2-thinkingqwen3.7-plus

Bailian also retires a parallel wave of Qwen open-weight snapshots on the same date (qwen3-8b/14b/30b/32b/235b, qwen3-vl-* family, qwen3-coder-* snapshots). Those are covered by the same qwen3.7-plus / qwen3.6-flash substitution and stay inside the Qwen line — out of scope for this guide.

Why "swap to Qwen" is sometimes the wrong answer

Aliyun's recommendation table replaces every sunsetted third-party model with a Qwen model. That is the lowest-friction migration if the original model was a generic chat workload that happened to land on DeepSeek/GLM/MiniMax/Moonshot. It is the wrong answer when:

  • You picked DeepSeek-V3.2-exp specifically for the long-context coding workload and cache-hit pricing.
  • You picked GLM-4.7 for the Chinese-language-tuned tool-calling.
  • You picked Moonshot Kimi-K2-Instruct for 256K context.
  • You picked MiniMax-M2.1 for the highspeed tier.

In those cases the routing answer is vendor-direct, not vendor-substitution. Each vendor exposes its own OpenAI-compatible base URL.

Replacement matrix: vendor-direct via TheRouter

Bailian-hosted (sunsetting)Vendor-direct via TheRouterProvider page
deepseek-v3, deepseek-v3.1, deepseek-v3.2, deepseek-v3.2-expdeepseek/deepseek-v3.2-exp (and successors deepseek/deepseek-v4-flash, deepseek/deepseek-v4-pro)/providers/deepseek/
deepseek-r1, deepseek-r1-0528deepseek/deepseek-r1 (and thinking-mode of deepseek/deepseek-v4-flash)/providers/deepseek/
glm-4.6, glm-4.7Zhipu GLM via its direct API (base_url=https://open.bigmodel.cn/api/paas/v4)Zhipu direct (TheRouter routing coverage varies — verify on /models/)
Moonshot-Kimi-K2-Instruct, kimi-k2-thinkingmoonshot/kimi-k2.6 (and successor kimi-k2.6 via vendor direct)Moonshot direct (TheRouter routing coverage varies — verify on /models/)
MiniMax-M2.1minimax/minimax-m2.1 (or successor M2.5/M2.7)MiniMax direct

Verify each row at draft-time against TheRouter's live /models/ page before depending on it in production. TheRouter's model availability changes — we add and rotate provider integrations, and any specific model id may be on or off the live request path on any given day.

Code diff: Bailian-hosted → vendor-direct via TheRouter

The diff is two lines per call site. Change the routing prefix and let TheRouter pick the upstream provider. We are not changing your application code, your prompts, or your message format.

Python — DeepSeek-V3 example

# Before: Bailian-hosted deepseek-v3 via DashScope's OpenAI-compatible base
from openai import OpenAI

client = OpenAI(
    base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
    api_key="<DASHSCOPE_KEY>",
)

resp = client.chat.completions.create(
    model="deepseek-v3",
    messages=[{"role": "user", "content": "Hello"}],
)
# After: vendor-direct DeepSeek through TheRouter
from openai import OpenAI

client = OpenAI(
    base_url="https://api.therouter.ai/v1",
    api_key="<THEROUTER_API_KEY>",
)

resp = client.chat.completions.create(
    model="deepseek/deepseek-v3.2-exp",   # or deepseek/deepseek-v4-flash for the latest
    messages=[{"role": "user", "content": "Hello"}],
)

Python — Moonshot Kimi example

# Before
client = OpenAI(
    base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
    api_key="<DASHSCOPE_KEY>",
)
resp = client.chat.completions.create(model="Moonshot-Kimi-K2-Instruct", messages=[...])
# After
client = OpenAI(
    base_url="https://api.therouter.ai/v1",
    api_key="<THEROUTER_API_KEY>",
)
resp = client.chat.completions.create(model="moonshot/kimi-k2.6", messages=[...])

TypeScript — GLM example with fallback chain

import OpenAI from 'openai';

// Route to GLM-direct first, then fall back to DeepSeek if Zhipu is unavailable.
const client = new OpenAI({
  baseURL: 'https://api.therouter.ai/v1',
  apiKey: process.env.THEROUTER_API_KEY,
});

const completion = await client.chat.completions.create({
  model: 'zhipu/glm-4.6',
  // @ts-expect-error extra_body is supported by the OpenAI SDK passthrough
  extra_body: {
    models: ['zhipu/glm-4.6', 'deepseek/deepseek-v3.2-exp'],
  },
  messages: [{ role: 'user', content: 'Summarize this Q3 report.' }],
});

The models array is TheRouter's fallback hint, documented at TheRouter Model Fallbacks, retrieved 2026-06-10. Fallback only fires when the primary route is unavailable; it is not a parallel-call mechanism, and we do not claim it guarantees zero downtime.

Pricing snapshot: Bailian-hosted vs vendor-direct

All prices below are per 1M tokens, retrieved 2026-06-10. They change. Re-check before relying on them for a finance decision.

ModelBailian (Beijing region)Vendor-direct
qwen3.7-plus (Aliyun replacement)¥2 input / ¥8 output (0-256K context tier)n/a (Qwen is Aliyun's own model)
DeepSeek-V4-Flash (vendor-direct, ~successor to V3.2-exp)n/a (sunsetting V3 entirely)$0.14 input cache-miss / $0.0028 cache-hit / $0.28 output
DeepSeek-V4-Pro (vendor-direct)n/a$0.435 input cache-miss / $0.003625 cache-hit / $0.87 output
Moonshot Kimi K2.6 (vendor-direct successor)n/a (Kimi-K2 sunsetting on Bailian)¥6.50 input cache-miss / ¥1.10 cache-hit / ¥27 output

Sources: Aliyun Model Pricing, DeepSeek Pricing, Kimi K2.6 Pricing. All retrieved 2026-06-10.

The cost delta has three components:

  1. Tier change. DeepSeek-V3 on Bailian → DeepSeek-V4-Flash vendor-direct is a model bump, not a like-for-like swap. Expect different output quality and different cost.
  2. Currency / region. Bailian's Chinese-mainland tier is RMB; vendor-direct DeepSeek is USD. Singapore-deployed Bailian is also RMB-quoted but at international rates (Aliyun Model Pricing).
  3. Cache hit. DeepSeek-V4 cache-hit pricing is 50× cheaper than cache-miss. If your workload reuses context (RAG, multi-turn agents), this is the real cost lever.

Gotchas: auth, model-ID mapping, rate limits

  • Different API keys. DashScope/Bailian keys do not work against api.deepseek.com or platform.kimi.com or open.bigmodel.cn. Routing through TheRouter consolidates this to one key, but if you go vendor-direct without TheRouter, you maintain one key per provider.
  • Model ID prefix. TheRouter uses provider/model-name. The Bailian shape deepseek-v3 becomes deepseek/deepseek-v3.2-exp (or deepseek/deepseek-v4-flash). Forgetting the prefix surfaces as a 404.
  • Rate-limit shape differs. Bailian rate limits are documented per region per model in their rate-limit table. DeepSeek direct uses concurrency limits (2500 for V4-Flash, 500 for V4-Pro, per DeepSeek Pricing). If your traffic shape depends on a specific QPS profile, profile both before cutover.
  • Thinking mode is separate. On Bailian, deepseek-r1 and deepseek-r1-0528 are explicit reasoning models. On DeepSeek-V4 direct, thinking is a mode on deepseek-v4-flash/deepseek-v4-pro (see Thinking Mode docs, retrieved 2026-06-10). If your code parses reasoning content out of a separate field, the response shape changes.
  • Provider-specific response fields. Bailian-hosted models pass through DashScope's response shape. Vendor-direct passes through that vendor's response shape. We preserve provider-specific response fields only when verified in docs or code — do not depend on a specific field being present across providers.
  • Singapore / Frankfurt region deployments. If you were calling Bailian's international endpoint specifically for data-residency, vendor-direct DeepSeek and Moonshot are hosted in mainland China — that is a data-residency change. GLM (Zhipu) has international deployments; check open.bigmodel.cn for current region availability.

Rollback path before 2026-07-08

Until the deadline you can run both paths in parallel and roll back instantly. After 2026-07-08 the Bailian-hosted snapshots stop returning results — rollback is no longer possible to that specific snapshot.

Before-deadline rollback checklist:

  1. Keep your original DashScope API key active until 2026-07-08.
  2. Wire your client to read base_url and api_key from an env var (OPENAI_BASE_URL, OPENAI_API_KEY work for the OpenAI SDK).
  3. Run a percentage-based traffic split for 5-7 days. Compare error rate, p95 latency, output quality on a held-out eval set.
  4. If anything fails: flip the env vars back, redeploy. Zero code change.
  5. After confidence is established, retire the DashScope path before 2026-07-08 to avoid a forced cutover under time pressure.

FAQ

Why does Aliyun sunset working models? Are they being deprecated upstream?

Aliyun's notice (118345, retrieved 2026-06-10) is about retiring historical snapshots hosted on Bailian, not about the upstream models. DeepSeek-V3, GLM-4.6, MiniMax-M2.1, and Kimi-K2 continue to exist at each vendor's direct API. Bailian is consolidating its Qwen lineup as the default and reducing its hosted-third-party catalog.

Do I need to migrate if I'm only using Bailian's first-party Qwen models?

No — but the parallel 2026-07-13 wave retires Qwen legacy commercial tiers (qwen-turbo, qwen-vl-max, qwen-coder-plus, qwq-plus, qvq-max). See our separate guide on that sunset wave once published.

Can I keep using Bailian as my routing layer after 2026-07-08?

Yes. Bailian still hosts the Qwen3.7/3.6 series as native first-party models. The aliyun-bailian provider in TheRouter still routes to those. The thing that disappears is Bailian-hosted snapshots of third-party models.

Does TheRouter route to every model in the replacement matrix above?

No. We do not claim universal model support. Each replacement is a candidate — check the live /models/ page to confirm the specific model id is on the live request path before depending on it.

What about the 2026-09-08 sunset wave?

That covers qwen3.6-max-preview, qwen3-max-preview, qwen3-max, qwen3-vl-flash, and qwen3-coder-plus. It's a separate Qwen-tier rotation, replaced by qwen3.7-max / qwen3.6-flash / qwen3.7-plus per Aliyun Notice 118344. Not in scope for this guide.

Where do I learn more about each vendor's direct API?

Sources

Help & contact