<?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: xinxin zhao</title>
    <description>The latest articles on DEV Community by xinxin zhao (@xinxin_zhao_9a9238c80a105).</description>
    <link>https://dev.to/xinxin_zhao_9a9238c80a105</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%2F4269134%2F66486683-38ed-480f-9195-e77bba55665e.png</url>
      <title>DEV Community: xinxin zhao</title>
      <link>https://dev.to/xinxin_zhao_9a9238c80a105</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xinxin_zhao_9a9238c80a105"/>
    <language>en</language>
    <item>
      <title>How to tell if a "cheap" LLM API is actually cheaper (3-minute check)</title>
      <dc:creator>xinxin zhao</dc:creator>
      <pubDate>Sun, 29 Nov 2026 09:32:19 +0000</pubDate>
      <link>https://dev.to/xinxin_zhao_9a9238c80a105/how-to-tell-if-a-cheap-llm-api-is-actually-cheaper-3-minute-check-536f</link>
      <guid>https://dev.to/xinxin_zhao_9a9238c80a105/how-to-tell-if-a-cheap-llm-api-is-actually-cheaper-3-minute-check-536f</guid>
      <description>&lt;p&gt;How to tell if a "cheap" LLM API is actually cheaper (3-minute check)&lt;/p&gt;

&lt;p&gt;Every week someone posts a new gateway that claims "50% cheaper than OpenAI". Some of them are real. Many are priced in units you can't verify: 1 credit, 1 request, 1 "unit" — and you only find out the real price after you've paid.&lt;/p&gt;

&lt;p&gt;Here are the three checks I use, in order. They take about three minutes and they work on any provider, including mine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check 1: the per-million-token number
&lt;/h2&gt;

&lt;p&gt;Ask for one thing: &lt;strong&gt;the price of one known model, expressed as $ per 1M input tokens and per 1M output tokens.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not "from $0.001 per call". Not "1 credit = 10,000 tokens". Just the unit every official provider publishes.&lt;/p&gt;

&lt;p&gt;Why this matters: model prices on the official side are public (&lt;code&gt;gpt-4o&lt;/code&gt; input/output, &lt;code&gt;claude-sonnet&lt;/code&gt; input/output, etc). Once a reseller states their price in the same unit, comparison is a subtraction, not a guessing game. If they can't or won't state it, that's your answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check 2: the cost of getting money in
&lt;/h2&gt;

&lt;p&gt;The sticker price is not what you pay. Payment processing is a fixed fee plus a percentage, and on small top-ups the fixed part dominates.&lt;/p&gt;

&lt;p&gt;A real example from my own product: a $1 top-up through a card processor that charges 3.9% + $0.40 gives back about $0.56 of usable balance. The fee eats ~44%. On a $10 top-up the same fee is ~8%. Same product, same prices, wildly different effective cost.&lt;/p&gt;

&lt;p&gt;So the question isn't "what's the price per token" — it's "what's the price per token &lt;strong&gt;at the amount I'm actually going to top up&lt;/strong&gt;".&lt;/p&gt;

&lt;p&gt;Practical rule: if you plan to spend under $20/month, the minimum top-up and the fixed fee matter more than the per-token price.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check 3: send one request and do the arithmetic yourself
&lt;/h2&gt;

&lt;p&gt;This is the only step that can't be faked.&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;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;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://provider.example/v1"&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="s2"&gt;"sk-..."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;r&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="s2"&gt;"some-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;"Reply with exactly: ok"&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="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;8&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;r&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="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&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="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now take the billed amount from the provider's dashboard for that single request, and compute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;$ per 1M input  &lt;span class="o"&gt;=&lt;/span&gt; billed * 1_000_000 / prompt_tokens
$ per 1M output &lt;span class="o"&gt;=&lt;/span&gt; billed * 1_000_000 / completion_tokens
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do this twice, with a long prompt and a short one. Two things show up immediately:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;whether their published price matches what they bill;&lt;/li&gt;
&lt;li&gt;whether prompt-cache discounts are real (a long repeated prompt should cost less the second time).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the numbers drift from the price page, you found something more useful than a discount.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do with the three numbers
&lt;/h2&gt;

