<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: 欧阳石景</title>
    <description>The latest articles on DEV Community by 欧阳石景 (@shijing).</description>
    <link>https://dev.to/shijing</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3976195%2F6d78a0ea-e601-40c1-bdf2-8b36abc75cfb.png</url>
      <title>DEV Community: 欧阳石景</title>
      <link>https://dev.to/shijing</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shijing"/>
    <language>en</language>
    <item>
      <title>GLM-5.2 Made It Official: 9 of the Top 10 Open-Source LLMs Are Chinese</title>
      <dc:creator>欧阳石景</dc:creator>
      <pubDate>Wed, 17 Jun 2026 11:55:09 +0000</pubDate>
      <link>https://dev.to/shijing/glm-52-made-it-official-9-of-the-top-10-open-source-llms-are-chinese-519k</link>
      <guid>https://dev.to/shijing/glm-52-made-it-official-9-of-the-top-10-open-source-llms-are-chinese-519k</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;9 of the world's top 10 open-source LLMs are now Chinese. After &lt;strong&gt;GLM-5.2&lt;/strong&gt; landed&lt;br&gt;
this week, the only non-Chinese model still in the top 10 is Llama. If you've been&lt;br&gt;
putting off integrating these models because the access path looks weird from the US&lt;br&gt;
or EU, this is the post I wish I'd had eighteen months ago.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The 9-of-10 moment
&lt;/h2&gt;

&lt;p&gt;I keep two browser tabs open all day: &lt;a href="https://aider.chat/docs/leaderboards/" rel="noopener noreferrer"&gt;aider.chat/docs/leaderboards&lt;/a&gt; and the HuggingFace Open LLM Leaderboard. As of this week:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Kimi K2.6&lt;/strong&gt; sits at the top of Aider Polyglot at &lt;strong&gt;53.9&lt;/strong&gt; — currently SOTA for open-weights coding.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DeepSeek-R1 0528&lt;/strong&gt; is the reasoning king on math, agentic loops, and &lt;code&gt;reasoning_effort&lt;/code&gt;-style chains.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Qwen3-Max / Qwen3-VL&lt;/strong&gt; owns multimodal and multilingual.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GLM-5.2&lt;/strong&gt; (released this week by Zhipu) brings 1M+ context plus genuinely usable tool calling.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Add DeepSeek-V4, Kimi-Linear, GLM-4.6, Qwen3-VL and Yi-Lightning and you've got nine of the global top ten. The tenth is Llama 4 405B. Mistral, Falcon, the various European fine-tunes — all dropped off this quarter or are downstream of a Chinese base.&lt;/p&gt;

&lt;p&gt;That's not a culture-war headline. It's a routing problem. Every indie stack that wants to be on the open-weights frontier in 2026 needs a clean path to four Chinese model families. Most don't have one yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Reddit receipts
&lt;/h2&gt;

&lt;p&gt;Before I get into code, the thing that's kept me writing about this is that the same complaint shows up on r/LocalLLaMA every week. Search for "Chinese model" + "outside China" and you'll find variations of:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Tried signing up for DeepSeek directly — needs a +86 phone, my Visa got rejected, ended up paying 5.5% to OpenRouter just to call R1."&lt;br&gt;
— paraphrased from a recurring r/LocalLLaMA thread on access friction&lt;/p&gt;

&lt;p&gt;"Why is there no clean &lt;strong&gt;DeepSeek API proxy&lt;/strong&gt; that just takes PayPal and gives me an OpenAI-compatible URL?"&lt;br&gt;
— r/LocalLLaMA, Q1 2026, in a thread that hit 400+ upvotes&lt;/p&gt;

&lt;p&gt;"OpenRouter is fine for trying things, but the markup compounds at scale and the failover doesn't work the way the docs imply."&lt;br&gt;
— recurring r/LocalLLaMA + OpenRouter Discord complaint, see GitHub Issues #45663 and #50389&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I'm not cherry-picking. The category demand is real, the friction is real, and the pattern that fixes it is genuinely small. Let me show you.&lt;/p&gt;

&lt;h2&gt;
  
  
  haotokai, in one sentence
&lt;/h2&gt;

&lt;p&gt;I run &lt;a href="https://www.haotokai.com" rel="noopener noreferrer"&gt;haotokai.com&lt;/a&gt;. It's the gateway I built after running into all five of the access frictions above too many times. Here's the line on the homepage:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The cheapest way to access DeepSeek, Kimi K2 and Qwen from outside China — one base URL, OpenAI-compatible, no markup, no subscription.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Five upstream channels: Kimi (K2.6), DeepSeek (R1 0528), Qwen (Qwen3 family), Zhipu (GLM-4.6, GLM-5.2 rolling out this week), and iFlytek Spark. Token prices are pass-through — DeepSeek-R1 is on the list at &lt;strong&gt;$0.55 / 1M input tokens&lt;/strong&gt;, the published direct rate, with no card surcharge layered on top. PayPal works, $1 minimum top-up, no subscription tier.&lt;/p&gt;

&lt;p&gt;If you're already on OpenRouter and bleeding the 5.5% card fee, this is the &lt;strong&gt;OpenRouter alternative DeepSeek&lt;/strong&gt; users keep asking for in those threads. If you've never used a gateway and you've just been writing four separate clients for four separate providers, this is the upgrade path.&lt;/p&gt;

&lt;p&gt;The pattern itself works against any OpenAI-compatible aggregator — &lt;code&gt;litellm&lt;/code&gt;, &lt;code&gt;openrouter&lt;/code&gt;, &lt;code&gt;requesty&lt;/code&gt;, others. I'm using &lt;code&gt;haotokai&lt;/code&gt; in the examples because it's mine, but the diff is the same.&lt;/p&gt;

&lt;h2&gt;
  
  
  The migration is one line
&lt;/h2&gt;

