<?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: PIN FU</title>
    <description>The latest articles on DEV Community by PIN FU (@ai8888uk).</description>
    <link>https://dev.to/ai8888uk</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%2F4259580%2F11e6cb48-63dc-4c60-b0ca-3bd8f164464e.png</url>
      <title>DEV Community: PIN FU</title>
      <link>https://dev.to/ai8888uk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ai8888uk"/>
    <language>en</language>
    <item>
      <title>One API key, 500+ models: a practical gateway setup for small teams</title>
      <dc:creator>PIN FU</dc:creator>
      <pubDate>Mon, 23 Nov 2026 02:55:15 +0000</pubDate>
      <link>https://dev.to/ai8888uk/one-api-key-500-models-a-practical-gateway-setup-for-small-teams-286f</link>
      <guid>https://dev.to/ai8888uk/one-api-key-500-models-a-practical-gateway-setup-for-small-teams-286f</guid>
      <description>&lt;p&gt;Most teams do not need another AI vendor. They need one key that reaches many models, and a bill they can explain.&lt;/p&gt;

&lt;p&gt;That is the whole pitch behind Ai8888.uk, and this post is the engineering version of it: what we wired, what broke, and what we would check before trusting any gateway with production traffic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a gateway instead of five SDKs
&lt;/h2&gt;

&lt;p&gt;A typical product team ends up with a chat model for drafting, a stronger model for hard requests, an embedding model for search, an image model for the interface, and something for voice or video. Five vendors means five SDKs, five retry policies, five rate-limit shapes and five invoices.&lt;/p&gt;

&lt;p&gt;An OpenAI-compatible gateway collapses that into one base URL and one key. Existing code keeps working, because the request and response shapes are already familiar. Switching a model becomes a string change, not a migration project.&lt;/p&gt;

&lt;h2&gt;
  
  
  The four things that actually matter
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Protocol parity. Streaming, tool calls, JSON mode, vision inputs and token accounting need to behave the same way across providers. If one model silently drops a tool call, your agent fails in a way that looks like a prompt bug.&lt;/li&gt;
&lt;li&gt;Model routing you can read. A routing table should be a file, not folklore. Alias names should map to concrete provider models, with a fallback chain and a visible reason for every fallback.&lt;/li&gt;
&lt;li&gt;Failure behaviour. Timeouts, 429s and provider outages must surface as structured errors with a retry hint. Silent retries hide capacity problems until the invoice arrives.&lt;/li&gt;
&lt;li&gt;Cost visibility. Per-key and per-model usage, with the same unit everywhere. Tokens are not money, but they are the only thing you can attribute before the bill lands.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  A minimal setup that survives contact with users
&lt;/h2&gt;

&lt;p&gt;Start with three aliases: a fast chat model, a strong reasoning model, and an embedding model. Point your app at the fast one by default. Route the hard 10% explicitly. Keep the strong model out of background jobs until you have measured cost per request.&lt;/p&gt;

&lt;p&gt;Then add two habits:&lt;/p&gt;

&lt;p&gt;Log the alias, the resolved provider model, latency and token counts for every call. When quality drops, you can answer "which model actually served this?" in one query.&lt;br&gt;
Keep one eval set of twenty real prompts. Run it after any routing change. Most gateway incidents are routing incidents, not model incidents.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we got wrong at first
&lt;/h2&gt;

&lt;p&gt;We started with too many aliases. Every team invented their own names, and nobody could tell which provider a request hit. We cut it to a small, documented set and put the routing table under review.&lt;/p&gt;

&lt;p&gt;We also treated 429s as noise. They were not. They were the first signal that one provider's quota was being consumed by background jobs. Separating interactive and batch keys fixed it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where this fits
&lt;/h2&gt;

&lt;p&gt;If you are building a product and want to try many models without rewriting your stack, an OpenAI-compatible endpoint is the least dramatic upgrade you can make. Keep your client code. Change the base URL, pick an alias, and measure.&lt;/p&gt;