&lt;p&gt;For a given model you can now compare on equal footing:&lt;/p&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;A (official)&lt;/th&gt;
&lt;th&gt;B (reseller 1)&lt;/th&gt;
&lt;th&gt;C (reseller 2)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;$ / 1M input&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;$ / 1M output&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;effective cost at your top-up size&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cache discount verified&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The column that decides it is usually the third one, not the first two.&lt;/p&gt;




&lt;p&gt;Disclosure: I run &lt;a href="https://tapixai.com" rel="noopener noreferrer"&gt;Tapix AI&lt;/a&gt;, which is one of these gateways — one OpenAI-compatible endpoint, 100+ models. I'm writing this because the checks above are the ones I'd want a buyer to run on us.&lt;/p&gt;

&lt;p&gt;Two things I did to make them easy to run on me: every model's per-token price is public at &lt;a href="https://tapixai.com/price-index" rel="noopener noreferrer"&gt;tapixai.com/price-index&lt;/a&gt; with no login, and &lt;a href="https://tapixai.com/try" rel="noopener noreferrer"&gt;tapixai.com/try&lt;/a&gt; sends one real request so you can do Check 3 before you pay anything.&lt;/p&gt;

&lt;p&gt;If you run the three checks on some other provider and the numbers don't match their page, post them. That's the most useful comment this post could get.&lt;/p&gt;

</description>
      <category>api</category>
      <category>llm</category>
      <category>ai</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Prompt caching: the 50% discount most teams never claim</title>
      <dc:creator>xinxin zhao</dc:creator>
      <pubDate>Sat, 28 Nov 2026 15:48:59 +0000</pubDate>
      <link>https://dev.to/xinxin_zhao_9a9238c80a105/prompt-caching-the-50-discount-most-teams-never-claim-2hjj</link>
      <guid>https://dev.to/xinxin_zhao_9a9238c80a105/prompt-caching-the-50-discount-most-teams-never-claim-2hjj</guid>
      <description>&lt;p&gt;Most teams pay full price for the same prompt thousands of times a day. Prompt caching exists precisely for that, and it is usually the largest single discount available — bigger than switching providers, and it requires no model change.&lt;/p&gt;

&lt;p&gt;Here is how it actually behaves, and why it often silently does nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  What gets cached
&lt;/h2&gt;

&lt;p&gt;Only the &lt;strong&gt;prefix&lt;/strong&gt; of your request. Providers hash the beginning of the prompt, and if an identical prefix was seen recently, the computation is reused and billed at a discount (typically 10–50% of the normal input rate, provider-dependent).&lt;/p&gt;

&lt;p&gt;That means:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Prompt layout&lt;/th&gt;
&lt;th&gt;Cache result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;[system instructions][retrieved docs][user question]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;✅ prefix stable → hits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;[timestamp][system instructions][docs][question]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;❌ prefix changes every call → never hits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;[user name][system instructions][docs][question]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;❌ same problem&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;[system][docs][history][question]&lt;/code&gt; where history changes&lt;/td&gt;
&lt;td&gt;partial: only &lt;code&gt;[system][docs]&lt;/code&gt; can hit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Rule: everything variable goes last.&lt;/strong&gt; The first byte of your prompt should be the part that is byte-identical across calls.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to verify you are getting the discount
&lt;/h2&gt;

&lt;p&gt;Almost every OpenAI-compatible API returns usage detail:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"usage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"prompt_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4210&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"completion_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;180&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"prompt_tokens_details"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"cached_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3900&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;If &lt;code&gt;cached_tokens&lt;/code&gt; is &lt;code&gt;0&lt;/code&gt; (or the field is missing), you are paying full price. Run the same request twice back-to-back and compare: the second call should show a materially lower effective input rate.&lt;/p&gt;

&lt;p&gt;If it stays zero, the usual causes are, in order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The variable part is at the front (timestamp, user name, session id).&lt;/li&gt;
&lt;li&gt;The prompt is below the provider's minimum cacheable length (often 1,024 or 2,048 tokens).&lt;/li&gt;
&lt;li&gt;The provider's cache lives for minutes, not hours — a low-traffic prompt never warms up.&lt;/li&gt;
&lt;li&gt;Caching is opt-in per model and not enabled on the model you picked.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The arithmetic, with real numbers
&lt;/h2&gt;