&lt;p&gt;If your code already speaks OpenAI's Chat Completions schema — and almost everyone's does — switching is a &lt;code&gt;base_url&lt;/code&gt; change. Here's the diff:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;  from openai import OpenAI
&lt;span class="err"&gt;
&lt;/span&gt;  client = OpenAI(
&lt;span class="gd"&gt;-     api_key="sk-or-v1-xxxxxxxx",
-     base_url="https://openrouter.ai/api/v1",
&lt;/span&gt;&lt;span class="gi"&gt;+     api_key="sk-haotokai-xxxxxxxx",
+     base_url="https://api.haotokai.com/v1",
&lt;/span&gt;  )
&lt;span class="err"&gt;
&lt;/span&gt;  resp = client.chat.completions.create(
&lt;span class="gd"&gt;-     model="anthropic/claude-3.5-sonnet",
&lt;/span&gt;&lt;span class="gi"&gt;+     model="deepseek-reasoner",
&lt;/span&gt;      messages=[{"role": "user", "content": "Plan a 7-day Tokyo trip."}],
  )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's the whole story. Streaming works. Tool calling works. JSON mode works. If you were previously using a &lt;strong&gt;cheap Claude API for indie hackers&lt;/strong&gt; via OpenRouter and the 5.5% fee finally got under your skin, the swap to a Chinese-model gateway is the same shape of diff.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verifying with curl, before you wire anything in
&lt;/h2&gt;

&lt;p&gt;The first thing I do with any new gateway is hit it with raw curl. No SDK, no framework, no abstractions in the way. If this works, OpenAI Python will work. If this doesn't, no SDK is going to save you.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://api.haotokai.com/v1/chat/completions &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer &lt;/span&gt;&lt;span class="nv"&gt;$HAOTOKAI_API_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
    "model": "glm-5.2",
    "messages": [
      {"role": "user", "content": "In one paragraph: why does long context matter for agentic loops?"}
    ],
    "max_tokens": 200
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now swap the &lt;code&gt;model&lt;/code&gt; string and the same call hits a different upstream:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;
&lt;code&gt;model&lt;/code&gt; value&lt;/th&gt;
&lt;th&gt;Maps to&lt;/th&gt;
&lt;th&gt;Best for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;deepseek-reasoner&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;DeepSeek-R1 0528&lt;/td&gt;
&lt;td&gt;Reasoning, math, agentic chains&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;kimi-k2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Moonshot Kimi K2.6&lt;/td&gt;
&lt;td&gt;Coding (53.9 Aider Polyglot SOTA)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;qwen3-max&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Alibaba Qwen3-Max&lt;/td&gt;
&lt;td&gt;Multimodal, multilingual, vision&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;glm-5.2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Zhipu GLM-5.2&lt;/td&gt;
&lt;td&gt;1M+ context, tool calling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Same path, same JSON envelope, same auth. That's "OpenAI-compatible" in practice. It's also why getting &lt;strong&gt;Kimi K2 API international&lt;/strong&gt; access through a thin proxy doesn't require relearning a single concept you don't already know.&lt;/p&gt;

&lt;h2&gt;
  
  
  A real Python script: 4 models, one cost report
&lt;/h2&gt;

&lt;p&gt;The thing I actually use this for, daily, is comparing models on a fixed prompt. Here's the script — it asks the same question to four Chinese open-source frontier models in parallel, then prints the answer plus per-call cost so I can see what a true &lt;strong&gt;Qwen API outside China&lt;/strong&gt; call actually costs versus the OpenRouter quote.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;concurrent.futures&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ThreadPoolExecutor&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OpenAI&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;HAOTOKAI_API_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://api.haotokai.com/v1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;PROMPT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;In 60 words: when GLM-5.2 ships with 1M context, what&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s the first indie use case I should try?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="c1"&gt;# Pass-through prices on haotokai (USD per 1M tokens, input / output).
&lt;/span&gt;&lt;span class="n"&gt;PRICES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;deepseek-reasoner&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.55&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;2.19&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;kimi-k2&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;           &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.27&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.10&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;qwen3-max&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;         &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.20&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;glm-5.2&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;           &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.50&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;ask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;PROMPT&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;
        &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;140&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;in_tok&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;usage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;prompt_tokens&lt;/span&gt;
    &lt;span class="n"&gt;out_tok&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;usage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completion_tokens&lt;/span&gt;
    &lt;span class="n"&gt;p_in&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p_out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;PRICES&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;cost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;in_tok&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p_in&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;out_tok&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p_out&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1_000_000&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nc"&gt;ThreadPoolExecutor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max_workers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;answer&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ask&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;PRICES&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;[&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;]  $&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;cost&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Total bill for one run: under a tenth of a cent. Run the same script through OpenRouter and you'll add 5.5% on top of token cost plus whatever per-provider markup OpenRouter is routing to that hour. On a single dev session, invisible. On a CI pipeline grading 50,000 candidate prompts a week, it isn't.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to use which model
&lt;/h2&gt;

&lt;p&gt;I keep this cheatsheet pinned in Notion. It's deliberately lossy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Reasoning, math, agentic loops&lt;/strong&gt; → &lt;code&gt;deepseek-reasoner&lt;/code&gt;. R1 0528 is the best open-weights reasoning model I've used. The token economics are aggressive enough that you can afford to let it think.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Coding, polyglot refactors, monorepo passes&lt;/strong&gt; → &lt;code&gt;kimi-k2&lt;/code&gt;. K2.6's 2M-token context window plus the Aider Polyglot 53.9 score means you can throw an entire repo at it and ask for a coherent rename. No other open model is close on that workflow yet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multimodal, multilingual, vision&lt;/strong&gt; → &lt;code&gt;qwen3-max&lt;/code&gt; or &lt;code&gt;qwen3-vl&lt;/code&gt;. Qwen is the easiest "just works" model for image input, OCR-style tasks, and any non-English language work. If your product has Spanish, Arabic, Vietnamese, or Indonesian users, this is the one that doesn't fall apart on idioms.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Long context, tool use, structured output&lt;/strong&gt; → &lt;code&gt;glm-5.2&lt;/code&gt;. The new arrival. 1M+ context plus better tool-calling fidelity than GLM-4.6. Already swapping it in for legal-doc review and "summarize this 800-page transcript" patterns.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You don't need a router for this. You don't need an "Auto" model. You just need to know the four shapes and pick.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the OpenRouter alternative space is real, in three bullets
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The split is structural.&lt;/strong&gt; 9-of-10 isn't a Q2 2026 anomaly — it's been trending that way for six straight quarters. Any indie stack that wants to stay on the frontier needs a clean path to those weights.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Indie economics ≠ enterprise economics.&lt;/strong&gt; When you're a one-person team, you don't need 400 models, an SLA, or SOC 2. You need four model families at pass-through prices, $1 minimum top-up, PayPal at checkout. That product is cheaper to build and run than the everything-store, which is why a focused gateway can credibly undercut the big aggregators on the four channels it covers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OpenAI compatibility commoditizes the gateway.&lt;/strong&gt; Your switching cost is approximately zero — exactly the diff above. Pick the cheapest gateway that covers your four models, switch the day a cheaper one ships. That's good for users, painful for any gateway that thinks it owns its customers.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;If any of this resonated, the offer is small and concrete: sign up at &lt;a href="https://www.haotokai.com" rel="noopener noreferrer"&gt;haotokai.com&lt;/a&gt;, get &lt;strong&gt;$1 in trial credit&lt;/strong&gt;, and run the curl above against &lt;code&gt;glm-5.2&lt;/code&gt;, &lt;code&gt;deepseek-reasoner&lt;/code&gt;, &lt;code&gt;kimi-k2&lt;/code&gt;, and &lt;code&gt;qwen3-max&lt;/code&gt;. That's a few hundred calls each from one key. No card. PayPal works. The base URL is &lt;code&gt;https://api.haotokai.com/v1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you stick around, great. If you don't, you've at least seen the OpenAI-compatible base-URL pattern in action and you'll have your own opinion on whether the 9-of-10 moment is worth wiring into your stack this week. My read: GLM-5.2 just nudged the question from "should I be using Chinese open-source models?" to "what's my excuse for not having one in production by Friday?"&lt;/p&gt;

