<?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: llong</title>
    <description>The latest articles on DEV Community by llong (@dragonlin).</description>
    <link>https://dev.to/dragonlin</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%2F4127937%2F73c040bc-bf95-4586-ba23-d5a2ce17fd6c.png</url>
      <title>DEV Community: llong</title>
      <link>https://dev.to/dragonlin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dragonlin"/>
    <language>en</language>
    <item>
      <title>One API Key for Every LLM: Build Once, Call GPT, Claude &amp; More from a Single Endpoint</title>
      <dc:creator>llong</dc:creator>
      <pubDate>Sat, 19 Sep 2026 12:11:21 +0000</pubDate>
      <link>https://dev.to/dragonlin/one-api-key-for-every-llm-build-once-call-gpt-claude-more-from-a-single-endpoint-5f64</link>
      <guid>https://dev.to/dragonlin/one-api-key-for-every-llm-build-once-call-gpt-claude-more-from-a-single-endpoint-5f64</guid>
      <description>&lt;p&gt;If you build AI products, you have probably felt this: every model provider ships its own SDK, its own auth, its own billing dashboard. GPT here, Claude there, Gemini somewhere else — and your codebase fills up with provider-specific glue.&lt;/p&gt;

&lt;p&gt;It doesn't have to be that way.&lt;/p&gt;

&lt;p&gt;In this post I will show the pattern that lets you treat every major LLM as a drop-in replacement behind one OpenAI-compatible endpoint — same code, one key, one bill — and how routing plus automatic failover make it more reliable than pinning your app to a single provider.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why multi-model is the default now
&lt;/h2&gt;

&lt;p&gt;Most builders do not use a single model anymore. The &lt;a href="https://aitalent.genaifund.ai/report-2026" rel="noopener noreferrer"&gt;GenAI Fund 2026 State of AI Builders in Southeast Asia report&lt;/a&gt; (2,719 builders) found:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;81.7%&lt;/strong&gt; of builders use more than one AI platform — multi-homing is the default&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;77.9%&lt;/strong&gt; use OpenAI, &lt;strong&gt;76.6%&lt;/strong&gt; use Claude, &lt;strong&gt;61.1%&lt;/strong&gt; use Gemini — near-parity across the big three&lt;/li&gt;
&lt;li&gt;The most common project types: AI agents (18%), automation and workflows (15%), chatbots (10%)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the real problem is not "which model should I pick" — it is managing five SDKs, five API keys, and five invoices.&lt;/p&gt;

&lt;h2&gt;
  
  
  The integration mess
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Provider&lt;/th&gt;
&lt;th&gt;SDK&lt;/th&gt;
&lt;th&gt;Auth style&lt;/th&gt;
&lt;th&gt;Billing&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;OpenAI&lt;/td&gt;
&lt;td&gt;&lt;code&gt;openai&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;API key&lt;/td&gt;
&lt;td&gt;per-token&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Anthropic&lt;/td&gt;
&lt;td&gt;&lt;code&gt;anthropic&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;x-api-key&lt;/code&gt; header&lt;/td&gt;
&lt;td&gt;per-token&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Google&lt;/td&gt;
&lt;td&gt;&lt;code&gt;google-genai&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;API key&lt;/td&gt;
&lt;td&gt;per-token&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Every provider means another dependency, another error-handling path, another rate-limit policy, another team to teach.&lt;/p&gt;

&lt;h2&gt;
  
  
  The standard answer: OpenAI-compatible endpoints
&lt;/h2&gt;

&lt;p&gt;Most gateways today expose an OpenAI-compatible REST API. If you already use the OpenAI SDK, switching models becomes a two-line change:&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="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&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;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-your-key&lt;/span&gt;&lt;span class="sh"&gt;"&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://your-gateway.example/v1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# from your gateway dashboard
&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;resp&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;claude-sonnet-4-5&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# or gpt-4o, gemini-2.5-pro, ...
&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change the &lt;code&gt;model&lt;/code&gt; name, keep the code. Your application does not care which upstream actually answered.&lt;/p&gt;

&lt;h2&gt;
  
  
  The level-up: routing and automatic failover
&lt;/h2&gt;

&lt;p&gt;A single endpoint that sits in front of multiple upstream accounts gives you two things you rarely get from one provider account:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Automatic failover&lt;/strong&gt; — if an upstream is rate-limited or down, the gateway retries on another. Your users see no error.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost control&lt;/strong&gt; — usage-based billing with quota limits, plus a dashboard showing exactly what each team or project consumed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is the pattern behind &lt;a href="https://www.agentoken.co" rel="noopener noreferrer"&gt;Agent Token&lt;/a&gt;, an LLM API gateway marketplace: one API key for Claude, GPT, Gemini and more, with smart routing across upstream accounts, automatic failover, pay-as-you-go billing, quota limits, and team usage visibility.&lt;/p&gt;

