<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[SwitchLLM]]></title><description><![CDATA[SwitchLLM]]></description><link>https://switchllm.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Wed, 04 Nov 2026 20:06:06 GMT</lastBuildDate><atom:link href="https://switchllm.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[The cheapest model per million tokens was the most expensive per request
]]></title><description><![CDATA[Measured per-request cost of 9 model-task combinations on one endpoint. The cheapest model per million tokens was the most expensive per request.]]></description><link>https://switchllm.hashnode.dev/the-cheapest-model-per-million-tokens-was-the-most-expensive-per-request</link><guid isPermaLink="true">https://switchllm.hashnode.dev/the-cheapest-model-per-million-tokens-was-the-most-expensive-per-request</guid><category><![CDATA[llm]]></category><category><![CDATA[api]]></category><category><![CDATA[Benchmark]]></category><dc:creator><![CDATA[chenyu520-ai]]></dc:creator><pubDate>Sat, 24 Oct 2026 08:24:15 GMT</pubDate><content:encoded><![CDATA[<p><em>I measured nine model-task combinations on the same endpoint. Per-million pricing predicted almost none of it.</em></p>
<p>Every "which model is cheapest" post compares price per million tokens. That number is easy to find and almost useless for deciding what to run.</p>
<p>So I measured the thing that actually shows up on a bill: <strong>what one request costs</strong>, on three task shapes, across three model families. Everything below comes from the <code>usage</code> fields the API returned, not from a price list.</p>
<h2>Method</h2>
<p>Same endpoint, same key, same three prompts, three runs each, reporting the median.</p>
<ul>
<li><strong>short</strong> — "In one sentence, what is a prompt cache?" (a chat reply you'd get from any assistant)</li>
<li><strong>code</strong> — "Write a Python function that validates an email with a regex. Only code." (a small, well-scoped generation)</li>
<li><strong>long</strong> — a ~400-token input asking for a three-sentence summary (input-heavy, output-light)</li>
</ul>
<p>Cost per request = input tokens × input rate + output tokens × output rate.</p>
<h2>The numbers</h2>
<table>
<thead>
<tr>
<th>Model</th>
<th>Task</th>
<th>Output tokens (median)</th>
<th>Median cost/request</th>
<th>$10 buys</th>
</tr>
</thead>
<tbody><tr>
<td>deepseek-flash</td>
<td>short</td>
<td>78</td>
<td>$0.00024</td>
<td>~41,000</td>
</tr>
<tr>
<td>deepseek-flash</td>
<td>code</td>
<td><strong>509</strong></td>
<td><strong>$0.00143</strong></td>
<td>~7,000</td>
</tr>
<tr>
<td>deepseek-flash</td>
<td>long</td>
<td>160</td>
<td>$0.00071</td>
<td>~14,000</td>
</tr>
<tr>
<td>glm-5.3</td>
<td>short</td>
<td>44</td>
<td>$0.00056</td>
<td>~17,800</td>
</tr>
<tr>
<td>glm-5.3</td>
<td>code</td>
<td>68</td>
<td><strong>$0.00084</strong></td>
<td>~11,900</td>
</tr>
<tr>
<td>glm-5.3</td>
<td>long</td>
<td>70</td>
<td>$0.00209</td>
<td>~4,800</td>
</tr>
<tr>
<td>kimi-k2.6</td>
<td>short</td>
<td>37</td>
<td>$0.00036</td>
<td>~28,000</td>
</tr>
<tr>
<td>kimi-k2.6</td>
<td>code</td>
<td>61</td>
<td>$0.00059</td>
<td>~17,000</td>
</tr>
<tr>
<td>kimi-k2.6</td>
<td>long</td>
<td>64</td>
<td>$0.00074</td>
<td>~13,500</td>
</tr>
</tbody></table>
<h2>Finding 1: the "cheap" model cost 70% more</h2>
<p>On paper <code>deepseek-flash</code> is $0.68 in / $2.75 out per million. <code>glm-5.3</code> is $3.50 / $11.00 — 5x on input and 4x on output in the price table.</p>
<p>On the code task, the expensive model was <strong>half the price per request</strong>.</p>
<p>The reason is in the output column: 509 tokens versus 68 for the same prompt, producing a function of similar length. The cheap-per-token model simply wrote more — explanation, alternatives, a docstring you didn't ask for. You pay for all of it at the output rate, which is 4× the input rate.</p>
<p><strong>Per-million pricing assumes every model emits the same number of tokens for the same request. They don't.</strong></p>
<h2>Finding 2: output is the bill, not input</h2>
<p>Take the two extremes:</p>
<ul>
<li><code>deepseek-flash</code>, code task: 45 input tokens, 509 output. <strong>97% of the cost was output.</strong></li>
<li><code>glm-5.3</code>, long task: 378 input tokens, 70 output. <strong>37% of the cost was output.</strong></li>
</ul>
<p>So "input is cheap, right?" depends entirely on what the model does after reading it. A 400-token input is almost free; a model that answers it in 700 tokens is not.</p>
<p>This is also why "summarise this document" and "write me a function" have completely different economics even though both are one API call.</p>
<h2>Finding 3: latency follows output too</h2>
<p>Median wall time on the short task: <strong>1.0s</strong> (deepseek-flash), <strong>2.2s</strong> (glm-5.3), <strong>1.3s</strong> (kimi-k2.6). On the code task, 1.5–2.9s.</p>
<p>The slow requests were always the ones emitting a lot of tokens, never the ones with a long input. If a call feels like it's hanging, look at the output length before you blame the network.</p>
<h2>What I'd actually do with this</h2>
<ol>
<li><strong>Measure your own three shapes.</strong> Take three prompts that represent the bulk of your traffic — a short one, a generation one, an input-heavy one — and log <code>usage</code> for each. Ten minutes of work, and it replaces every "cheapest model" list you've read.</li>
<li><strong>Route by task, not by model ranking.</strong> A short classification call and a 2,000-token refactor are different purchases. One model winning the first says nothing about the second.</li>
<li><strong>Watch output length, not just rate.</strong> If a prompt starts producing noticeably longer answers after a model update, your bill moves even though the price per million didn't.</li>
<li><strong>Check variance before you trust a number.</strong> On one model, the code task varied 2.5× across consecutive runs of the identical prompt. A single measurement is an anecdote, which is why the table above is medians of three.</li>
</ol>
<h2>Reproduce it</h2>
<p>Any OpenAI-compatible endpoint returns the fields you need:</p>
<pre><code class="language-bash">curl https://api.switchllm.net/v1/chat/completions \
  -H "Authorization: Bearer $SWITCHLLM_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-flash",
    "messages": [{"role": "user", "content": "In one sentence, what is a prompt cache?"}]
  }'