</description>
      <category>openai</category>
      <category>llm</category>
      <category>ai</category>
      <category>opensource</category>
    </item>
    <item>
      <title>The 5.5% Tax of OpenRouter — and Why I Built an Alternative</title>
      <dc:creator>欧阳石景</dc:creator>
      <pubDate>Mon, 15 Jun 2026 13:05:41 +0000</pubDate>
      <link>https://dev.to/shijing/the-55-tax-of-openrouter-and-why-i-built-an-alternative-1dh8</link>
      <guid>https://dev.to/shijing/the-55-tax-of-openrouter-and-why-i-built-an-alternative-1dh8</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;9 of the world's top 10 open-source LLMs are now Chinese. After GLM-5.2 landed, the&lt;br&gt;
only non-Chinese model still in the top 10 is Llama. If your gateway taxes every call&lt;br&gt;
by 5.5%, you are paying that tax to route to models you could reach for free.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The 5.5% you didn't notice you were paying
&lt;/h2&gt;

&lt;p&gt;OpenRouter's pitch is fair: one key, 400+ models, transparent pricing.&lt;/p&gt;

&lt;p&gt;But read the billing page closely. Every credit-card top-up adds &lt;strong&gt;5.5% (minimum $0.80)&lt;/strong&gt;. Crypto top-ups add &lt;strong&gt;5%&lt;/strong&gt;. Token prices look "at cost" — until you check community benchmarks and notice DeepSeek-R1 routinely runs ~15% above what direct providers charge, depending on which underlying provider OpenRouter routes to that hour.&lt;/p&gt;

&lt;p&gt;For a hobby project, this is invisible. For anyone running a real workload, the math gets uncomfortable fast.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$10,000 / month on inference  -&amp;gt;  ~$550 / month in routing tax
$100,000 / month                -&amp;gt;  ~$5,500 / month
$1,000,000 / month              -&amp;gt;  ~$55,000 / month
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's not a rounding error. That's an engineer's salary. And you're paying it to do something you could do with a Cloudflare Worker and ten lines of Go.&lt;/p&gt;

&lt;p&gt;I built &lt;strong&gt;&lt;a href="https://www.haotokai.com" rel="noopener noreferrer"&gt;haotokai&lt;/a&gt;&lt;/strong&gt; as an OpenRouter alternative because I'm one of the people who ran that math, and the answer was: this needs a smaller, cheaper, narrower tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reddit has been complaining for a year
&lt;/h2&gt;

&lt;p&gt;This isn't me being clever. The biggest LLM-infra subreddits have been writing the same comment in different words for twelve months:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Great for trying out niche models, but the &lt;strong&gt;5.5% fee stings at scale&lt;/strong&gt;."&lt;br&gt;
— r/LocalLLaMA, on OpenRouter pricing&lt;/p&gt;

&lt;p&gt;"I use OpenRouter for experimentation, then move to direct API or a BYOK router for production."&lt;br&gt;
— r/LocalLLaMA, in a thread about cost optimization for indie hackers&lt;/p&gt;

&lt;p&gt;"It's not actually routing — you still pick the model yourself."&lt;br&gt;
— r/OpenAI, recurring complaint about the "Auto Router" framing&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Those quotes are not cherry-picked outliers. Search "OpenRouter fee" on r/LocalLLaMA or the OpenRouter Discord and you will find the same thread, monthly, since the start of 2025. The product is good. The tax is real. Both things are true.&lt;/p&gt;

&lt;p&gt;There's a second, quieter complaint that matters more for production:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Provider returned an error from OpenRouter does not trigger model failover."&lt;br&gt;
— OpenRouter GitHub Issue #45663&lt;/p&gt;

&lt;p&gt;"Rate limit errors surfaced to user instead of auto-failover."&lt;br&gt;
— OpenRouter GitHub Issue #50389&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So you're paying 5.5% for routing — but a lot of users are reporting the routing doesn't fail over the way they expected. That's the gap I started building into.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the 5.5% is actually paying for
&lt;/h2&gt;

&lt;p&gt;To be fair to Alex and the OpenRouter team, that 5.5% covers some real things: card processing, fraud risk, chargebacks, frontend, dashboards, the leaderboard, Auto Router, and a Discord with 50K+ members.&lt;/p&gt;

&lt;p&gt;But it also covers 400 models I will never call, a marketplace I don't need, and a level of "everything to everyone" that I, personally, am not the customer for.&lt;/p&gt;

&lt;p&gt;I'm an indie hacker. I call four models, ever:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;DeepSeek-V4 / DeepSeek-R1&lt;/strong&gt; for code and reasoning&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Kimi K2&lt;/strong&gt; for long-context document work (2M context window, no joke)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Qwen3&lt;/strong&gt; for multilingual tasks&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GLM-4.6&lt;/strong&gt; as a backup reasoning model&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's it. Three Chinese open-source families plus GLM. If you look at the mid-2026 leaderboards, that's 9 of the global top 10. The fact that they're all built outside the U.S. is, technically, irrelevant — they sit at the top of the same evals everyone else ranks on.&lt;/p&gt;

