<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>API Gateway on Chen Kai Blog</title><link>https://www.chenk.top/en/tags/api-gateway/</link><description>Recent content in API Gateway on Chen Kai Blog</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 22 Mar 2026 09:00:00 +0000</lastBuildDate><atom:link href="https://www.chenk.top/en/tags/api-gateway/index.xml" rel="self" type="application/rss+xml"/><item><title>Terraform for AI Agents (6): LLM Gateway and Secrets Management</title><link>https://www.chenk.top/en/terraform-agents/06-llm-gateway-and-secrets/</link><pubDate>Sun, 22 Mar 2026 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/terraform-agents/06-llm-gateway-and-secrets/</guid><description>&lt;p>A pattern I see repeatedly in immature agent stacks: each agent has its own copy of &lt;code>OPENAI_API_KEY&lt;/code> in its own &lt;code>.env&lt;/code> file. Sometimes the same key, sometimes different ones, sometimes a colleague&amp;rsquo;s personal key from when they prototyped. When the bill arrives nobody can tell which agent caused which token spend, and when a key leaks (it always does) you&amp;rsquo;re playing whack-a-mole across a dozen &lt;code>.env&lt;/code> files.&lt;/p>
&lt;p>The real wake-up call hit me two years ago. A contractor finished his three-month engagement on a Friday, his laptop went home, and on the following Tuesday DashScope billing flagged 12 million tokens of &lt;code>qwen-max&lt;/code> traffic from an IP we didn&amp;rsquo;t recognise. His personal API key — copy-pasted into a side project — was still sitting in our agent&amp;rsquo;s &lt;code>.env&lt;/code>. Rotating it took six hours: three engineers, four repos, two CI pipelines, one panicked Slack thread. Never again.&lt;/p></description></item></channel></rss>