&lt;p&gt;A support assistant sending 4,000 input tokens per call, 5,000 calls/day:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No cache: 4,000 × 5,000 = &lt;strong&gt;20M input tokens/day&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;With 3,900 of those tokens cached at 25% of the normal rate: 19.5M cached-equivalent + 100k full-price = an effective &lt;strong&gt;~27% reduction&lt;/strong&gt; in input cost, on the same traffic, same model, same answers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At a $2.50/M input price that is roughly &lt;strong&gt;$37/day → $27/day&lt;/strong&gt;. Nothing about the application changed except the order of the string.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two traps
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cache invalidation is silent.&lt;/strong&gt; Editing the system prompt, changing a model version, or even switching providers invalidates everything. After a prompt change, watch &lt;code&gt;cached_tokens&lt;/code&gt; for a day — a permanent zero means your "optimisation" quietly cost you 25%.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cache hits are not free money on short prompts.&lt;/strong&gt; If your prompt is 300 tokens, there is nothing to cache. Caching matters for RAG and agent workloads with fat, stable prefixes — the exact shape where people usually give up and downgrade the model instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to start
&lt;/h2&gt;

&lt;p&gt;If you do one thing after reading this: log &lt;code&gt;prompt_tokens_details.cached_tokens&lt;/code&gt; for a week. You will either find a 20–40% discount sitting unclaimed, or you will learn that your prompts are shaped in a way that can never be cached — which is worth knowing before you spend weeks shopping for a cheaper per-token price.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Disclosure: I work on &lt;a href="https://tapixai.com" rel="noopener noreferrer"&gt;Tapix AI&lt;/a&gt;, an OpenAI-compatible API with prepaid billing from $1. Cache behaviour above is standard across OpenAI-schema providers; the &lt;a href="https://tapixai.com/price-index" rel="noopener noreferrer"&gt;price index&lt;/a&gt; publishes per-model prices if you want to redo the arithmetic with your own numbers, and the &lt;a href="https://tapixai.com/glossary/prompt-caching" rel="noopener noreferrer"&gt;glossary entry on prompt caching&lt;/a&gt; has the short version.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>aillmperformapiance</category>
    </item>
    <item>
      <title>A 5-minute due diligence checklist before you prepay for an LLM API</title>
      <dc:creator>xinxin zhao</dc:creator>
      <pubDate>Sat, 28 Nov 2026 15:26:17 +0000</pubDate>
      <link>https://dev.to/xinxin_zhao_9a9238c80a105/a-5-minute-due-diligence-checklist-before-you-prepay-for-an-llm-api-5fm8</link>
      <guid>https://dev.to/xinxin_zhao_9a9238c80a105/a-5-minute-due-diligence-checklist-before-you-prepay-for-an-llm-api-5fm8</guid>
      <description>&lt;p&gt;Cheap API resellers are easy to find and hard to judge. The prices look similar; the differences show up two weeks later, when your workflow starts failing or your balance disappears into a black box.&lt;/p&gt;

&lt;p&gt;This is the checklist I run before putting money on any OpenAI-compatible host. It takes about five minutes and needs no credit card.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Does &lt;code&gt;/v1/models&lt;/code&gt; tell the truth?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -s -H &lt;span class="s2"&gt;"Authorization: Bearer $KEY"&lt;/span&gt; &lt;span class="nv"&gt;$BASE&lt;/span&gt;/v1/models &lt;span class="o"&gt;|&lt;/span&gt; head -c 500
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Does the list include metadata you can act on (context length, per-token price), or just bare names?&lt;/li&gt;
&lt;li&gt;Does the model you actually want appear in the list, or only in their marketing page?&lt;/li&gt;
&lt;li&gt;Call one model from the list and see if it answers. "Listed but 404" is the single most common reseller failure.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Does streaming actually stream?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sN -H &lt;span class="s2"&gt;"Authorization: Bearer $KEY"&lt;/span&gt; -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"model":"MODEL","stream":true,"max_tokens":40,"messages":[{"role":"user","content":"Count 1 to 5."}]}'&lt;/span&gt; \
  &lt;span class="nv"&gt;$BASE&lt;/span&gt;/v1/chat/completions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Count the &lt;code&gt;data:&lt;/code&gt; lines. A real stream gives you many; a "streaming" endpoint that buffers gives you one or two. Your users will feel the difference as "slow model", and your client's timeouts will start billing you twice.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Do tool calls come back in the OpenAI shape?
