<?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: SolNoiz</title>
    <description>The latest articles on DEV Community by SolNoiz (@solnoiz_042e90d099a48).</description>
    <link>https://dev.to/solnoiz_042e90d099a48</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%2F4122012%2Fd7c4ca50-a0e3-4747-a778-476f0b726f13.png</url>
      <title>DEV Community: SolNoiz</title>
      <link>https://dev.to/solnoiz_042e90d099a48</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/solnoiz_042e90d099a48"/>
    <language>en</language>
    <item>
      <title>Where my first request died: one config line, three names</title>
      <dc:creator>SolNoiz</dc:creator>
      <pubDate>Thu, 15 Oct 2026 09:42:25 +0000</pubDate>
      <link>https://dev.to/solnoiz_042e90d099a48/where-my-first-request-died-one-config-line-three-names-5dc9</link>
      <guid>https://dev.to/solnoiz_042e90d099a48/where-my-first-request-died-one-config-line-three-names-5dc9</guid>
      <description>&lt;p&gt;Context: I run a CLI agent against one gateway. The whole setup is one provider block in one config file — and three different things in that block are called some kind of "name". I got them mixed up on 23 September 2026, and it cost me an evening.&lt;/p&gt;

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

&lt;p&gt;I pasted the provider block, exported the key, and sent a request.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="c"&gt;# ~/.codex/config.toml&lt;/span&gt;
&lt;span class="py"&gt;model_provider&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"decloud"&lt;/span&gt;

&lt;span class="nn"&gt;[model_providers.decloud]&lt;/span&gt;
&lt;span class="py"&gt;base_url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"https://macdecloud.com/v1"&lt;/span&gt;
&lt;span class="py"&gt;env_key&lt;/span&gt;  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"DECLOUD_API_KEY"&lt;/span&gt;   &lt;span class="c"&gt;# a NAME, not the secret&lt;/span&gt;
&lt;span class="py"&gt;wire_api&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"responses"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What broke
&lt;/h2&gt;

&lt;p&gt;My first request died on a 404 that reads like a broken model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;model not found or disabled    (HTTP 404)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model was fine. The &lt;em&gt;alias&lt;/em&gt; it pointed at had not been created yet — the third of the three names. In this setup a 404 means "this name is not known here", and one of the three names is a name I had to create myself before the first call.&lt;/p&gt;

&lt;p&gt;Then the other two names turned out to be confused with each other.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. &lt;code&gt;env_key&lt;/code&gt; wants the variable's name; I pasted the secret.&lt;/strong&gt; The field is called &lt;code&gt;env_key&lt;/code&gt;, so it reads like it wants a key. It wants the &lt;em&gt;name&lt;/em&gt; of the environment variable that holds the key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Missing environment variable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. An alias is not a permission.&lt;/strong&gt; Once the alias existed, the call still failed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;model "&amp;lt;alias target&amp;gt;" is not allowed for this api key    (HTTP 403)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. There is no endpoint that answers "what may this key call".&lt;/strong&gt; I went looking for a cheap way to ask. &lt;code&gt;/v1/me&lt;/code&gt;, &lt;code&gt;/v1/key&lt;/code&gt; and &lt;code&gt;/v1/usage&lt;/code&gt; all came back 404. The answer lives in the console, not in the API.&lt;/p&gt;

&lt;h2&gt;
  
  
  The two codes are not the same question
&lt;/h2&gt;

&lt;p&gt;This was the most useful thing I wrote down all evening. Both numbers arrive attached to the model name, and they mean opposite things:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What came back&lt;/th&gt;
&lt;th&gt;Code&lt;/th&gt;
&lt;th&gt;What it means&lt;/th&gt;
&lt;th&gt;What to change&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;model not found or disabled&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;404&lt;/td&gt;
&lt;td&gt;this name is not known here&lt;/td&gt;
&lt;td&gt;create the alias, or fix the model id&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;... is not allowed for this api key&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;403&lt;/td&gt;
&lt;td&gt;the model exists; this key may not use it&lt;/td&gt;
&lt;td&gt;the key's own model scope&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Missing environment variable&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;the variable the config names does not exist&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;env_key&lt;/code&gt; vs what you exported&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;rate limit exceeded&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;429&lt;/td&gt;
&lt;td&gt;too fast&lt;/td&gt;
&lt;td&gt;slow the probe down&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The catalogue endpoint makes this worse before it makes it better. It returns the gateway's full list, and I quietly assumed that a listed model was a usable model. It is not. A catalogue describes what exists; a permission list describes what &lt;em&gt;you&lt;/em&gt; may call. Only one of those two is written in the config file.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I fixed it
&lt;/h2&gt;

&lt;p&gt;I stopped treating the block as "fields to fill" and wrote down the three names and their jobs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one name is &lt;strong&gt;the credential's name&lt;/strong&gt; — the environment variable (&lt;code&gt;env_key&lt;/code&gt; → &lt;code&gt;DECLOUD_API_KEY&lt;/code&gt;);&lt;/li&gt;
&lt;li&gt;one is &lt;strong&gt;the secret&lt;/strong&gt; — the value inside that variable, exported in the shell, never written into the file;&lt;/li&gt;
&lt;li&gt;one is &lt;strong&gt;the alias&lt;/strong&gt; — the model name the request carries, which the key must separately be allowed to use.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgfprtkr67bht1oedkjqq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgfprtkr67bht1oedkjqq.png" alt="Three names, three jobs: the variable's name, the value inside it, and the model alias" width="800" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With that mapping written down, every failure turned into a question I could answer: which of the three names does this error belong to?&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would do differently
&lt;/h2&gt;

&lt;p&gt;One line, before touching anything:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cp &lt;/span&gt;config.toml config.toml.bak
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I did not, and an editor save accident wiped the file mid-session. The only reason that evening ended with a working setup instead of a rebuild is that an earlier backup existed. A config file for a developer tool accumulates months of small decisions; it is not disposable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Read the error, not the sentence you expected. &lt;code&gt;Missing environment variable&lt;/code&gt; is about a name, not about the secret.&lt;/li&gt;
&lt;li&gt;A catalogue is not a permission list. Check the key's own scope before you touch the model name.&lt;/li&gt;
&lt;li&gt;Back up the config before you edit it — and if the API cannot tell you what a key may call, write that answer down from the console once.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ai</category>
      <category>api</category>
      <category>apigateway</category>
      <category>decloud</category>
    </item>
  </channel>
</rss>