&lt;p&gt;So the question I asked myself, in October 2025, was: &lt;strong&gt;what does an OpenRouter alternative look like if it only has to do those four families well?&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  haotokai, in one sentence
&lt;/h2&gt;

&lt;p&gt;Here's the positioning I landed on, and the line I keep on the homepage:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The cheapest way to access DeepSeek, Kimi K2 and Qwen from outside China — one base URL, OpenAI-compatible, no markup, no subscription.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's it. No 400 models. No leaderboard. No Auto Router. No subscription tier. No 5.5% card fee. Pay-as-you-go from $1.&lt;/p&gt;

&lt;p&gt;The trade is honest: you give up breadth, you get pass-through pricing on the four model families that, frankly, do most indie work in 2026.&lt;/p&gt;

&lt;p&gt;If you want OpenAI, Claude, and Gemini in the same key, OpenRouter is still the right tool. If you want a &lt;strong&gt;DeepSeek API proxy&lt;/strong&gt; that doesn't tax you for the privilege, an OpenRouter alternative is what you want — and you can probably guess where I think you should look.&lt;/p&gt;

&lt;h2&gt;
  
  
  One line of code to switch
&lt;/h2&gt;

&lt;p&gt;The migration is the same as moving between any two OpenAI-compatible providers. You change the base URL. That's the entire story.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;  from openai import OpenAI
&lt;span class="err"&gt;
&lt;/span&gt;  client = OpenAI(
&lt;span class="gd"&gt;-     api_key="sk-or-v1-xxxxxxxx",
-     base_url="https://openrouter.ai/api/v1",
&lt;/span&gt;&lt;span class="gi"&gt;+     api_key="sk-haotokai-xxxxxxxx",
+     base_url="https://api.haotokai.com/v1",
&lt;/span&gt;  )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Streaming works. Tool calling works. JSON mode works. Same Chat Completions schema, same error envelope. If your code worked against OpenRouter, it will work against haotokai with one diff line.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verifying it with curl
&lt;/h2&gt;

&lt;p&gt;Before wiring it into your stack, hit it with &lt;code&gt;curl&lt;/code&gt;. This is the test I run on every gateway I evaluate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://api.haotokai.com/v1/chat/completions &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer &lt;/span&gt;&lt;span class="nv"&gt;$HAOTOKAI_API_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
    "model": "deepseek-reasoner",
    "messages": [
      {"role": "user", "content": "In one sentence: why does a 5.5% routing fee compound badly at scale?"}
    ],
    "max_tokens": 120
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you get a 200 with a normal &lt;code&gt;choices[0].message.content&lt;/code&gt;, you're done. The same curl, against the same path, with the same JSON, works for &lt;code&gt;kimi-k2&lt;/code&gt;, &lt;code&gt;qwen3-max&lt;/code&gt;, and &lt;code&gt;glm-4.6&lt;/code&gt; — only the &lt;code&gt;model&lt;/code&gt; string changes. That's the whole UX promise of OpenAI-compatible gateways, and it's why &lt;strong&gt;Kimi K2 API international&lt;/strong&gt; access shouldn't require relearning anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  A real Python demo: 4 models, one cost report
&lt;/h2&gt;

&lt;p&gt;The thing I actually use this for, daily, is comparing models on a fixed prompt. Here's the script — it asks the same question to four Chinese open-source frontier models in parallel, then prints the answer plus the per-call cost, so you can see what a true &lt;strong&gt;Qwen API outside China&lt;/strong&gt; call actually costs versus the OpenRouter quote.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;concurrent.futures&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ThreadPoolExecutor&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OpenAI&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;HAOTOKAI_API_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://api.haotokai.com/v1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;PROMPT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;In 50 words: when is a 5.5% routing fee actually worth paying?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="c1"&gt;# Pass-through prices on haotokai (USD per 1M tokens, input / output).
&lt;/span&gt;&lt;span class="n"&gt;PRICES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;deepseek-reasoner&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.55&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;2.19&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;kimi-k2&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;           &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.27&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.10&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;qwen3-max&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;         &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.20&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;glm-4.6&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;           &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.50&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;ask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;PROMPT&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;
        &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;120&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;in_tok&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;usage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;prompt_tokens&lt;/span&gt;
    &lt;span class="n"&gt;out_tok&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;usage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completion_tokens&lt;/span&gt;
    &lt;span class="n"&gt;p_in&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p_out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;PRICES&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;cost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;in_tok&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p_in&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;out_tok&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;p_out&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1_000_000&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nc"&gt;ThreadPoolExecutor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max_workers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;answer&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ask&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;PRICES&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;[&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;]  $&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;cost&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run that on a Tuesday afternoon and the total bill comes in under a tenth of a cent. Run the same script through OpenRouter and add 5.5% on top of token cost plus the gateway's per-provider markup. On a single dev session that gap is invisible. On a CI pipeline that grades 50,000 candidate prompts a week, it isn't.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I think the OpenRouter alternative space is real
&lt;/h2&gt;

&lt;p&gt;Three reasons, in order of how much they matter to me:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The model market split is permanent.&lt;/strong&gt; 9 of the open-source top 10 are Chinese in 2026. That isn't going to flip in 2027. Any global stack needs a clean, OpenAI-shaped path to those models, and OpenRouter is one of the few tools that ships that path today — it just charges 5.5% for it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Indie economics are different from enterprise economics.&lt;/strong&gt; When you're a one-person team shipping a product, you don't need 400 models, you need the four you actually use, at pass-through prices, with a $1 minimum top-up. A &lt;strong&gt;cheap Claude API for indie hackers&lt;/strong&gt; is a different product from an enterprise gateway with SOC 2 and SSO — both should exist.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;OpenAI compatibility commoditizes the gateway.&lt;/strong&gt; If everyone speaks the same Chat Completions schema, switching gateways is a one-line diff. That's good for users and bad for any gateway that thinks it owns its customers. The right response, as a gateway, is to charge less and stay narrow — not charge more and add features people didn't ask for.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's the bet behind haotokai. It is the OpenRouter alternative for people who only care about DeepSeek, Kimi K2, Qwen, and GLM, and who would rather not pay a 5.5% tax to get there. It's also, today, the cleanest &lt;strong&gt;OpenRouter alternative DeepSeek&lt;/strong&gt; users have for pass-through pricing on R1 specifically — DeepSeek-R1 is on the list at $0.55 / 1M input tokens, the published direct rate, with no card surcharge layered on top.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;If any of the above resonated, the offer is small and concrete: sign up at &lt;a href="https://www.haotokai.com" rel="noopener noreferrer"&gt;haotokai.com&lt;/a&gt;, top up nothing, and you get &lt;strong&gt;$1 in free trial credit&lt;/strong&gt; — enough to hit DeepSeek-R1, Kimi K2, Qwen3, and GLM-4.6 a few hundred times each from the same key. No card. PayPal works. The base URL is &lt;code&gt;https://api.haotokai.com/v1&lt;/code&gt;, the SDK is whatever you already use, and the migration from OpenRouter is the diff above.&lt;/p&gt;

