<?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: Adam Z</title>
    <description>The latest articles on DEV Community by Adam Z (@adam_z).</description>
    <link>https://dev.to/adam_z</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%2F4167616%2Fb535db69-52a5-449a-9ba6-57ae80e77d03.jpg</url>
      <title>DEV Community: Adam Z</title>
      <link>https://dev.to/adam_z</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adam_z"/>
    <language>en</language>
    <item>
      <title>Is Qwen Code Really Free? A Practical Setup and Pricing Guide (2026)</title>
      <dc:creator>Adam Z</dc:creator>
      <pubDate>Tue, 03 Nov 2026 02:11:36 +0000</pubDate>
      <link>https://dev.to/adam_z/is-qwen-code-really-free-a-practical-setup-and-pricing-guide-2026-2f7p</link>
      <guid>https://dev.to/adam_z/is-qwen-code-really-free-a-practical-setup-and-pricing-guide-2026-2f7p</guid>
      <description>&lt;p&gt;Qwen Code is an open-source AI coding agent that can inspect repositories, edit files, execute commands, and connect to different AI model providers.&lt;/p&gt;

&lt;p&gt;But there's a question that often causes confusion:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is Qwen Code actually free, or do you need to pay for an API key?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The short answer: &lt;strong&gt;the client is free, but the AI models you connect to it may not be.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And if you're following an older tutorial that recommends signing in with Qwen OAuth for free usage, that advice is now outdated.&lt;/p&gt;

&lt;p&gt;Here's how Qwen Code works in 2026 and how to set it up without choosing the wrong authentication or billing method.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What is free, and what costs money?
&lt;/h2&gt;

&lt;p&gt;Qwen Code itself is an open-source application licensed under Apache 2.0.&lt;/p&gt;

&lt;p&gt;You can install the client without purchasing a software license. However, the client still needs access to an AI model.&lt;/p&gt;

&lt;p&gt;There are several ways to provide that access:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Connection&lt;/th&gt;
&lt;th&gt;How billing generally works&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;QwenCloud Token Plan&lt;/td&gt;
&lt;td&gt;Subscription with a monthly credit quota&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;QwenCloud Standard API Key&lt;/td&gt;
&lt;td&gt;Pay-as-you-go API usage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Alibaba ModelStudio Coding Plan&lt;/td&gt;
&lt;td&gt;Subscription with an included usage quota&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Alibaba ModelStudio Token Plan&lt;/td&gt;
&lt;td&gt;Usage-based billing through a dedicated endpoint&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Alibaba ModelStudio Standard API Key&lt;/td&gt;
&lt;td&gt;Pay-as-you-go API usage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Third-party model provider&lt;/td&gt;
&lt;td&gt;Depends on that provider's pricing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Self-hosted local model&lt;/td&gt;
&lt;td&gt;No hosted inference charge, but requires your own hardware&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This distinction matters.&lt;/p&gt;

&lt;p&gt;Installing a free coding agent does &lt;strong&gt;not&lt;/strong&gt; automatically give you unlimited free access to the models it uses.&lt;/p&gt;

&lt;p&gt;Also, QwenCloud Token Plan and Alibaba ModelStudio Token Plan are separate offerings. Do not assume that a key or subscription for one automatically works with the other.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Install Qwen Code
&lt;/h2&gt;

&lt;p&gt;For an npm installation, first check that you have Node.js 22 or later.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then install Qwen Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @qwen-code/qwen-code@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On macOS or Linux, Homebrew is another documented installation option:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;qwen-code
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Navigate to a project directory and launch 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;&lt;span class="nb"&gt;cd &lt;/span&gt;your-project
qwen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first launch will guide you through provider authentication.&lt;/p&gt;

&lt;p&gt;Official installation guide: &lt;a href="https://github.com/QwenLM/qwen-code/blob/main/docs/users/quickstart.md" rel="noopener noreferrer"&gt;Qwen Code Quickstart&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Choose the right authentication method
&lt;/h2&gt;