&lt;p&gt;You can try the hosted version here: &lt;a href="https://ai8888.uk/?utm_source=devto&amp;amp;utm_medium=social&amp;amp;utm_campaign=launch_2026q4&amp;amp;utm_content=gateway_notes" rel="noopener noreferrer"&gt;https://ai8888.uk/?utm_source=devto&amp;amp;utm_medium=social&amp;amp;utm_campaign=launch_2026q4&amp;amp;utm_content=gateway_notes&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are already running a gateway, I would like to hear which failure mode bit you first: protocol drift, routing surprises, or quota accounting.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>500+ models behind one OpenAI-compatible key: the plumbing notes</title>
      <dc:creator>PIN FU</dc:creator>
      <pubDate>Mon, 23 Nov 2026 02:46:00 +0000</pubDate>
      <link>https://dev.to/ai8888uk/500-models-behind-one-openai-compatible-key-the-plumbing-notes-4ab5</link>
      <guid>https://dev.to/ai8888uk/500-models-behind-one-openai-compatible-key-the-plumbing-notes-4ab5</guid>
      <description>&lt;p&gt;Dev.to has plenty of "here is my AI stack" posts. This one is about the part that survives: the protocol.&lt;/p&gt;

&lt;p&gt;If two vendors speak different protocols you do not have one stack, you have two stacks and a translation layer you maintain by hand. Everything below follows from that.&lt;/p&gt;

&lt;p&gt;This post is about the plumbing: what an AI gateway actually does, where it helps, and where it quietly hurts.&lt;/p&gt;

&lt;h2&gt;
  
  
  The shape of the problem
&lt;/h2&gt;

&lt;p&gt;A normal AI feature needs more than one model:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a cheap chat model for drafting&lt;/li&gt;
&lt;li&gt;a strong model for the hard 10% of requests&lt;/li&gt;
&lt;li&gt;an embedding model for retrieval&lt;/li&gt;
&lt;li&gt;an image model for the UI&lt;/li&gt;
&lt;li&gt;increasingly, a video or music model for marketing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each one arrives with its own SDK, auth scheme, rate limits, error format, and billing unit. Four vendors means four ways to fail.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a gateway buys you
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. One client, many models.&lt;/strong&gt; If the gateway speaks the OpenAI API, your existing code works. Switching models is a string.&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://ai8888.uk/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="c1"&gt;# cheap pass&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;"fast-chat"&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="n"&gt;msgs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# hard pass&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;"best-reasoning"&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="n"&gt;msgs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Stable aliases.&lt;/strong&gt; Upstream model IDs change every few weeks. Aliases like &lt;code&gt;fast-chat&lt;/code&gt; and &lt;code&gt;best-image&lt;/code&gt; let you swap the target without touching a single line of client code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Failover.&lt;/strong&gt; When one provider 500s, a gateway can retry the next best provider for the same capability. That is the difference between "the feature is down" and "that answer came from a different model".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. One place to cap spend.&lt;/strong&gt; Per-key quotas and spend caps beat four dashboards and a monthly surprise.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a gateway costs you
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A hop.&lt;/strong&gt; Extra latency, usually small, occasionally not.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A dependency.&lt;/strong&gt; If the gateway is down, everything is down. Ask about failover before you commit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Abstraction loss.&lt;/strong&gt; Provider-specific features (a particular tool-calling dialect, a particular image parameter) may not survive the translation layer.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The part nobody writes about: non-developers
&lt;/h2&gt;

&lt;p&gt;Half the people who need these models will never open a terminal. A gateway that only ships an API leaves them out, and you end up buying a separate consumer subscription anyway.&lt;/p&gt;

&lt;p&gt;What worked for me: one account that serves both. Devs get a key, everyone else gets a web app, and both hit the same catalogue and the same bill. It sounds trivial. It removed an entire category of "can you generate this for me" requests.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I would evaluate any gateway
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Does it speak the OpenAI API without a shim?&lt;/li&gt;
&lt;li&gt;Are aliases stable, and is there a changelog when they move?&lt;/li&gt;
&lt;li&gt;What happens on provider 500 — retry, failover, or error?&lt;/li&gt;
&lt;li&gt;Is there a per-key spend cap?&lt;/li&gt;
&lt;li&gt;Can a non-developer use the same account?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If a vendor cannot answer #3 in one sentence, keep looking.&lt;/p&gt;




&lt;p&gt;If you take one thing away: measure what a model change costs you. If it is a refactor, you are not evaluating models, you are evaluating vendors.&lt;/p&gt;

&lt;p&gt;I ended up building this for myself and it is now at &lt;a href="https://ai8888.uk/?utm_source=devto&amp;amp;utm_medium=social&amp;amp;utm_campaign=launch_2026q4&amp;amp;utm_content=article" rel="noopener noreferrer"&gt;https://ai8888.uk/?utm_source=devto&amp;amp;utm_medium=social&amp;amp;utm_campaign=launch_2026q4&amp;amp;utm_content=article&lt;/a&gt; — 500+ models across chat, image, video, music and voice, one key, plus the web app. Feedback welcome; the alias design is the part I am least sure about.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>api</category>
      <category>architecture</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