</code></pre>
<p>The <code>usage</code> object in the response has <code>prompt_tokens</code> and <code>completion_tokens</code>. Multiply by your provider's rates and you have the real cost of that request. Log those two numbers for a day and you'll know more about your bill than any comparison table can tell you.</p>
<h2>Caveats</h2>
<ul>
<li>One run per cell, three repetitions, medians. Variance is real — see point 4 above.</li>
<li>Rates are the ones on the endpoint I used, at the time of writing. Your provider's rates will differ; the <em>shape</em> of the finding is what generalises.</li>
<li>The prompts are synthetic and small. Real application prompts are longer and messier, and a single number per task hides a wide distribution.</li>
<li>Provider-side caching, if enabled, changes input costs substantially and is not reflected here.</li>
</ul>
<h2>Disclosure</h2>
<p>I run <a href="https://switchllm.net">SwitchLLM</a> — the OpenAI-compatible endpoint these measurements were taken on. One key for DeepSeek, GLM and Kimi, prepaid from $9.9, sign-up with an email address.</p>
<p>Everything above is the advice I'd give you on someone else's platform: the point is that per-million pricing doesn't tell you what a request costs, and the only way to know is to measure yours.</p>
]]></content:encoded></item><item><title><![CDATA[Getting a DeepSeek, GLM or Kimi API key when your phone number and your card are the problem]]></title><description><![CDATA[Every few weeks someone emails the same thing: the model is fine, I just can't buy it. The models stopped being the hard part a while ago. Signing up is…]]></description><link>https://switchllm.hashnode.dev/getting-a-deepseek-glm-or-kimi-api-key-when-your-phone-number-and-your-card-are-the-problem</link><guid isPermaLink="true">https://switchllm.hashnode.dev/getting-a-deepseek-glm-or-kimi-api-key-when-your-phone-number-and-your-card-are-the-problem</guid><dc:creator><![CDATA[chenyu520-ai]]></dc:creator><pubDate>Fri, 23 Oct 2026 11:38:30 GMT</pubDate><content:encoded><![CDATA[<p>Every few weeks someone emails the same thing: <em>the model is fine, I just can't buy it.</em></p>
<p>The models stopped being the hard part a while ago. Signing up is the hard part, and it fails in three separate places:</p>
<ol>
<li><strong>A phone number you don't have.</strong> Some platforms only accept a mobile number registered in one country. Virtual numbers get flagged within minutes, and then you're locked out of the account you were trying to create.</li>
<li><strong>An identity check before billing.</strong> Some platforms won't let you add credit until you've uploaded an ID document. Reasonable if you're in that market, a dead end if you're not.</li>
<li><strong>A card that gets declined.</strong> Even where signup works, AI and API merchants are routinely declined on foreign cards — especially on smaller banks and on prepaid or virtual cards.</li>
</ol>
<p>Any one of those is enough to stop you. They tend to arrive together.</p>
<h2>The four routes that actually exist</h2>
<table>
<thead>
<tr>
<th>Route</th>
<th>What you pay with</th>
<th>Works when</th>
<th>The catch</th>
</tr>
</thead>
<tbody><tr>
<td>Buy direct from the provider</td>
<td>Whatever method they support</td>
<td>That method works for your country and bank</td>
<td>Phone checks, ID checks, declines</td>
</tr>
<tr>
<td>An international cloud that hosts the models</td>
<td>Card, invoice</td>
<td>You already buy cloud there</td>
<td>Model versions lag, rates differ</td>
</tr>
<tr>
<td>A gateway with one OpenAI-compatible key</td>
<td>Card, prepaid</td>
<td>Your card clears a normal online merchant</td>
<td>You pay a margin over raw token cost</td>
</tr>
<tr>
<td>Self-hosting an open model</td>
<td>Your own hardware</td>
<td>You need full control</td>
<td>It isn't the same model</td>
</tr>
</tbody></table>
<p>People jump straight to the last row, which is the most expensive way to get a worse answer. Work down the table instead.</p>
<h2>Six things to check before you prepay anyone</h2>
<p>This applies to us as much as to anyone else.</p>
<ol>
<li><strong>What's the minimum top-up?</strong> If the cheapest way to evaluate a provider is $20, keep looking. You should be able to test the latency from your own city for pocket change.</li>
<li><strong>Prepaid, or subscription?</strong> Subscriptions fail at renewal for reasons that have nothing to do with you: an expired card, a re-authentication rule, a merchant flagged as high-risk. A prepaid balance cannot fail at renewal.</li>
<li><strong>Is it genuinely OpenAI-compatible?</strong> "Compatible" should mean you change <code>base_url</code> and the key, and nothing else. Ask for the exact endpoint before you pay.</li>
<li><strong>What happens if the credit doesn't land?</strong> The honest answer is "email us and we check the payment record against your account". The suspicious answer is "it's fully automatic, don't worry".</li>
<li><strong>Does the balance expire?</strong> Look for the exact wording, not the marketing version of it.</li>
<li><strong>Can you spend it down and leave?</strong> No minimum commitment, no auto-renew, no cancellation maze. If you can't leave, you're not a customer, you're a subscriber.</li>
</ol>
<h2>The integration is the boring part, which is good</h2>
<p>If the endpoint is OpenAI-compatible, migration is two lines:</p>
<pre><code class="language-bash">curl https://api.switchllm.net/v1/chat/completions \
  -H "Authorization: Bearer $SWITCHLLM_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-flash",
    "messages": [{"role": "user", "content": "hello"}]
  }'
</code></pre>
<p>Or with the standard SDK:</p>
<pre><code class="language-python">from openai import OpenAI
import os

client = OpenAI(
    base_url="https://api.switchllm.net/v1",
    api_key=os.environ["SWITCHLLM_KEY"],
)

print(client.chat.completions.create(
    model="deepseek-flash",
    messages=[{"role": "user", "content": "hello"}],
).choices[0].message.content)
</code></pre>
<p>Everything downstream keeps working, because they all speak this format: Cursor, Cline, LangChain, your own loop.</p>
<h2>The cost math, without the marketing</h2>
<p>Credit packs are one-time purchases from $9.9. Nothing renews.</p>
<p>A project making 300 calls a day costs about <strong>$0.36 a month</strong> on the cheapest model listed, about <strong>$10 a month</strong> on <code>deepseek-flash</code>, and about <strong>$45 a month</strong> on the largest model on the site. Those figures are just the published per-million rates multiplied out — 9,000 calls a month times the cost per request. You can redo the arithmetic from the pricing page instead of trusting me.</p>
<p>The point isn't that it's cheap. It's that the bill is small enough to predict, and you can stop by simply not topping up.</p>
<h2>Disclosure</h2>
<p>I run <a href="https://switchllm.net">SwitchLLM</a> — the third row of that table. One key for DeepSeek, GLM and Kimi behind an OpenAI-compatible endpoint, prepaid from $9.9, sign-up with an email address. New accounts get a small trial balance to test the integration before paying anything.</p>
<p>If a card works for you and the providers you want don't put a phone check and an ID check in your way, buying direct is cheaper and you should do that. This post is for the case where they do.</p>
<h2>If you want your own numbers</h2>
<p>Send me the shape of your sessions — turn counts, or a sample of request logs with the text stripped out — and I'll run the same three variants against your distribution and send back the table.</p>
<p>It costs me an afternoon and a few cents of tokens, and it's the only way I get to see sessions that aren't mine. <code>support@switchllm.net</code></p>
]]></content:encoded></item></channel></rss>