&lt;p&gt;Inside the running Qwen Code interface, enter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/auth
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll be able to choose from supported connection types.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option A: QwenCloud
&lt;/h3&gt;

&lt;p&gt;This is a straightforward option if you want to use QwenCloud directly.&lt;/p&gt;

&lt;p&gt;You can choose between:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Token Plan:&lt;/strong&gt; a subscription with a monthly credit quota.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Standard API Key:&lt;/strong&gt; pay for API usage based on the provider's pricing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Select the correct regional platform and enter the key issued for that service.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option B: Alibaba ModelStudio
&lt;/h3&gt;

&lt;p&gt;Alibaba ModelStudio provides several choices, including Coding Plan, Token Plan, and Standard API Key.&lt;/p&gt;

&lt;p&gt;These offerings differ in their intended users, quotas, billing rules, and endpoints.&lt;/p&gt;

&lt;p&gt;For example, Coding Plan is oriented toward individual developers with an included usage quota. Token Plan uses a separate usage-based endpoint.&lt;/p&gt;

&lt;p&gt;Choose the specific offering that matches your account and API key.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option C: Third-party providers
&lt;/h3&gt;

&lt;p&gt;Qwen Code can also connect to supported third-party model providers.&lt;/p&gt;

&lt;p&gt;This can make sense if you already have an API account elsewhere or want more flexibility over which model you use.&lt;/p&gt;

&lt;p&gt;You should verify the provider's supported models, usage terms, and pricing before connecting.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option D: Custom or local provider
&lt;/h3&gt;

&lt;p&gt;Qwen Code supports custom model connections, including compatible locally hosted model servers.&lt;/p&gt;

&lt;p&gt;For example, a local inference server exposing an OpenAI-compatible endpoint may be configured as a model provider.&lt;/p&gt;

&lt;p&gt;This can avoid hosted-model API charges, but it doesn't guarantee every tool or feature works entirely offline.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Important: the old free Qwen OAuth option is gone
&lt;/h2&gt;

&lt;p&gt;This is one of the biggest changes to watch out for.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The previous Qwen OAuth free tier was discontinued on April 15, 2026.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As a result, some older installation videos and blog posts may describe a sign-in path that is no longer available for normal use.&lt;/p&gt;

&lt;p&gt;If an old tutorial tells you to rely on free Qwen OAuth access, check the current official documentation instead.&lt;/p&gt;

&lt;p&gt;The current recommended workflow is to launch &lt;code&gt;qwen&lt;/code&gt; and configure an available provider through &lt;code&gt;/auth&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Also note that the old standalone &lt;code&gt;qwen auth&lt;/code&gt; CLI command has been removed in the current documentation. The interactive &lt;code&gt;/auth&lt;/code&gt; command is entered &lt;strong&gt;inside Qwen Code&lt;/strong&gt;, not directly in your shell.&lt;/p&gt;

&lt;p&gt;Official reference: &lt;a href="https://github.com/QwenLM/qwen-code/blob/main/docs/users/configuration/auth.md" rel="noopener noreferrer"&gt;Qwen Code Authentication&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Check your connection and select a model
&lt;/h2&gt;

&lt;p&gt;Once authentication is complete, you can use these commands inside Qwen Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/doctor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check your environment and authentication configuration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/model
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Choose from the models available through your configured providers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/help
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Show the currently available commands.&lt;/p&gt;

&lt;p&gt;Before running an expensive repository-wide task, try a small request first.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Inspect this repository and explain its main modules. Do not modify any files.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then verify that the selected model responds correctly and that the provider's usage is being recorded as expected.&lt;/p&gt;

&lt;p&gt;Never commit your API keys to a Git repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Which setup should you choose?
&lt;/h2&gt;