&lt;/h2&gt;

&lt;p&gt;Ask for a function call with &lt;code&gt;tools&lt;/code&gt; and &lt;code&gt;tool_choice: auto&lt;/code&gt;. Two failure modes matter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The provider returns tool calls in a different structure → your agent silently stops using tools.&lt;/li&gt;
&lt;li&gt;The provider strips &lt;code&gt;tools&lt;/code&gt; entirely → no error, just prose.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you run agents, this is the check that decides whether the provider is usable at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. What are the error semantics?
&lt;/h2&gt;

&lt;p&gt;Send four bad requests on purpose:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Request&lt;/th&gt;
&lt;th&gt;Expected&lt;/th&gt;
&lt;th&gt;What a bad provider does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;No API key&lt;/td&gt;
&lt;td&gt;401&lt;/td&gt;
&lt;td&gt;500 or HTML&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Wrong model id&lt;/td&gt;
&lt;td&gt;404 with a clear message&lt;/td&gt;
&lt;td&gt;200 with empty content&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Over context limit&lt;/td&gt;
&lt;td&gt;400 with a reason&lt;/td&gt;
&lt;td&gt;truncates silently and bills full&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rate limit&lt;/td&gt;
&lt;td&gt;429 + &lt;code&gt;Retry-After&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;429 without headers → your retry loop hammers&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Silent truncation is the expensive one: you pay for tokens you never received.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Is billing legible?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Is there a per-request usage object with &lt;code&gt;prompt_tokens&lt;/code&gt;, &lt;code&gt;completion_tokens&lt;/code&gt;, and cached tokens?&lt;/li&gt;
&lt;li&gt;Do you get line-item usage per day and per key?&lt;/li&gt;
&lt;li&gt;Is the price per model published, or only "contact us"?&lt;/li&gt;
&lt;li&gt;What is the minimum top-up, and does a fixed card fee eat a large share of it? (On a $1 top-up, a $0.40 fixed fee is 40%.)&lt;/li&gt;
&lt;li&gt;What happens to unused balance — expiry, refunds, transfer?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If any of these is "not documented", assume the worst case.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. The 10-minute production test
&lt;/h2&gt;

&lt;p&gt;Wire it into the smallest real workflow you have and run it for a day, but keep two providers configured. Then compare &lt;strong&gt;cost per completed task&lt;/strong&gt; — not price per million tokens, not price per request. Everything above collapses into that ratio, and it is the only number that survives contact with reality.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Disclosure: I work on &lt;a href="https://tapixai.com" rel="noopener noreferrer"&gt;Tapix AI&lt;/a&gt;, an OpenAI-compatible API with prepaid billing from $1. I wrote the checklist so it can be used against us too — items 1–5 are all things we publish: &lt;code&gt;/v1/models&lt;/code&gt; returns the live catalogue with prices, the &lt;a href="https://tapixai.com/price-index" rel="noopener noreferrer"&gt;price index&lt;/a&gt; puts official list price next to ours per model, and usage is per key. If a provider blocks any of these checks, that is the answer.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>apiaillmdevtools</category>
    </item>
    <item>
      <title>What $1 buys, measured: tokens per dollar across six models</title>
      <dc:creator>xinxin zhao</dc:creator>
      <pubDate>Sat, 28 Nov 2026 15:09:48 +0000</pubDate>
      <link>https://dev.to/xinxin_zhao_9a9238c80a105/what-1-buys-measured-tokens-per-dollar-across-six-models-408k</link>
      <guid>https://dev.to/xinxin_zhao_9a9238c80a105/what-1-buys-measured-tokens-per-dollar-across-six-models-408k</guid>
      <description>&lt;p&gt;"Price per million tokens" is an abstraction. Here is the same information in the unit people actually think in: &lt;strong&gt;what one dollar buys&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Method: 75% input tokens / 25% output tokens (a realistic mix for chat and agent workloads), current published prices, six models spanning the range.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Input $/M&lt;/th&gt;
