<?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: Martin Jones</title>
    <description>The latest articles on DEV Community by Martin Jones (@martin_jones_5af8a972f62a).</description>
    <link>https://dev.to/martin_jones_5af8a972f62a</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%2F4267324%2F8553d5ba-8058-4fbd-803b-206ac4485898.png</url>
      <title>DEV Community: Martin Jones</title>
      <link>https://dev.to/martin_jones_5af8a972f62a</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/martin_jones_5af8a972f62a"/>
    <language>en</language>
    <item>
      <title>How to Cut LLM API Costs by 50–75% Using Prompt Caching &amp; DeepSeek Off-Peak Windows</title>
      <dc:creator>Martin Jones</dc:creator>
      <pubDate>Thu, 26 Nov 2026 16:40:10 +0000</pubDate>
      <link>https://dev.to/martin_jones_5af8a972f62a/how-to-cut-llm-api-costs-by-50-75-using-prompt-caching-deepseek-off-peak-windows-gbf</link>
      <guid>https://dev.to/martin_jones_5af8a972f62a/how-to-cut-llm-api-costs-by-50-75-using-prompt-caching-deepseek-off-peak-windows-gbf</guid>
      <description>&lt;p&gt;markdown&lt;br&gt;
If you are building production apps with large language models, token costs add up fast—especially once your system prompts grow past a few thousand tokens or you start running high-volume batch jobs.&lt;/p&gt;

&lt;p&gt;Most developers just glance at a model's base per-million-token price, multiply by their rough prompt size, and call it a day. In practice, three variables change your real monthly bill dramatically: &lt;strong&gt;output token multipliers&lt;/strong&gt;, &lt;strong&gt;prompt caching discounts&lt;/strong&gt;, and &lt;strong&gt;time-of-day off-peak pricing&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  1. Output Tokens Cost 3x–5x More Than Input Tokens
&lt;/h3&gt;

&lt;p&gt;Input tokens (your system instructions, retrieved RAG documents, and user prompt) are relatively cheap. Output tokens (what the model generates back) are where budgets usually blow up.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;If your app summarizes long documents (&lt;strong&gt;0.25x output ratio&lt;/strong&gt;), input pricing dominates your bill.&lt;/li&gt;
&lt;li&gt;If your app generates code, JSON payloads, or long-form articles (&lt;strong&gt;2x–4x output ratio&lt;/strong&gt;), a model with a slightly higher output rate can double your monthly spend.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  2. Prompt Caching Cuts Repeated Input Costs by 75%+
&lt;/h3&gt;

&lt;p&gt;If every API request sends the same 8,000-token system prompt, schema definition, or few-shot examples, paying full input price on every call is wasted money.&lt;/p&gt;

&lt;p&gt;Modern frontier APIs (including OpenAI, Anthropic, and DeepSeek) support &lt;strong&gt;Prompt Caching&lt;/strong&gt;, which discounts repeated prefix tokens by &lt;strong&gt;75% or more&lt;/strong&gt; once cached. On high-volume endpoints, enabling prompt caching is often the single highest-ROI optimization you can make without changing models.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. DeepSeek's 16:30–00:30 UTC Off-Peak Window (-50%)
&lt;/h3&gt;

&lt;p&gt;For asynchronous workloads—like nightly data extraction, embeddings prep, bulk classification, or evaluation runs—you don't need real-time daytime responses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DeepSeek V4 Pro&lt;/strong&gt; offers a daily off-peak discount window from &lt;strong&gt;16:30 to 00:30 UTC&lt;/strong&gt;, cutting both input and output token rates by &lt;strong&gt;50%&lt;/strong&gt;. If you schedule cron jobs or batch pipelines inside that 8-hour UTC window, you instantly cut your inference bill in half.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(Tip: You can check exact UTC conversions and peak vs. off-peak rate breakdowns in this &lt;a href="https://aitokencalctool.com" rel="noopener noreferrer"&gt;DeepSeek Off-Peak Pricing Guide&lt;/a&gt;.)&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Test Your Own Prompts Without Uploading Private Data
&lt;/h3&gt;

&lt;p&gt;When I started comparing these variables across models, I ran into an annoying problem: almost every online token counter sends your pasted text to a backend server. If you are working with proprietary prompts, customer data, or private codebases, that is a non-starter.&lt;/p&gt;

&lt;p&gt;To fix that, I built &lt;strong&gt;&lt;a href="https://aitokencalctool.com" rel="noopener noreferrer"&gt;AI Token Calc Tool&lt;/a&gt;&lt;/strong&gt;—a lightweight, &lt;strong&gt;100% client-side&lt;/strong&gt; token counter and live API cost estimator:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero server uploads:&lt;/strong&gt; Everything runs locally in your browser using JavaScript. Your prompts never leave your machine.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Side-by-side model comparison:&lt;/strong&gt; Compare live costs across GPT-6.1 Sol, GPT-6 Luna, Claude Sonnet 5.5, Gemini 3.6 Flash, DeepSeek V4 Pro, Grok 4.7, and Llama 3.3 70B.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real production toggles:&lt;/strong&gt; Switch &lt;strong&gt;Prompt Caching (-75%)&lt;/strong&gt; on/off, adjust the &lt;strong&gt;Output Ratio (0.25x–4x)&lt;/strong&gt;, scale monthly request volume, and export your breakdown to CSV.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live UTC Off-Peak Detector:&lt;/strong&gt; Automatically checks the current UTC clock to show whether DeepSeek's 50% off-peak discount is active right now.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 &lt;strong&gt;Try it here:&lt;/strong&gt; &lt;a href="https://aitokencalctool.com" rel="noopener noreferrer"&gt;https://aitokencalctool.com&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  What Models or Pricing Quirks Should I Add Next?
&lt;/h3&gt;

&lt;p&gt;I'm actively updating the model rates and calculator features. If you're runnin&lt;/p&gt;

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