&lt;p&gt;Here's a practical way to decide:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You already pay for an API provider:&lt;/strong&gt; Check whether Qwen Code supports that provider and whether your existing credentials are eligible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You want predictable usage within an included quota:&lt;/strong&gt; Compare the current subscription and quota terms of the relevant QwenCloud or Alibaba ModelStudio plan.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You prefer usage-based billing:&lt;/strong&gt; Choose an appropriate Standard API Key or usage-based provider connection.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You want to run models locally:&lt;/strong&gt; Check your available hardware, local inference server, model compatibility, and offline requirements.&lt;/p&gt;

&lt;p&gt;There isn't one universally cheapest option. The total cost depends on the model, workload, quota, cache behavior, and provider terms.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. A final recommendation
&lt;/h2&gt;

&lt;p&gt;Before committing to a paid plan, do three things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Confirm that your intended model is supported by your chosen provider.&lt;/li&gt;
&lt;li&gt;Run a small real coding task and inspect the result.&lt;/li&gt;
&lt;li&gt;Check the provider's billing dashboard or quota usage.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A free client is useful, but the right model connection determines much of the actual experience and cost.&lt;/p&gt;

&lt;p&gt;For a source-backed overview of Qwen Code, including its model and API relationships, I've also put together a reference page on &lt;a href="https://iilib.com/agents/qwen-code?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=qwen_code_setup_202611" rel="noopener noreferrer"&gt;iilib — Qwen Code&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Official references
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/QwenLM/qwen-code/blob/main/docs/users/quickstart.md" rel="noopener noreferrer"&gt;Qwen Code Quickstart&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/QwenLM/qwen-code/blob/main/docs/users/configuration/auth.md" rel="noopener noreferrer"&gt;Qwen Code Authentication&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/QwenLM/qwen-code/blob/main/docs/users/configuration/model-providers.md" rel="noopener noreferrer"&gt;Qwen Code Model Providers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Documentation reviewed: November 2026. Model availability, authentication options and pricing may change.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which provider are you using with Qwen Code, and what has your setup experience been like?&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>What Can $10 Buy Across Different LLM APIs?</title>
      <dc:creator>Adam Z</dc:creator>
      <pubDate>Wed, 07 Oct 2026 02:37:32 +0000</pubDate>
      <link>https://dev.to/adam_z/what-can-10-buy-across-different-llm-apis-4i1n</link>
      <guid>https://dev.to/adam_z/what-can-10-buy-across-different-llm-apis-4i1n</guid>
      <description>&lt;p&gt;LLM API pricing pages usually quote prices per million tokens.&lt;/p&gt;

&lt;p&gt;That is useful for billing, but it is not always the easiest way to think about cost when building an application.&lt;/p&gt;

&lt;p&gt;A question I find more intuitive is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If I have a $10 API budget, how many real requests can I make?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The answer depends heavily on the ratio between input and output tokens.&lt;/p&gt;

&lt;p&gt;Let's use one simple workload and compare a few models.&lt;/p&gt;

&lt;h2&gt;
  
  
  The workload
&lt;/h2&gt;

&lt;p&gt;Assume each API request contains:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;4,000 input tokens
1,000 output tokens
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That gives us a 5,000-token request with an 80/20 input-output split.&lt;/p&gt;

&lt;p&gt;For this comparison, I am using the pricing currently recorded in my dataset:&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 / 1M tokens&lt;/th&gt;
&lt;th&gt;Output / 1M tokens&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GPT-6 Luna&lt;/td&gt;
&lt;td&gt;$0.10&lt;/td&gt;
&lt;td&gt;$0.50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemini 3.8 Flash&lt;/td&gt;
&lt;td&gt;$0.75&lt;/td&gt;
&lt;td&gt;$3.75&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Claude Sonnet 5.5&lt;/td&gt;
&lt;td&gt;$2.00&lt;/td&gt;
&lt;td&gt;$10.00&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These are standard token rates and do not include special long-context tiers or other processing modes.&lt;/p&gt;

&lt;p&gt;Now let's turn those prices into something more concrete.&lt;/p&gt;