&lt;th&gt;Output $/M&lt;/th&gt;
&lt;th&gt;Tokens per $1&lt;/th&gt;
&lt;th&gt;≈ pages of text&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Haiku-class small&lt;/td&gt;
&lt;td&gt;$0.034&lt;/td&gt;
&lt;td&gt;$0.167&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;14,925,000&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;~18,600&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GLM-flash class&lt;/td&gt;
&lt;td&gt;$0.074&lt;/td&gt;
&lt;td&gt;$0.309&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;7,552,000&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;~9,400&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPT-terra class&lt;/td&gt;
&lt;td&gt;$0.430&lt;/td&gt;
&lt;td&gt;$1.453&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1,458,000&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;~1,800&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemini-flash class&lt;/td&gt;
&lt;td&gt;$0.525&lt;/td&gt;
&lt;td&gt;$2.625&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;952,000&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;~1,190&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sonnet-class&lt;/td&gt;
&lt;td&gt;$2.10&lt;/td&gt;
&lt;td&gt;$10.50&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;238,000&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;~300&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Opus-class&lt;/td&gt;
&lt;td&gt;$3.50&lt;/td&gt;
&lt;td&gt;$17.50&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;143,000&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;~180&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;(≈ pages assumes 800 tokens per page of prose. Numbers are rounded; the ratio is what matters.)&lt;/p&gt;

&lt;h2&gt;
  
  
  The 104× gap
&lt;/h2&gt;

&lt;p&gt;The top row and the bottom row differ by &lt;strong&gt;104×&lt;/strong&gt; for the same dollar. That gap is larger than the difference between any two &lt;em&gt;providers&lt;/em&gt; selling the same model — which is roughly 1.2–1.5× after shopping around.&lt;/p&gt;

&lt;p&gt;So the ordering of levers is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Which model class you route to&lt;/strong&gt; — up to 100×.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How much output the model writes&lt;/strong&gt; — up to 4× (output is priced 3–5× input).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How many tokens you resend per call&lt;/strong&gt; — 2–10× on chat workloads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Which provider sells it&lt;/strong&gt; — 1.2–1.5×.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retries and cache misses&lt;/strong&gt; — 0–30% depending on your retry loop.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Most "we found a cheaper API" projects optimise #4 and ignore #1 and #2, which is why their bill barely moves.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this looks like in practice
&lt;/h2&gt;

&lt;p&gt;A support assistant that answers 200 messages a day, each with a 3,000-token prompt (instructions + retrieved docs + history) and a 300-token answer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On an Opus-class model: 200 × (3,000 × $3.50 + 300 × $17.50) / 1M = &lt;strong&gt;$3.15/day&lt;/strong&gt; → $95/month.&lt;/li&gt;
&lt;li&gt;On a GLM-flash class model: 200 × (3,000 × $0.074 + 300 × $0.309) / 1M = &lt;strong&gt;$0.063/day&lt;/strong&gt; → $1.90/month.&lt;/li&gt;
&lt;li&gt;Same prompts, same answer length. &lt;strong&gt;50× cheaper.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whether the cheap model is &lt;em&gt;good enough&lt;/em&gt; is the real question — and it is answered by an evaluation, not by a price table. What the table answers is: how much is at stake. In this example, $93/month at 200 messages/day. At 20,000 messages/day it is $9,300/month.&lt;/p&gt;

&lt;h2&gt;
  
  
  The trap: "$1 to start" is not "cheap"
&lt;/h2&gt;

&lt;p&gt;A $1 minimum top-up tells you the &lt;em&gt;risk&lt;/em&gt; of trying a provider is small. It says nothing about unit economics: $1 of an Opus-class model is 143,000 tokens, which is a real test but only a few hundred pages. $1 of a small model is 14.9 million tokens, which is a week of production traffic for a small bot.&lt;/p&gt;

&lt;p&gt;Practical rule: &lt;strong&gt;pick the model class by evaluation, pick the provider by measured cost per completed task, and keep the entry cost low enough that testing isn't a decision.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Disclosure: the prices in the table are from &lt;a href="https://tapixai.com/pricing" rel="noopener noreferrer"&gt;Tapix AI&lt;/a&gt;, the OpenAI-compatible API I work on (prepaid, no subscription, $1 minimum). The methodology — 75/25 mix, tokens per dollar, cost per completed task — is provider-neutral, and the &lt;a href="https://tapixai.com/price-index" rel="noopener noreferrer"&gt;price index&lt;/a&gt; publishes official list price next to resale price per model if you want to redo the arithmetic with your own numbers.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>aiapillmcost</category>
    </item>
    <item>
      <title>What actually decides your LLM API bill: four numbers, measured</title>
      <dc:creator>xinxin zhao</dc:creator>
      <pubDate>Sat, 28 Nov 2026 14:30:40 +0000</pubDate>
      <link>https://dev.to/xinxin_zhao_9a9238c80a105/what-actually-decides-your-llm-api-bill-four-numbers-measured-3aib</link>
      <guid>https://dev.to/xinxin_zhao_9a9238c80a105/what-actually-decides-your-llm-api-bill-four-numbers-measured-3aib</guid>
      <description>&lt;p&gt;Every "cheap LLM API" comparison I read compares &lt;strong&gt;price per million tokens&lt;/strong&gt;. That number is almost irrelevant to what you actually pay, because four other numbers sit between the sticker price and your invoice.&lt;/p&gt;