&lt;h2&gt;
  
  
  The payment problem (especially in Southeast Asia)
&lt;/h2&gt;

&lt;p&gt;For indie developers and small startups in Southeast Asia, the friction is not only code — it is payments. Many do not have the international credit cards required to open accounts with US-based providers. A unified gateway changes the math: sign up once, top up once, and switch between models without registering each upstream provider separately.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started in 3 steps
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Sign up at &lt;a href="https://www.agentoken.co" rel="noopener noreferrer"&gt;agentoken.co&lt;/a&gt; and create an API key&lt;/li&gt;
&lt;li&gt;Point your existing OpenAI-compatible client at the gateway base URL&lt;/li&gt;
&lt;li&gt;Set a spending quota so you never get a surprise bill
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;sk-xxx
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OPENAI_BASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;https://your-gateway.example/v1   &lt;span class="c"&gt;# from your dashboard&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Done — the same code now talks to GPT, Claude, Gemini, and more.&lt;/p&gt;

&lt;h2&gt;
  
  
  A note on responsible use
&lt;/h2&gt;

&lt;p&gt;Before routing heavy production traffic through any gateway, review the upstream providers' terms of service, and keep your own keys and quotas tight. A gateway is a tool for reducing integration overhead — not for bypassing a provider's rules.&lt;/p&gt;

&lt;h2&gt;
  
  
  When you should NOT use a relay
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You need a specific provider's enterprise SLA or DPA → go direct.&lt;/li&gt;
&lt;li&gt;You handle sensitive data with strict residency requirements → verify where the gateway routes.&lt;/li&gt;
&lt;li&gt;Tiny hobby project with a single model → direct access is fine.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wrap up
&lt;/h2&gt;

&lt;p&gt;Multi-model is the default. The gateway pattern removes SDK and billing sprawl, adds failover, and is one &lt;code&gt;base_url&lt;/code&gt; change away from your current code.&lt;/p&gt;

&lt;p&gt;If you are building agents, chatbots, or automation in Southeast Asia and want one endpoint for multiple models, give &lt;a href="https://www.agentoken.co" rel="noopener noreferrer"&gt;Agent Token&lt;/a&gt; a try — and drop a comment about what you are building. I read them all.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>tutorial</category>
      <category>ai</category>
      <category>api</category>
    </item>
    <item>
      <title>Low‑cost LLM Token Access for Southeast‑Asia Developers</title>
      <dc:creator>llong</dc:creator>
      <pubDate>Wed, 16 Sep 2026 11:26:16 +0000</pubDate>
      <link>https://dev.to/dragonlin/low-cost-llm-token-access-for-southeast-asia-developers-3o31</link>
      <guid>https://dev.to/dragonlin/low-cost-llm-token-access-for-southeast-asia-developers-3o31</guid>
      <description>&lt;h2&gt;
  
  
  About Agentoken: &lt;a href="https://www.agentoken.co" rel="noopener noreferrer"&gt;https://www.agentoken.co&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Agentoken&lt;/strong&gt; is a global LLM token marketplace and unified API gateway built for developers, especially targeting Southeast‑Asia indie developers and small‑size startups.&lt;/p&gt;

&lt;p&gt;👉 Website: &lt;a href="https://www.agentoken.co" rel="noopener noreferrer"&gt;https://www.agentoken.co&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Core capabilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multi-model access in one dashboard, switch models easily&lt;/li&gt;
&lt;li&gt;Pay‑as‑you‑go pricing based on actual input &amp;amp; output token consumption&lt;/li&gt;
&lt;li&gt;Prompt caching support to reduce costs for multi‑turn conversations and AI agents&lt;/li&gt;
&lt;li&gt;Visual dashboard for real‑time token usage, call logs and expense auditing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Who is it built for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Indie developers building chatbots and AI agent prototypes&lt;/li&gt;
&lt;li&gt;Small startup teams running AI services in Southeast Asia&lt;/li&gt;
&lt;li&gt;Developers evaluating different LLMs without registering every upstream provider separately&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Closing thoughts
&lt;/h2&gt;

&lt;p&gt;For Southeast‑Asia developers, you no longer need to maintain dozens of API accounts to test different LLMs. Agentoken puts Xiaomi MIMO, OpenAI GPT, Grok, Zhipu GLM and more under one compatible endpoint.&lt;/p&gt;

&lt;p&gt;If you are building AI‑related projects, feel free to try out Agentoken and leave your feedback in comments.``&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