&lt;h2&gt;
  
  
  GPT-6 Luna
&lt;/h2&gt;

&lt;p&gt;For one request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Input:
4,000 / 1,000,000 × $0.10
= $0.0004

Output:
1,000 / 1,000,000 × $0.50
= $0.0005

Total:
$0.0009 per request
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With a $10 budget:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$10 / $0.0009
≈ 11,111 requests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is roughly:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;44.4 million input tokens&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;and&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11.1 million output tokens&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;for the $10 budget.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gemini 3.8 Flash
&lt;/h2&gt;

&lt;p&gt;Now run exactly the same workload through Gemini 3.8 Flash.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Input:
4,000 / 1,000,000 × $0.75
= $0.003

Output:
1,000 / 1,000,000 × $3.75
= $0.00375

Total:
$0.00675 per request
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With $10:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$10 / $0.00675
≈ 1,481 requests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same workload.&lt;/p&gt;

&lt;p&gt;Same $10.&lt;/p&gt;

&lt;p&gt;Very different request capacity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Claude Sonnet 5.5
&lt;/h2&gt;

&lt;p&gt;For Claude Sonnet 5.5:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Input:
4,000 / 1,000,000 × $2
= $0.008

Output:
1,000 / 1,000,000 × $10
= $0.01

Total:
$0.018 per request
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A $10 budget gives approximately:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$10 / $0.018
≈ 556 requests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So for this particular workload:&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;Approx. requests for $10&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GPT-6 Luna&lt;/td&gt;
&lt;td&gt;11,111&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemini 3.8 Flash&lt;/td&gt;
&lt;td&gt;1,481&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Claude Sonnet 5.5&lt;/td&gt;
&lt;td&gt;556&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That difference is large enough to matter when an application moves from experimentation to production traffic.&lt;/p&gt;

&lt;p&gt;But this table does &lt;strong&gt;not&lt;/strong&gt; mean GPT-6 Luna is automatically the best choice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cheap tokens do not necessarily mean cheap tasks
&lt;/h2&gt;

&lt;p&gt;Imagine Model A needs one request to solve a coding task.&lt;/p&gt;

&lt;p&gt;Model B is cheaper per token but needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;three retries&lt;/li&gt;
&lt;li&gt;a longer system prompt&lt;/li&gt;
&lt;li&gt;more tool calls&lt;/li&gt;
&lt;li&gt;more generated tokens&lt;/li&gt;
&lt;li&gt;an additional verification pass&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Model B may still produce a higher total cost per completed task.&lt;/p&gt;

&lt;p&gt;This is why I think there are two separate questions developers should ask.&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 1: What does one request cost?
&lt;/h3&gt;

&lt;p&gt;That is mostly arithmetic.&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 2: How many requests does the application need to complete the task?
&lt;/h3&gt;

&lt;p&gt;That is an evaluation problem.&lt;/p&gt;

&lt;p&gt;Token price answers the first question.&lt;/p&gt;

&lt;p&gt;It does not answer the second.&lt;/p&gt;

&lt;h2&gt;
  
  
  Output tokens deserve more attention
&lt;/h2&gt;

&lt;p&gt;There is another interesting detail in the example.&lt;/p&gt;

&lt;p&gt;The request contains four times as many input tokens as output tokens:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;4,000 input
1,000 output
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Yet for all three models in this example, the output portion costs more per token.&lt;/p&gt;

&lt;p&gt;For Claude Sonnet 5.5, the single request costs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Input:  $0.008
Output: $0.010
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So only 20% of the tokens account for more than half of the cost.&lt;/p&gt;

&lt;p&gt;This makes output control surprisingly important.&lt;/p&gt;

&lt;p&gt;If an agent produces verbose intermediate reasoning, oversized summaries, unnecessary code explanations, or repeated generated content, reducing output may save more money than aggressively shortening the prompt.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens at production scale?
&lt;/h2&gt;