&lt;p&gt;Here they are, with the arithmetic.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. How many tokens you resend per call
&lt;/h2&gt;

&lt;p&gt;Chat APIs are stateless: the model sees only what you send in that request. So a support bot with a 2,000-token system prompt, a 3,000-token knowledge block and 5 turns of history is sending 10,000+ input tokens on the &lt;em&gt;last&lt;/em&gt; message — and 8,000 on the one before it, and so on.&lt;/p&gt;

&lt;p&gt;A 10-turn conversation is not 10 × the last request; it is roughly the triangle: &lt;code&gt;n²/2&lt;/code&gt; if you keep everything.&lt;/p&gt;

&lt;p&gt;Measure it: log &lt;code&gt;usage.prompt_tokens&lt;/code&gt; per request and look at the trend inside a single session. If the line goes up and to the right, your bill is a function of conversation length, not of your token price.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Output share
&lt;/h2&gt;

&lt;p&gt;Output tokens cost two to four times input tokens on almost every provider. A request that returns 500 tokens of prose costs more than one that returns 50 tokens of JSON, even at identical prompt sizes.&lt;/p&gt;

&lt;p&gt;A worked example with real numbers (3,000,000 tokens/month, 25% output, current list prices):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Official list&lt;/th&gt;
&lt;th&gt;25% output&lt;/th&gt;
&lt;th&gt;Monthly&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Claude Sonnet class&lt;/td&gt;
&lt;td&gt;$3.00 / $15.00 per M&lt;/td&gt;
&lt;td&gt;2.25M in + 0.75M out&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$18.00&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPT-4o class&lt;/td&gt;
&lt;td&gt;$2.50 / $10.00 per M&lt;/td&gt;
&lt;td&gt;same split&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$13.13&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Small open-weight model&lt;/td&gt;
&lt;td&gt;$0.14 / $0.28 per M&lt;/td&gt;
&lt;td&gt;same split&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$0.53&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The gap between row 1 and row 3 is 34×. Almost nobody needs row 1 for extraction, classification or summarisation — which is most production traffic.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Retry rate
&lt;/h2&gt;

&lt;p&gt;Retries are invisible in per-token pricing and brutal in practice. Three common causes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Client timeout shorter than the model's real p95 generation time → request billed, answer discarded, retried.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;max_tokens&lt;/code&gt; set too low → answer truncated mid-JSON → your parser throws → retry with a bigger cap.&lt;/li&gt;
&lt;li&gt;Rate limits (HTTP 429) hit under load → queueing, or a second provider at a different price.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A 3% retry rate is a 3% surcharge on every token you buy. Measure it: &lt;code&gt;retries / total requests&lt;/code&gt;, per model.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Prompt cache hit rate
&lt;/h2&gt;

&lt;p&gt;Providers that support prefix caching bill the repeated prefix at a discount (often 10–50% of the normal input rate). It only works if the &lt;strong&gt;identical prefix comes first&lt;/strong&gt;: stable instructions, then reference documents, then the variable user message.&lt;/p&gt;

&lt;p&gt;If you put the timestamp or the user's name at the top of the system prompt, the cache never hits and the discount never applies. Measuring is a one-line check: does the response &lt;code&gt;usage&lt;/code&gt; object report cached tokens greater than zero?&lt;/p&gt;

&lt;h2&gt;
  
  
  Putting it together: cost per completed task
&lt;/h2&gt;

