<?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: QAZ1214430044</title>
    <description>The latest articles on DEV Community by QAZ1214430044 (@qaz1214430044).</description>
    <link>https://dev.to/qaz1214430044</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%2F4026082%2Fe36c13e3-d481-4673-99fd-c9511d4e69b1.png</url>
      <title>DEV Community: QAZ1214430044</title>
      <link>https://dev.to/qaz1214430044</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/qaz1214430044"/>
    <language>en</language>
    <item>
      <title>I Built an OpenAI-Compatible Gateway to Control LLM Costs</title>
      <dc:creator>QAZ1214430044</dc:creator>
      <pubDate>Wed, 15 Jul 2026 15:24:59 +0000</pubDate>
      <link>https://dev.to/qaz1214430044/i-built-an-openai-compatible-gateway-to-control-llm-costs-2ppm</link>
      <guid>https://dev.to/qaz1214430044/i-built-an-openai-compatible-gateway-to-control-llm-costs-2ppm</guid>
      <description>

&lt;p&gt;As an indie developer building AI products, I kept hitting the same wall: &lt;strong&gt;how do I control LLM costs without vendor lock-in?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Direct API keys meant zero visibility into per-project spending. Month-end surprise bills. No way to cap costs per feature. Rate limit headaches.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;CostLLM&lt;/strong&gt; — an OpenAI-compatible API gateway that sits between your code and the LLM provider.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Virtual API Keys&lt;/strong&gt; — Create separate keys per project, environment, or team member&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Usage Tracking&lt;/strong&gt; — Real-time token consumption dashboard&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Budget Controls&lt;/strong&gt; — Hard caps prevent overspend&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rate Limiting&lt;/strong&gt; — Configurable per key&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Drop-in Compatibility&lt;/strong&gt; — Works with any OpenAI SDK&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  One line change
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Before
&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sk-proj-...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# After
&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://api.costllm.ai/v1&lt;/span&gt;&lt;span class="sh"&gt;"&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;YOUR_COSTLLM_API_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Built with
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Python (FastAPI) gateway + backend&lt;/li&gt;
&lt;li&gt;Redis for rate limiting&lt;/li&gt;
&lt;li&gt;PostgreSQL for user &amp;amp; usage data&lt;/li&gt;
&lt;li&gt;Nginx reverse proxy&lt;/li&gt;
&lt;li&gt;Creem for payments&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Supported models
&lt;/h2&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;Type&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;deepseek-v4-flash&lt;/td&gt;
&lt;td&gt;Fast chat&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;deepseek-v4-pro&lt;/td&gt;
&lt;td&gt;Complex reasoning&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;deepseek-chat&lt;/td&gt;
&lt;td&gt;General purpose&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;deepseek-reasoner&lt;/td&gt;
&lt;td&gt;Deep analysis&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;Building a production API gateway taught me a lot about concurrency, streaming, error handling, and payment webhooks. The hardest part wasn't the code — it was designing a pricing model that works for both free users and growing teams.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Website: &lt;a href="https://costllm.ai" rel="noopener noreferrer"&gt;https://costllm.ai&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;API docs: &lt;a href="https://documenter.getpostman.com/view/56610873/2sBY4MtfzU" rel="noopener noreferrer"&gt;https://documenter.getpostman.com/view/56610873/2sBY4MtfzU&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Free tier: $10 signup credit, no credit card required&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'd love feedback from other developers working with LLM APIs — especially around cost visibility, key management, and what you'd want from a gateway.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>api</category>
      <category>devtools</category>
    </item>
    <item>
      <title>Building CostLLM: An OpenAI-Compatible API Gateway for Lower-Cost AI Usage</title>
      <dc:creator>QAZ1214430044</dc:creator>
      <pubDate>Sun, 12 Jul 2026 13:40:46 +0000</pubDate>
      <link>https://dev.to/qaz1214430044/building-costllm-an-openai-compatible-api-gateway-for-lower-cost-ai-usage-4hol</link>
      <guid>https://dev.to/qaz1214430044/building-costllm-an-openai-compatible-api-gateway-for-lower-cost-ai-usage-4hol</guid>
      <description></description>
    </item>
  </channel>
</rss>
