<?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: ModelSite</title>
    <description>The latest articles on DEV Community by ModelSite (@modelsite).</description>
    <link>https://dev.to/modelsite</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%2F4235598%2F109f60b0-cbbe-444f-94ca-2fb4b095448d.png</url>
      <title>DEV Community: ModelSite</title>
      <link>https://dev.to/modelsite</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/modelsite"/>
    <language>en</language>
    <item>
      <title>One OpenAI-compatible API key for DeepSeek, Qwen and GLM</title>
      <dc:creator>ModelSite</dc:creator>
      <pubDate>Tue, 10 Nov 2026 02:53:27 +0000</pubDate>
      <link>https://dev.to/modelsite/one-openai-compatible-api-key-for-deepseek-qwen-and-glm-44jj</link>
      <guid>https://dev.to/modelsite/one-openai-compatible-api-key-for-deepseek-qwen-and-glm-44jj</guid>
      <description>&lt;p&gt;Trying DeepSeek, Qwen and GLM on the same task usually means juggling three vendor dashboards: separate sign-ups, separate billing, and rate-limit rules that never match. If your code already calls the OpenAI API, you can reuse it as-is.&lt;/p&gt;

&lt;h2&gt;
  
  
  One endpoint, one key
&lt;/h2&gt;

&lt;p&gt;ModelSite exposes an OpenAI-compatible endpoint at &lt;code&gt;https://api.modelsite.ai/v1&lt;/code&gt;. You authenticate with a single key (it starts with &lt;code&gt;sk-ms-&lt;/code&gt;) in the &lt;code&gt;Authorization: Bearer&lt;/code&gt; header and pick the model with the &lt;code&gt;model&lt;/code&gt; field. Nothing else about the request changes.&lt;/p&gt;

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



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://api.modelsite.ai/v1/chat/completions \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $MODELSITE_API_KEY"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{
    "model": "deepseek-v4.1-flash",
    "messages": [{"role": "user", "content": "Explain TCP slow start in two sentences."}]
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Switch models by changing one string
&lt;/h2&gt;

&lt;p&gt;With the official OpenAI Python SDK, point &lt;code&gt;base_url&lt;/code&gt; at ModelSite and loop over model names. Request and response formats are identical for every model, so your parsing and error handling stay as they are.&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="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&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="s2"&gt;"MODELSITE_API_KEY"&lt;/span&gt;&lt;span class="p"&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="s2"&gt;"https://api.modelsite.ai/v1"&lt;/span&gt;&lt;span class="p"&gt;,&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="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"deepseek-v4.1-flash"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"qwen3.7-plus"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"glm-5.3-flash"&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="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="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"user"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Explain TCP slow start in two sentences."&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;print&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="s2"&gt;"-&amp;gt;"&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="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;h2&gt;
  
  
  What each model costs
&lt;/h2&gt;

&lt;p&gt;We don't paste prices here because they change; the pages below always show current numbers for per-million-token pricing, context length, cache pricing and off-peak discounts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://modelsite.ai/en/models/deepseek-v4.1-flash?utm_source=devto&amp;amp;utm_campaign=one-api-key-deepseek-qwen-glm" rel="noopener noreferrer"&gt;deepseek-v4.1-flash&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://modelsite.ai/en/models/qwen3.7-plus?utm_source=devto&amp;amp;utm_campaign=one-api-key-deepseek-qwen-glm" rel="noopener noreferrer"&gt;qwen3.7-plus&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://modelsite.ai/en/models/glm-5.3-flash?utm_source=devto&amp;amp;utm_campaign=one-api-key-deepseek-qwen-glm" rel="noopener noreferrer"&gt;glm-5.3-flash&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Already using the Anthropic SDK?
&lt;/h2&gt;

&lt;p&gt;ModelSite also exposes an Anthropic-compatible endpoint (same keys, different base URL). The &lt;a href="https://docs.modelsite.ai/en/docs/sdk?utm_source=devto&amp;amp;utm_campaign=one-api-key-deepseek-qwen-glm" rel="noopener noreferrer"&gt;SDK guide&lt;/a&gt; lists the base URL and the authentication difference.&lt;/p&gt;

&lt;h2&gt;
  
  
  Calling each vendor directly
&lt;/h2&gt;

&lt;p&gt;If you'd rather call each vendor yourself, their official docs are the source of truth: &lt;a href="https://api-docs.deepseek.com/" rel="noopener noreferrer"&gt;DeepSeek&lt;/a&gt;, &lt;a href="https://www.alibabacloud.com/help/en/model-studio/" rel="noopener noreferrer"&gt;Qwen on Alibaba Cloud&lt;/a&gt;, and &lt;a href="https://docs.bigmodel.cn/" rel="noopener noreferrer"&gt;GLM from Zhipu&lt;/a&gt;. You'll do the setup three times, but every call then goes straight to the vendor. The OpenAI &lt;a href="https://github.com/openai/openai-python" rel="noopener noreferrer"&gt;Python SDK repo&lt;/a&gt; documents the client options used above.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://modelsite.ai/en/blog/one-api-key-deepseek-qwen-glm?utm_source=devto&amp;amp;utm_campaign=one-api-key-deepseek-qwen-glm" rel="noopener noreferrer"&gt;ModelSite blog&lt;/a&gt; on 2026-10-22.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>llm</category>
      <category>api</category>
      <category>python</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