&lt;p&gt;The only comparable metric across providers is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cost per completed task = (sum of all charges in window) / (tasks that succeeded)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Not price per token, not price per request. Everything above — resent history, output verbosity, retries, cache misses — collapses into that one ratio.&lt;/p&gt;

&lt;p&gt;Two providers quoting the same $2.50/M frequently differ 30%+ on this number, because one of them truncates differently, retries differently, or bills failed calls.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd measure first
&lt;/h2&gt;

&lt;p&gt;If you have five minutes, in this order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;prompt_tokens&lt;/code&gt; per request, grouped by session → find the resend problem.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;output_tokens / task&lt;/code&gt; → find the verbosity problem.&lt;/li&gt;
&lt;li&gt;retry rate → find the timeout/truncation problem.&lt;/li&gt;
&lt;li&gt;cached tokens &amp;gt; 0? → find the caching problem.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Fixing 1 and 3 usually cuts more than switching providers does. Switching providers is the last lever, not the first.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Disclosure: I work on &lt;a href="https://tapixai.com" rel="noopener noreferrer"&gt;Tapix AI&lt;/a&gt;, an OpenAI-compatible API that resells models with prepaid billing from $1. Two things referenced above that are useful regardless of which provider you use: a &lt;a href="https://tapixai.com/tools/token-cost-calculator" rel="noopener noreferrer"&gt;token cost calculator&lt;/a&gt; that takes your own token counts, and a &lt;a href="https://tapixai.com/price-index" rel="noopener noreferrer"&gt;price index&lt;/a&gt; that puts official list price next to resale price per model. The methodology in this post is provider-neutral.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>aiapillmperformance</category>
    </item>
    <item>
      <title>Two fields, not a migration: moving an OpenAI-compatible client to a cheaper endpoint</title>
      <dc:creator>xinxin zhao</dc:creator>
      <pubDate>Fri, 27 Nov 2026 14:12:35 +0000</pubDate>
      <link>https://dev.to/xinxin_zhao_9a9238c80a105/two-fields-not-a-migration-moving-an-openai-compatible-client-to-a-cheaper-endpoint-55fj</link>
      <guid>https://dev.to/xinxin_zhao_9a9238c80a105/two-fields-not-a-migration-moving-an-openai-compatible-client-to-a-cheaper-endpoint-55fj</guid>
      <description>&lt;p&gt;Most "cheap LLM API" comparisons are price tables. Price tables are the least useful part of the decision, because the thing that actually breaks when you switch providers is never the price — it is the model id, the streaming shape, or a minimum top-up you did not notice.&lt;/p&gt;

&lt;p&gt;I run the API side of a small reseller, so read the honest parts below as self-interest in both directions: I want you to test your endpoint properly, and I also want to tell you when switching is a bad idea.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a client actually needs from a provider
&lt;/h2&gt;

&lt;p&gt;Open WebUI, LibreChat, Cherry Studio, LobeChat, Chatbox and Cline are all OpenAI-compatible clients. They do not call vendor SDKs. Whatever you point them at has to answer four things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;POST /v1/chat/completions&lt;/code&gt; with and without &lt;code&gt;stream: true&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;tool / function calling in the same JSON shape&lt;/li&gt;
&lt;li&gt;a &lt;code&gt;usage&lt;/code&gt; block that splits input and output tokens&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;GET /v1/models&lt;/code&gt; with ids the client can render in a dropdown&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything else — routing, aggregation, retries — is the provider's problem, not yours. That is why migration is two fields (base URL and key), not a rewrite.&lt;/p&gt;

&lt;h2&gt;
  
  
  The three things that actually break
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Model ids.&lt;/strong&gt; Aggregators use prefixed ids (&lt;code&gt;anthropic/claude-sonnet&lt;/code&gt;), a direct gateway often serves the upstream id (&lt;code&gt;claude-sonnet-4-6&lt;/code&gt;). If the id is not in &lt;code&gt;/v1/models&lt;/code&gt;, the client's dropdown stays empty and the user concludes "it doesn't work". Check before blaming the client:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -s https://tapixai.com/v1/models -H &lt;span class="s2"&gt;"Authorization: Bearer $KEY"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; head -c 400
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Streaming chunk shape.&lt;/strong&gt; Some gateways stream a single final chunk instead of many deltas. That passes in curl and feels broken in a UI that renders token by token. Ask for ~40 tokens of output and count the &lt;code&gt;data:&lt;/code&gt; lines. Fewer than five deltas means the UI will feel frozen regardless of real latency.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Billing minimums and units.&lt;/strong&gt; A $10 minimum with $3 of monthly usage is worse than a slightly higher per-token price with a $1 minimum. Also check whether cached input is discounted and whether 429s or timeouts are billed. They should not be.&lt;/p&gt;