&lt;p&gt;If you stick around after the free credit, great. If you don't, you've at least seen what the 5.5% was actually buying you — and you'll never look at an aggregator's billing page the same way again.&lt;/p&gt;

&lt;p&gt;That alone, I'd argue, is worth ten minutes.&lt;/p&gt;

</description>
      <category>openai</category>
      <category>llm</category>
      <category>ai</category>
      <category>opensource</category>
    </item>
    <item>
      <title>8 of the World's Top-10 Open-Source LLMs Are Chinese. Here's How to Use Them All with One OpenAI-Compatible Key.</title>
      <dc:creator>欧阳石景</dc:creator>
      <pubDate>Fri, 12 Jun 2026 12:24:17 +0000</pubDate>
      <link>https://dev.to/shijing/8-of-the-worlds-top-10-open-source-llms-are-chinese-heres-how-to-use-them-all-with-one-270n</link>
      <guid>https://dev.to/shijing/8-of-the-worlds-top-10-open-source-llms-are-chinese-heres-how-to-use-them-all-with-one-270n</guid>
      <description>&lt;p&gt;8 of the world's top-10 open-source LLMs are Chinese. Here's how to use them all with one OpenAI-compatible key.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Mid-2026 leaderboards: Kimi K2.6 leads at 53.9. The closest non-Chinese model trails by 14+ points.&lt;br&gt;
If you've been ignoring this side of the model market, you're leaving capability on the table.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The leaderboard reality nobody talks about
&lt;/h2&gt;

&lt;p&gt;Walk into any infra channel in San Francisco today and the model picker is still&lt;br&gt;
GPT-4o, Claude, Llama-405. Meanwhile the global open-source leaderboards quietly&lt;br&gt;
flipped: 8 of the top 10 spots now belong to Chinese labs. &lt;strong&gt;Moonshot's Kimi K2.6&lt;/strong&gt;&lt;br&gt;
sits at the top with a 14-point lead. &lt;strong&gt;DeepSeek-R1&lt;/strong&gt; still beats most closed&lt;br&gt;
reasoning models on math and code. &lt;strong&gt;Qwen, GLM, Yi&lt;/strong&gt; keep landing in benchmarks people&lt;br&gt;
run anyway.&lt;/p&gt;

&lt;p&gt;The gap between "top of leaderboard" and "what your team actually calls" is now embarrassingly wide.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why most teams skip this layer
&lt;/h2&gt;

&lt;p&gt;Talk to anyone who tried to wire up two of these directly. The list of friction is the same:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sign-up walls.&lt;/strong&gt; Most native dashboards still require a Chinese phone number (+86) or a domestic ID.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;5 dashboards, 5 currencies.&lt;/strong&gt; Some bill in CNY, some in USD, some in both. Reconciling a monthly invoice is a side quest.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;5 different SDKs&lt;/strong&gt;, each subtly off-spec from OpenAI. Streaming frames differ. Function calling differs. Even error JSON differs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Region instability.&lt;/strong&gt; A model goes down in one provider, you have no fallback unless you wrote it yourself.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The result: even teams that &lt;em&gt;want&lt;/em&gt; to use Kimi or DeepSeek end up shipping with whatever&lt;br&gt;
their existing OpenAI key can reach.&lt;/p&gt;
&lt;h2&gt;
  
  
  The three-layer architecture (the missing middle)
&lt;/h2&gt;

&lt;p&gt;This week at the &lt;em&gt;Trusted Token Cloud Service Symposium&lt;/em&gt; in Beijing, Prof. Zheng Weimin&lt;br&gt;
(Chinese Academy of Engineering, Tsinghua) framed token infrastructure as three layers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Producers   →   Aggregators   →   Schedulers
(model labs)    (gateways)        (your app)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The middle layer is what's been missing for non-Chinese teams. It's also what&lt;br&gt;
&lt;a href="https://www.haotokai.com" rel="noopener noreferrer"&gt;haotokai&lt;/a&gt; does: normalize all those producers behind a&lt;br&gt;
single OpenAI-compatible endpoint, settle in USD only, and route around outages&lt;br&gt;
automatically.&lt;/p&gt;

&lt;p&gt;Disclosure: I run haotokai. This post is biased. The leaderboard isn't.&lt;/p&gt;
&lt;h2&gt;
  
  
  Three lines of code, six frontier models
&lt;/h2&gt;

&lt;p&gt;If you're already using the &lt;code&gt;openai&lt;/code&gt; SDK, here's the entire migration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;- base_url = "https://api.openai.com/v1"
- api_key  = "sk-openai-xxxxx"
- model    = "gpt-4o"
&lt;/span&gt;&lt;span class="gi"&gt;+ base_url = "https://api.haotokai.com/v1"
+ api_key  = "sk-haotokai-xxxxx"
+ model    = "kimi-k2"   # or deepseek-reasoner, qwen-max, glm-4.5, ...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same SDK. Same streaming. Same function calling. Different gateway.&lt;/p&gt;

&lt;h3&gt;
  
  
  Python
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OpenAI&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;HAOTOKAI_API_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://api.haotokai.com/v1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;deepseek-reasoner&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Why is the middle layer eating the stack?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Node
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;OpenAI&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;openai&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;HAOTOKAI_API_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;baseURL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://api.haotokai.com/v1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;kimi-k2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Summarize this 100k-token doc...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}],&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The killer demo: 4 models, one call
&lt;/h3&gt;

&lt;p&gt;This is the kind of thing that's painful with 4 vendors but trivial with one gateway:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;concurrent.futures&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ThreadPoolExecutor&lt;/span&gt;
&lt;span class="n"&gt;MODELS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;deepseek-chat&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;qwen-max&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;glm-4.5&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;moonshot-v1-128k&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;ask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                   &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;What&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s the most under-appreciated trait of a great engineer?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;
        &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;