&lt;p&gt;A $10 experiment may not sound important.&lt;/p&gt;

&lt;p&gt;Now imagine the application processes 100,000 of these requests.&lt;/p&gt;

&lt;p&gt;Using the same 4,000-input / 1,000-output workload:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GPT-6 Luna:
100,000 × $0.0009
≈ $90

Gemini 3.8 Flash:
100,000 × $0.00675
≈ $675

Claude Sonnet 5.5:
100,000 × $0.018
≈ $1,800
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At that point model choice is no longer a minor implementation detail.&lt;/p&gt;

&lt;p&gt;It becomes part of the product economics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Caching can change the calculation
&lt;/h2&gt;

&lt;p&gt;The examples above assume all input is charged at the standard input rate.&lt;/p&gt;

&lt;p&gt;Real applications can be different.&lt;/p&gt;

&lt;p&gt;Many agent workloads repeatedly send information such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;system instructions&lt;/li&gt;
&lt;li&gt;coding conventions&lt;/li&gt;
&lt;li&gt;repository context&lt;/li&gt;
&lt;li&gt;long reference documents&lt;/li&gt;
&lt;li&gt;tool definitions&lt;/li&gt;
&lt;li&gt;shared conversation context&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When an API supports discounted cached input, part of that input may become significantly cheaper.&lt;/p&gt;

&lt;p&gt;So a more complete calculation looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Total cost =
  normal input tokens × input price
+ cached input tokens × cached price
+ output tokens × output price
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For applications with large reusable prompts, caching can materially change the economics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context-window size is not a price guarantee
&lt;/h2&gt;

&lt;p&gt;Another thing I try not to assume is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This model supports a one-million-token context window, therefore one million tokens always cost the normal input rate.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Providers can have special pricing rules for large contexts, different processing tiers, batch workloads, caching, or other modes.&lt;/p&gt;

&lt;p&gt;A model's context window tells you what is technically possible.&lt;/p&gt;

&lt;p&gt;It does not necessarily tell you what that workload will cost.&lt;/p&gt;

&lt;p&gt;That is why pricing comparisons should preserve the provider source and the date when the pricing was verified.&lt;/p&gt;

&lt;h2&gt;
  
  
  Turning the calculation into a small tool
&lt;/h2&gt;

&lt;p&gt;I was repeatedly doing calculations like these manually, so I built a simple &lt;a href="https://iilib.com/workbench/llm-api-cost" rel="noopener noreferrer"&gt;LLM API Cost Calculator&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Instead of asking only for a model price, it lets you enter a workload:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;input tokens / request
cached input tokens / request
output tokens / request
number of requests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is also a budget-oriented way to think about the problem: start with a fixed amount of money and estimate the workload capacity.&lt;/p&gt;

&lt;p&gt;I deliberately keep the pricing source and verification date next to the results because a perfectly accurate calculation based on outdated pricing is still a wrong answer.&lt;/p&gt;

&lt;p&gt;The underlying rates are also available separately in the &lt;a href="https://iilib.com/research/llm-api-pricing" rel="noopener noreferrer"&gt;LLM API Pricing reference&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The metric I actually care about
&lt;/h2&gt;

&lt;p&gt;After looking at enough pricing tables, I have become less interested in:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Which model has the cheapest token?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The metric I would rather know is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How much does it cost to successfully complete one useful task?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For some applications, a very inexpensive model will win.&lt;/p&gt;

&lt;p&gt;For others, paying more for a model that completes the task reliably in fewer steps may be cheaper overall.&lt;/p&gt;

&lt;p&gt;A useful evaluation therefore needs both:&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 request
×
requests per successful task
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That gets much closer to the economics of a real AI application than a simple price-per-million-token leaderboard.&lt;/p&gt;




&lt;p&gt;Pricing changes frequently. The figures above reflect the pricing data I was using in October 2026. Always verify current provider pricing and pricing conditions before making production cost decisions.&lt;/p&gt;

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