&lt;h2&gt;
  
  
  Price maths that survives contact with reality
&lt;/h2&gt;

&lt;p&gt;Compare the same workload, not the same sticker price. For a mid-tier model, one call with 2,000 input and 500 output tokens:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What&lt;/th&gt;
&lt;th&gt;Where it comes from&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;input tokens billed&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;usage.prompt_tokens&lt;/code&gt;, not your estimate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cached input&lt;/td&gt;
&lt;td&gt;is prompt caching supported, and does it show as a discount&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;minimum spend&lt;/td&gt;
&lt;td&gt;what you must pay before the first useful call&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;failed calls&lt;/td&gt;
&lt;td&gt;are rate-limit errors billed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Run the same prompt on both providers, one week apart, and read the &lt;code&gt;usage&lt;/code&gt; block both times. If the numbers differ by more than a few percent for identical text, one of them counts differently and your price comparison is measuring nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Agent workloads are the exception
&lt;/h2&gt;

&lt;p&gt;Cline, Continue and similar agents do not send one request. They loop: read file, propose edit, run tests, read output, retry. Every turn re-sends the conversation so far, so a 20-step task can bill 30–60× the tokens of the sentence you typed.&lt;/p&gt;

&lt;p&gt;Two consequences:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cost is dominated by &lt;strong&gt;input&lt;/strong&gt;, not output. Reducing re-sent context beats a cheaper output price.&lt;/li&gt;
&lt;li&gt;"Cost per million tokens" is a useless metric here. Measure &lt;strong&gt;cost per completed task&lt;/strong&gt;: total input tokens, total output tokens, number of turns, and whether the task finished. A cheaper endpoint that needs three extra turns is more expensive.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is a trick that beats any discount: point the mechanical turns (rename, import fix, add a log line) at a smaller model and keep the big model for planning. Most agent turns are mechanical.&lt;/p&gt;

&lt;h2&gt;
  
  
  When you should not switch
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You need a vendor SLA or a compliance trail that names the model vendor.&lt;/li&gt;
&lt;li&gt;You need a model on release day; resellers lag by days to weeks.&lt;/li&gt;
&lt;li&gt;You need automatic failover across many upstreams — that is what aggregators exist for, and losing it to save 20% is usually a bad trade.&lt;/li&gt;
&lt;li&gt;Your spend is a few cents a month. Optimising that is a hobby, not a saving.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A five-minute acceptance test
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;GET /v1/models&lt;/code&gt; returns the id you want to use.&lt;/li&gt;
&lt;li&gt;One streaming request on a 20k-token prompt: first token arrives in a sane time and you can count multiple deltas.&lt;/li&gt;
&lt;li&gt;One request with a &lt;code&gt;tools&lt;/code&gt; array: the response contains &lt;code&gt;tool_calls&lt;/code&gt;, not a paragraph explaining what it would do.&lt;/li&gt;
&lt;li&gt;Break it on purpose — wrong key, empty balance — and confirm the error body names the reason so your client can show it instead of retrying silently.&lt;/li&gt;
&lt;li&gt;Compare &lt;code&gt;usage&lt;/code&gt; numbers against a provider you already trust, for the same text.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If all five pass, you have migrated. If any fails, you have found a reason to stay, and that is worth more than a price table.&lt;/p&gt;




&lt;p&gt;If you want to see the whole flow on your own key without touching config first: &lt;a href="https://tapixai.com/start" rel="noopener noreferrer"&gt;https://tapixai.com/start&lt;/a&gt; runs one real call and prints the error verbatim if it fails. Setup guides for ten clients (Cline, Open WebUI, Cherry Studio, LibreChat, n8n, SillyTavern, LobeChat, Chatbox, Dify, Continue) are at &lt;a href="https://tapixai.com/integrations" rel="noopener noreferrer"&gt;https://tapixai.com/integrations&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>api</category>
      <category>llm</category>
      <category>devtools</category>
    </item>
  </channel>
</rss>