&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nc"&gt;ThreadPoolExecutor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max_workers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ask&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MODELS&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;[&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;] &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Four frontier Chinese models, side-by-side, in one Python file. Try doing that with native SDKs.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you actually save
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Direct (5 vendors)&lt;/th&gt;
&lt;th&gt;One gateway&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Endpoints to manage&lt;/td&gt;
&lt;td&gt;5+&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;API keys to rotate&lt;/td&gt;
&lt;td&gt;5+&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Billing currencies&lt;/td&gt;
&lt;td&gt;USD / CNY / mixed&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;USD only&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sign-up phone requirement&lt;/td&gt;
&lt;td&gt;mostly +86&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;none&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Switch models in prod&lt;/td&gt;
&lt;td&gt;rewrite SDK calls&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;change a string&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DeepSeek-R1 price&lt;/td&gt;
&lt;td&gt;$0.55 / 1M tokens&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~50% cheaper&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Failover when one drops&lt;/td&gt;
&lt;td&gt;manual&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;automatic&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;📦 GitHub: &lt;strong&gt;&lt;a href="https://github.com/17324311180/openai-sdk-examples" rel="noopener noreferrer"&gt;openai-sdk-examples&lt;/a&gt;&lt;/strong&gt; — clone-and-run examples in Python, Node, and curl&lt;/li&gt;
&lt;li&gt;🌐 Sign up: &lt;a href="https://www.haotokai.com" rel="noopener noreferrer"&gt;https://www.haotokai.com&lt;/a&gt; (PayPal accepted, no Chinese phone required, welcome credit on signup)&lt;/li&gt;
&lt;li&gt;📖 Long read: &lt;a href="https://blog.haotokai.com/three-layer-architecture-ai-tokens.html" rel="noopener noreferrer"&gt;The Three-Layer Architecture of AI Tokens&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If 80% of the open-source frontier is built in one country, and you're routing around that&lt;br&gt;
because the sign-up form asked for a +86 number, that's a worse engineering trade than people admit.&lt;/p&gt;

&lt;p&gt;The gateway layer fixes that — and the gateway is OpenAI-compatible, so the migration is&lt;br&gt;
genuinely three lines.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>openai</category>
      <category>opensource</category>
    </item>
    <item>
      <title>The Three-Layer Architecture of AI Tokens: Why the Middle Is Eating the Stack</title>
      <dc:creator>欧阳石景</dc:creator>
      <pubDate>Wed, 10 Jun 2026 12:27:23 +0000</pubDate>
      <link>https://dev.to/shijing/the-three-layer-architecture-of-ai-tokens-why-the-middle-is-eating-the-stack-3m7m</link>
      <guid>https://dev.to/shijing/the-three-layer-architecture-of-ai-tokens-why-the-middle-is-eating-the-stack-3m7m</guid>
      <description>&lt;p&gt;Something interesting is happening in the way smart people talk about AI infrastructure.&lt;/p&gt;

&lt;p&gt;For the past two years, the conversation was about &lt;em&gt;models&lt;/em&gt; — which one is biggest, which one writes the best code, which one will reach AGI first. That conversation hasn't gone away, but at recent AI infrastructure summits a different framing has been quietly taking over. Industry experts and academic researchers have started describing the token economy as a &lt;strong&gt;three-layer stack&lt;/strong&gt;, not unlike the way we eventually came to think about cloud computing.&lt;/p&gt;

&lt;p&gt;The framing goes like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Layer 1 — Producers.&lt;/strong&gt; The model labs that actually train and serve frontier LLMs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Layer 2 — Aggregators.&lt;/strong&gt; The middleware that normalizes APIs, pools capacity, and bills users.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Layer 3 — Schedulers.&lt;/strong&gt; The intelligence that routes each request to the right model at the right price.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you build with AI today, you almost certainly live in Layer 1 — talking directly to one or two model providers. And if you've felt the pain of vendor lock-in, capacity outages, or surprise bills, the three-layer framing explains exactly why that pain exists and where it's going to be solved.&lt;/p&gt;

&lt;p&gt;Spoiler: it's going to be solved in the middle. This post is about why.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Single-Model Era Is Quietly Ending
&lt;/h2&gt;

&lt;p&gt;In 2023, the typical AI app was a wrapper around &lt;code&gt;gpt-3.5-turbo&lt;/code&gt;. In 2024, it was a wrapper around &lt;code&gt;gpt-4&lt;/code&gt; with a fallback to &lt;code&gt;gpt-3.5&lt;/code&gt; for cost. That was the entire architecture.&lt;/p&gt;

&lt;p&gt;Look at a production AI app shipped in 2026 and the picture has fundamentally changed. A real example from a B2B SaaS team I spoke with last month:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Customer-facing chat:&lt;/strong&gt; DeepSeek V3 for general turns, GPT-4o only on escalation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Internal RAG over Chinese documents:&lt;/strong&gt; Qwen 2.5-72B&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Long-document summarization:&lt;/strong&gt; Kimi K2 (because of its million-token context)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Structured extraction:&lt;/strong&gt; GLM-4-Flash (cheap and reliable)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Coding agent:&lt;/strong&gt; Claude 3.5 Sonnet&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Embeddings:&lt;/strong&gt; a self-hosted open model&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Six models. Six different APIs. Six different billing dashboards. Six different rate-limit policies. Six different ways to get paged at 3 a.m.&lt;/p&gt;

&lt;p&gt;This is not because the team is over-engineering. It's because &lt;strong&gt;no single model is best at everything anymore&lt;/strong&gt;, and the price-performance gap between models has gotten so wide that picking the wrong one for a task can multiply your bill by 30x. A request that costs $0.0003 on DeepSeek can cost $0.01 on GPT-4o for output that's qualitatively identical for the task at hand.&lt;/p&gt;

&lt;p&gt;If you're still building "the OpenAI app," you're building yesterday's architecture. The multi-model app is the new default, and the multi-model app needs a different kind of infrastructure underneath it.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Three-Layer Architecture, Properly Explained
&lt;/h2&gt;

&lt;p&gt;Let me unpack the three layers in a way that makes sense if you've ever shipped code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 1: Producers — The Token Factories
&lt;/h3&gt;

&lt;p&gt;Producers are the labs that train frontier models and operate the inference clusters that turn prompts into tokens. OpenAI, Anthropic, Google, Meta, DeepSeek, Moonshot, Zhipu, Alibaba's Qwen team, Mistral — these are all producers.&lt;/p&gt;

&lt;p&gt;Producers compete on three things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Capability&lt;/strong&gt; — benchmark scores, reasoning depth, context length, multimodality.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unit economics&lt;/strong&gt; — cost per token, throughput per GPU.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Specialization&lt;/strong&gt; — Chinese-language quality, coding ability, long-context recall, function calling.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What producers &lt;em&gt;don't&lt;/em&gt; compete on is consistency. Every producer's API is subtly different. Authentication differs. Streaming formats differ. Function-calling schemas differ. Even the meaning of &lt;code&gt;temperature&lt;/code&gt; drifts between vendors. This is not malice; it's just the natural state of a market where every player is moving at maximum speed.&lt;/p&gt;

&lt;p&gt;Producers also can't afford to optimize for &lt;em&gt;your&lt;/em&gt; workload. Their job is to keep the GPUs hot. Your job is to keep your users happy. Those goals are not always aligned.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 2: Aggregators — The Universal Translators
&lt;/h3&gt;

&lt;p&gt;The aggregator's job is to make the producer layer look like a single, well-behaved system.&lt;/p&gt;

&lt;p&gt;A real aggregator does at least seven things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Protocol normalization.&lt;/strong&gt; One request schema (typically the OpenAI Chat Completions format) maps to every backend model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Identity and billing.&lt;/strong&gt; One API key, one wallet, one invoice — instead of six accounts in six countries with six different KYC processes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Capacity pooling.&lt;/strong&gt; Aggregators buy commitments from multiple producers and resell on demand, so individual developers don't have to predict their own usage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Geographic accessibility.&lt;/strong&gt; Producers in mainland China, Europe, and the US each have their own access rules. An aggregator can be the only practical way for a developer in, say, Brazil to use a Chinese model legally and reliably.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Payment flexibility.&lt;/strong&gt; Most developers globally can't easily pay for, say, a DeepSeek API. Aggregators accept PayPal, cards, crypto — whatever the market actually uses.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Observability.&lt;/strong&gt; Logs, latency metrics, error rates, and spend dashboards in one place.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compatibility shimming.&lt;/strong&gt; When a backend producer changes their schema (and they always do), the aggregator absorbs the breakage so your code doesn't.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If this list sounds familiar, it should. Stripe did this for payment processors. Cloudflare did this for origin servers. Twilio did this for telcos. In every case, the "boring" middle layer ended up being more strategically important — and often more valuable — than the producers it sat in front of.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 3: Schedulers — The Routing Brain
&lt;/h3&gt;

&lt;p&gt;Schedulers sit on top of the aggregator and decide, on a per-request basis, &lt;em&gt;which&lt;/em&gt; model should handle the call.&lt;/p&gt;

&lt;p&gt;A good scheduler considers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Task type (reasoning vs. summarization vs. extraction vs. translation)&lt;/li&gt;
&lt;li&gt;Required quality tier (is this customer-facing or background?)&lt;/li&gt;
&lt;li&gt;Current price per million tokens for each candidate model&lt;/li&gt;
&lt;li&gt;Current health and latency of each model&lt;/li&gt;
&lt;li&gt;Fallback policy if the first choice fails&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Today, the scheduler is usually a few hundred lines of code &lt;em&gt;inside your application&lt;/em&gt;. In a couple of years, it will look more like a managed service, much the way Kubernetes eventually swallowed everyone's bespoke deployment scripts.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why the Middle Layer Eats the Stack
&lt;/h2&gt;

&lt;p&gt;Here's the part that I think gets undersold. In a three-layer architecture, the middle layer is structurally the most strategic place to be — and the place most independent developers and startups should be paying attention to.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The middle layer is where lock-in dies
&lt;/h3&gt;

&lt;p&gt;The biggest hidden tax in AI development right now is &lt;strong&gt;switching cost&lt;/strong&gt;. Re-integrating a new model takes a week. Re-integrating five new models takes a quarter. Most teams just don't do it, and they overpay forever as a result.&lt;/p&gt;

&lt;p&gt;An aggregator normalizes the interface. Once you're behind one, switching from GPT-4o to DeepSeek V3 is a string change, not a sprint.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. The middle layer is where economics work
&lt;/h3&gt;

&lt;p&gt;Producers price for their &lt;em&gt;best&lt;/em&gt; customers — typically large enterprises with predictable, high-volume commits. Solo developers and small startups pay rack rate. Aggregators sit between the two: they negotiate volume rates with producers and resell in small chunks to long-tail developers. The arbitrage funds everyone in the middle.&lt;/p&gt;

&lt;p&gt;This is exactly why AWS exists. EC2 isn't cheaper than running your own server because Amazon has cheaper electricity. It's cheaper because Amazon buys electricity at industrial scale and sells it to you in minute increments.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. The middle layer is where reliability lives
&lt;/h3&gt;

&lt;p&gt;No single producer has 100% uptime. Anyone who's been on Anthropic during a capacity squeeze, or on OpenAI during a launch day, knows this in their bones. The only durable answer is multi-provider failover — and you can't do multi-provider failover until you have a unified interface to fail over with. That's the middle layer.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. The middle layer is where new geographies open up
&lt;/h3&gt;

&lt;p&gt;The most underrated story in AI right now is that the price-performance frontier has shifted. The cheapest token that meets quality bar for many real tasks is no longer made in California. It's made in Hangzhou, in Beijing. DeepSeek V3 is roughly 30x cheaper than GPT-4o on output tokens and ties or beats it on a large fraction of coding and reasoning tasks. Qwen 2.5 is genuinely competitive with Claude for many enterprise use cases. GLM-4 ships an extremely cheap "Flash" tier that's perfect for structured extraction.&lt;/p&gt;

&lt;p&gt;Most non-Chinese developers have never used these models. Not because they're inferior — they often aren't — but because &lt;strong&gt;the access path is hard&lt;/strong&gt;: foreign credit cards don't always work, KYC is in a foreign language, payment limits are restrictive, and the regional latency from outside Asia can be brutal without proper routing.&lt;/p&gt;

&lt;p&gt;This is, structurally, an aggregator problem. Solve it once for everybody.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. The middle layer is where the standards will eventually live
&lt;/h3&gt;

&lt;p&gt;One of the consistent points at recent infrastructure conferences is that the AI industry has a &lt;strong&gt;standards gap&lt;/strong&gt;. There's no equivalent of TCP/IP, or POSIX, or even OpenAPI for how a model should expose itself to the world. We're in the pre-standardization era, which is exactly when middleware companies create de facto standards.&lt;/p&gt;

&lt;p&gt;The Chat Completions schema — invented by OpenAI, adopted by everyone else because it was already there — is the first such standard. There will be more. They will almost certainly emerge from the aggregator layer, because that's where the pressure to standardize is highest.&lt;/p&gt;




&lt;h2&gt;
  
  
  What a Production-Grade Middle Layer Actually Looks Like
&lt;/h2&gt;

&lt;p&gt;If you've never used an aggregator, here's what working with one feels like in practice.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OpenAI&lt;/span&gt;

&lt;span class="c1"&gt;# One API key. Every model.
&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;YOUR_HAOTOKAI_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://api.haotokai.com/v1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Cheap, fast, Chinese-language-strong
&lt;/span&gt;&lt;span class="n"&gt;qwen_reply&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;qwen2.5-72b-instruct&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Summarize this doc...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Long-context — million-token window
&lt;/span&gt;&lt;span class="n"&gt;kimi_reply&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;moonshot-v1-128k&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;full_book_text&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Reasoning-heavy task
&lt;/span&gt;&lt;span class="n"&gt;deepseek_reply&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;deepseek-chat&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Design a sharding scheme...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Structured extraction at near-zero cost
&lt;/span&gt;&lt;span class="n"&gt;glm_reply&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;glm-4-flash&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Extract all invoice line items...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same SDK. Same request shape. Same billing wallet. Same observability. No new authentication, no new error handling, no new rate-limit logic.&lt;/p&gt;

&lt;p&gt;That's the whole point. The middle layer's job is to disappear.&lt;/p&gt;




&lt;h2&gt;
  
  
  Where Haotokai Fits
&lt;/h2&gt;

&lt;p&gt;This is the part where I should be transparent: &lt;a href="https://www.haotokai.com" rel="noopener noreferrer"&gt;Haotokai&lt;/a&gt; is a Layer-2 aggregator, and it's the product I work on. The reason we built it is exactly the thesis of this post — the middle layer is where most developers' real pain lives, and there wasn't a good option for developers outside China who wanted clean access to the Chinese model ecosystem.&lt;/p&gt;

&lt;p&gt;Concretely, Haotokai gives you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One OpenAI-compatible endpoint&lt;/strong&gt; across DeepSeek (V3, R1), Qwen 2.5, GLM-4, Kimi (Moonshot), Spark (iFlytek), and more.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pricing that mirrors the source providers&lt;/strong&gt;, so the cheap Chinese models stay cheap — typically 60–90% below GPT-4o-class pricing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PayPal, card, and crypto payment&lt;/strong&gt;, so you don't need a Chinese bank account to use Chinese tokens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One dashboard, one wallet, one invoice&lt;/strong&gt; for everything you spend across providers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Drop-in compatibility&lt;/strong&gt; with the OpenAI SDK and anything built on top of it (LangChain, LlamaIndex, Vercel AI SDK, etc.).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;$20 in free credit&lt;/strong&gt; to try every model side by side before you commit.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're already running a multi-model setup, Haotokai consolidates the integration mess. If you're a single-model shop curious about the price-performance frontier outside the US labs, it's probably the lowest-friction way to experiment.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Honest Counter-Arguments
&lt;/h2&gt;

&lt;p&gt;I'd be wasting your time if I didn't address the obvious objections.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Aggregators are just middlemen taking a cut."&lt;/strong&gt;&lt;br&gt;
Mathematically, yes — there's a markup. Practically, the markup is small (usually 5–15%), and it's dwarfed by the savings from being able to route to cheaper models. If switching 70% of your traffic to a model that's 10x cheaper saves you 65% on your bill, a 10% middleware fee is rounding error.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"I'm worried about another point of failure."&lt;/strong&gt;&lt;br&gt;
Reasonable concern, but in practice a well-run aggregator &lt;em&gt;improves&lt;/em&gt; reliability because it can fail over between producers automatically. Single-producer setups have no fallback. Multi-producer setups behind an aggregator have several.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"What about data privacy?"&lt;/strong&gt;&lt;br&gt;
Pick an aggregator that doesn't log prompts and doesn't train on your data, and the privacy posture is essentially the same as going direct. For workloads that need dedicated compliance (HIPAA, SOC 2, regional data residency), stick with a producer that offers those certifications. For everything else, the aggregator is fine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"I'll just build my own routing layer."&lt;/strong&gt;&lt;br&gt;
You can, and many teams do. The question is whether routing is your business. For Stripe, payment routing is the business. For Cloudflare, traffic routing is the business. For your AI startup, the chatbot or the agent or the document tool is the business. Build the differentiated thing; rent the boring infrastructure.&lt;/p&gt;




&lt;h2&gt;
  
  
  What to Take Away
&lt;/h2&gt;

&lt;p&gt;The three-layer framing for AI tokens isn't a marketing slide. It's a useful description of where the industry is actually heading, and once you see it you can't unsee it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Producers will keep training better models and competing on capability.&lt;/li&gt;
&lt;li&gt;Schedulers will become a managed service category over the next 2–3 years.&lt;/li&gt;
&lt;li&gt;Aggregators in the middle will quietly become the place where most developers actually live.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're building a serious AI application today, the highest-leverage architectural decision you can make is to stop talking to producers directly and start talking to a normalized middle layer. It's the same lesson the web learned with CDNs, that mobile learned with cross-platform SDKs, and that payments learned with Stripe. The middle is where the leverage is.&lt;/p&gt;

&lt;p&gt;The single-model era is over. The multi-model era needs a middle layer. That middle layer is the next critical piece of AI infrastructure.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;If you want to try the multi-model approach hands-on, you can &lt;a href="https://www.haotokai.com" rel="noopener noreferrer"&gt;grab a free API key on Haotokai&lt;/a&gt; and run requests against DeepSeek, Qwen, GLM, Kimi and more in under five minutes. $20 in free credit, no card required to start.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Curious which model to start with? Our &lt;a href="https://blog.haotokai.com/best-chinese-ai-models-2026.html" rel="noopener noreferrer"&gt;Best Chinese AI Models 2026&lt;/a&gt; comparison is a good first read.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>opensource</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
