<?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: xiaohan lin (Ethan lin)</title>
    <description>The latest articles on DEV Community by xiaohan lin (Ethan lin) (@ethanlinxh).</description>
    <link>https://dev.to/ethanlinxh</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%2F4028972%2Fc93529da-b49f-488c-a684-814c4c9a3e71.jpg</url>
      <title>DEV Community: xiaohan lin (Ethan lin)</title>
      <link>https://dev.to/ethanlinxh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ethanlinxh"/>
    <language>en</language>
    <item>
      <title>"How to Use OpenAI Codex with Any Model: Claude Opus 4.8, Grok 4.5, Kimi K3, GLM-5.2"</title>
      <dc:creator>xiaohan lin (Ethan lin)</dc:creator>
      <pubDate>Wed, 22 Jul 2026 08:37:10 +0000</pubDate>
      <link>https://dev.to/ethanlinxh/how-to-use-openai-codex-with-any-model-claude-opus-48-grok-45-kimi-k3-glm-52-49cp</link>
      <guid>https://dev.to/ethanlinxh/how-to-use-openai-codex-with-any-model-claude-opus-48-grok-45-kimi-k3-glm-52-49cp</guid>
      <description>&lt;h2&gt;
  
  
  canonical_url: &lt;a href="https://glideflowai.com/blog/use-any-model-in-openai-codex-opencodex" rel="noopener noreferrer"&gt;https://glideflowai.com/blog/use-any-model-in-openai-codex-opencodex&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Most coding agents ask you to pick one model and live with it. That made sense when one model was clearly ahead. It does not describe how people actually work now: a long repository investigation, a five-line typo fix, and a design discussion are three different jobs, and the model that is best at one of them is rarely the cheapest or fastest at the others.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The setup below lets you choose the model per task, inside Codex, without changing your key or your workflow.&lt;/strong&gt; You run &lt;a href="https://github.com/lidge-jun/opencodex" rel="noopener noreferrer"&gt;OpenCodex&lt;/a&gt; locally and add Glideflow as a custom OpenAI-compatible provider. OpenCodex receives Codex's Responses API traffic on your machine, translates it to Chat Completions, and sends it to the route you selected. Switching models becomes one flag or one dropdown, so the choice costs you seconds instead of a reinstall.&lt;/p&gt;

&lt;p&gt;One key then reaches Claude Opus 4.8, Claude Sonnet 5, Grok 4.5, Kimi K3, Kimi K2.7 Code, Qwen3.7-Max, and GLM-5.2, among others. &lt;code&gt;kimi-k3&lt;/code&gt; is used as the first example below only because it is a convenient starting point, not because it is the answer for every task.&lt;/p&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%2F48bg4e8kmb9xp560djtm.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%2F48bg4e8kmb9xp560djtm.png" alt="Diagram: Codex sends requests to a local OpenCodex proxy, which routes them through one Glideflow API key to Claude Opus 4.8, Grok 4.5, Kimi K3, Qwen3.7-Max, GLM-5.2 and more, so the model can be picked per task; ocx stop returns Codex to native." width="799" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is a BYOK setup: you use an API key from your own Glideflow account and pay for the requests made with that key. OpenCodex, Codex, and Glideflow are independent products. Treat the proxy as a local developer tool, keep normal code review in place, and follow the terms and policies that apply to each product.&lt;/p&gt;

&lt;p&gt;One thing to read before you install rather than after: uninstalling is not a single clean command, and two kinds of leftovers can make a working Codex look broken. They are both fixable, and they are documented in the "Return Codex to its original state" section below.&lt;/p&gt;

&lt;h2&gt;
  
  
  What OpenCodex changes—and what it does not
&lt;/h2&gt;

&lt;p&gt;Codex normally speaks the OpenAI Responses API. Glideflow exposes an OpenAI-compatible API, including Chat Completions and model listing endpoints. OpenCodex is the bridge between those two shapes: its &lt;code&gt;openai-chat&lt;/code&gt; adapter sends requests to &lt;code&gt;{baseUrl}/chat/completions&lt;/code&gt; and translates streaming text, tool calls, and usage back into the format Codex expects. See the project's &lt;a href="https://lidge-jun.github.io/opencodex/reference/adapters/" rel="noopener noreferrer"&gt;adapter reference&lt;/a&gt; for the precise translation boundary.&lt;/p&gt;

&lt;p&gt;That makes OpenCodex useful when a coding workflow needs model choice rather than a single fixed default. It does &lt;strong&gt;not&lt;/strong&gt; mean that every route has identical context behavior, tool reliability, reasoning controls, latency, or output quality. Use the same task, branch, tests, and budget for each comparison; then keep the routes that work on your repository.&lt;/p&gt;

&lt;p&gt;The useful mental model is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Codex CLI or App → OpenCodex on your computer → Glideflow API → selected model
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your Glideflow key stays on your computer in the OpenCodex configuration or, preferably, in an environment variable. It is not an access token for ChatGPT or a way to bypass account quotas, subscriptions, or authentication requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before you start
&lt;/h2&gt;

&lt;p&gt;You need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node.js 18 or newer. OpenCodex bundles its Bun runtime during installation; you do not need a separate Bun installation. &lt;a href="https://github.com/lidge-jun/opencodex#supported-platforms" rel="noopener noreferrer"&gt;OpenCodex installation notes&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;A working Codex CLI or Codex app installation.&lt;/li&gt;
&lt;li&gt;A Glideflow account and an API key from the &lt;a href="https://app.glideflowai.com" rel="noopener noreferrer"&gt;dashboard&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;A small, non-sensitive repository or a clean branch for the first run.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Create a separate Glideflow key for this experiment if your account supports multiple keys. It makes revocation and spend review simpler. Do not put a live key in a repository, &lt;code&gt;config.json&lt;/code&gt; shared with a team, a screenshot, or a support post.&lt;/p&gt;

&lt;p&gt;For the examples below, export the key in the shell that will start OpenCodex:&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;export &lt;/span&gt;&lt;span class="nv"&gt;GLIDEFLOW_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"sk-your-key"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The shell will retain the value only for that session. Use your operating system's secret store or approved environment-management approach if you need a persistent setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install OpenCodex, then preserve the native Codex route
&lt;/h2&gt;

&lt;p&gt;Install the current package with a user-owned Node installation. Avoid &lt;code&gt;sudo&lt;/code&gt; unless your Node setup explicitly requires it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @bitkyc08/opencodex
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Then check that the command actually landed before you go further:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;which ocx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This step is not a formality. The package registers two binaries, &lt;code&gt;ocx&lt;/code&gt; and &lt;code&gt;opencodex&lt;/code&gt;, and on one of our machines neither symlink was created even though the install reported success — every later command in this guide would have failed with &lt;code&gt;command not found&lt;/code&gt;. If &lt;code&gt;which ocx&lt;/code&gt; returns nothing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Confirm your npm global bin directory is on &lt;code&gt;PATH&lt;/code&gt; (&lt;code&gt;npm prefix -g&lt;/code&gt;, then check that &lt;code&gt;&amp;lt;prefix&amp;gt;/bin&lt;/code&gt; is in &lt;code&gt;$PATH&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Reinstall and read the output rather than scrolling past it. The package's postinstall step fetches a Bun runtime, and a failure there can leave a partial install.&lt;/li&gt;
&lt;li&gt;If your npm setup blocks install scripts, that postinstall step is what is being blocked. Re-run the install with scripts permitted for this package, using whatever mechanism your package manager provides. Do not paste a flag from another package manager; &lt;code&gt;npm&lt;/code&gt; and &lt;code&gt;pnpm&lt;/code&gt; do not share the same option names here.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not work around a broken install by editing Codex configuration files by hand. Everything below assumes &lt;code&gt;ocx&lt;/code&gt; runs.&lt;/p&gt;

&lt;p&gt;For a multi-model Codex setup, start OpenCodex &lt;em&gt;before&lt;/em&gt; adding Glideflow. This keeps OpenCodex's built-in OpenAI forwarding provider in place, so your normal Codex model choices remain available alongside the Glideflow routes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ocx start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On a first run, OpenCodex creates its local state in &lt;code&gt;~/.opencodex&lt;/code&gt;, starts a loopback proxy (normally on port &lt;code&gt;10100&lt;/code&gt;), and points Codex at that local proxy. It also retains a fallback copy of the native Codex configuration.&lt;/p&gt;

&lt;p&gt;One point deserves precision, because it is easy to overstate. OpenCodex does not add a second provider beside Codex's own; it repoints Codex's built-in OpenAI provider at the local proxy, and the proxy then routes by model ID — bare IDs forward to the Codex backend, &lt;code&gt;glideflow/&amp;lt;model-id&amp;gt;&lt;/code&gt; goes to Glideflow. In a local verification, the native OpenAI models &lt;strong&gt;stayed listed&lt;/strong&gt; in the picker after Glideflow was added, and the new routes appeared separately. We did not run a full native task through the proxy, so treat native forwarding as something to verify on your own machine with one small task before you rely on it.&lt;/p&gt;

&lt;p&gt;The consequence of that design is worth stating plainly: while OpenCodex is installed, &lt;strong&gt;every&lt;/strong&gt; request goes through the local proxy, native ones included. There is no automatic fallback to the official endpoint if the proxy stops. That is the trade for getting one picker with every model in it.&lt;/p&gt;

&lt;p&gt;OpenCodex's guided &lt;code&gt;ocx init&lt;/code&gt; flow is useful for a single-provider setup, but it creates a new provider configuration. For this particular goal—&lt;strong&gt;keep native Codex choices and add a second provider&lt;/strong&gt;—the dashboard or a careful merge is the safer path. Its &lt;a href="https://lidge-jun.github.io/opencodex/reference/configuration/" rel="noopener noreferrer"&gt;configuration reference&lt;/a&gt; documents every field.&lt;/p&gt;

&lt;p&gt;The normal local binding is &lt;code&gt;127.0.0.1&lt;/code&gt;, which is the right choice for a personal development machine. Do &lt;strong&gt;not&lt;/strong&gt; change it to a LAN or public bind merely to make the setup more convenient. A network-exposed proxy can expose access to every provider credential it holds. If you ever have a genuine remote-use case, first read OpenCodex's remote-access authentication requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add one Glideflow provider, then choose from multiple models
&lt;/h2&gt;

&lt;p&gt;The easiest way to add Glideflow without disturbing the native route is the local dashboard:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ocx gui
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Choose &lt;strong&gt;Add Provider&lt;/strong&gt;, select the custom OpenAI-compatible option, then set the provider name to &lt;code&gt;glideflow&lt;/code&gt;, the base URL to &lt;code&gt;https://api.glideflowai.com/v1&lt;/code&gt;, and a Glideflow API key. Leave the existing OpenAI provider and its default selection unchanged. Then choose a small set of models for the Codex-visible allowlist.&lt;/p&gt;

&lt;p&gt;You can also merge a named provider such as &lt;code&gt;glideflow&lt;/code&gt; into &lt;code&gt;~/.opencodex/config.json&lt;/code&gt;. One provider holds your endpoint and key; the &lt;code&gt;selectedModels&lt;/code&gt; list determines the model routes you can switch between in Codex. The important detail is that the existing &lt;code&gt;openai&lt;/code&gt; provider stays in the file. This example starts with a short evaluation set, which keeps the picker readable and avoids treating a large catalog as a promise that every model suits every task.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"port"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"providers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"openai"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"adapter"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"openai-responses"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"baseUrl"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://chatgpt.com/backend-api/codex"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"authMode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"forward"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"codexAccountMode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"pool"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"glideflow"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"adapter"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"openai-chat"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"baseUrl"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.glideflowai.com/v1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"apiKey"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${GLIDEFLOW_API_KEY}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"defaultModel"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"kimi-k3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"selectedModels"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"claude-opus-4-8"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"claude-sonnet-5"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"grok-4.5"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"kimi-k3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"kimi-k2.7-code"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"qwen3.7-max"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"glm-5.2"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"defaultProvider"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"openai"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Four details are important here:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The base URL includes &lt;code&gt;/v1&lt;/code&gt;. This is an OpenAI-compatible Chat Completions integration, not the Anthropic-compatible configuration used by a direct Claude Code setup.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;apiKey&lt;/code&gt; references an environment variable. Do not replace it with a literal production key in a dotfile that may be copied or backed up.&lt;/li&gt;
&lt;li&gt;Keeping &lt;code&gt;openai&lt;/code&gt; and &lt;code&gt;defaultProvider: "openai"&lt;/code&gt; preserves the native Codex path. Glideflow still appears as separately selectable &lt;code&gt;glideflow/&amp;lt;model-id&amp;gt;&lt;/code&gt; routes; &lt;code&gt;defaultModel&lt;/code&gt; selects a starting Glideflow route only when that provider is chosen.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;selectedModels&lt;/code&gt; is an allowlist for the Codex picker, not a permanent statement about Glideflow's catalog. Omit it if you intentionally want OpenCodex to discover and display all models available to your key.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;OpenCodex fetches a provider's &lt;code&gt;/models&lt;/code&gt; catalog by default. If you use an allowlist, update it whenever you intentionally add another model to your evaluation. The provider guide explains the difference between live discovery, &lt;code&gt;models&lt;/code&gt;, and &lt;code&gt;selectedModels&lt;/code&gt;. &lt;a href="https://lidge-jun.github.io/opencodex/guides/providers/" rel="noopener noreferrer"&gt;Read the provider configuration guide&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Start the local proxy, then refresh its model catalog and Codex integration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ocx start
ocx &lt;span class="nb"&gt;sync&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If OpenCodex reports that the chosen port is busy, let it select a free loopback port or resolve the existing local process before proceeding. Do not solve a local port conflict by exposing the proxy to the network.&lt;/p&gt;

&lt;h3&gt;
  
  
  What this setup was verified to do
&lt;/h3&gt;

&lt;p&gt;The configuration path above was tested with one Glideflow provider and a six-model allowlist. Every allowlisted model appeared in the proxy's catalog as &lt;code&gt;glideflow/&amp;lt;model-id&amp;gt;&lt;/code&gt;, and a short non-streaming request through the proxy completed successfully with Kimi K3 before any repository task was attempted.&lt;/p&gt;

&lt;p&gt;Being precise about scope: that verification covered the routing mechanism and one model end to end. &lt;strong&gt;The other routes in the allowlist above were not individually driven through the proxy in that session.&lt;/strong&gt; Run the small connectivity check below against each route you plan to depend on, rather than assuming that one working route certifies the rest.&lt;/p&gt;

&lt;p&gt;This check matters because it separates three different problems: whether the Glideflow key and model work, whether OpenCodex can translate the request, and whether the Codex model picker has been refreshed. Do the small connectivity check first; do not debug all three layers at once.&lt;/p&gt;

&lt;h3&gt;
  
  
  Return Codex to its original state
&lt;/h3&gt;

&lt;p&gt;When you no longer need OpenCodex, stop it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ocx stop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This stops the local proxy and restores the connection settings it injected into &lt;code&gt;~/.codex/config.toml&lt;/code&gt;. In a local verification, that part worked: the injected loopback base URL was removed, and running &lt;code&gt;ocx restore&lt;/code&gt; afterward was harmless and reported that no OpenCodex configuration remained.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Two things it does not clean up.&lt;/strong&gt; Both are easy to fix once you know they exist, and confusing if you do not, so read this before you install rather than after.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. The model cache
&lt;/h4&gt;

&lt;p&gt;To make its routes appear in Codex's native picker, OpenCodex overwrites &lt;code&gt;~/.codex/models_cache.json&lt;/code&gt; with its own catalog. Removing the proxy does not restore the original file. The leftover &lt;code&gt;glideflow/*&lt;/code&gt; entries are missing a field that Codex's parser requires, and Codex rejects the &lt;strong&gt;entire&lt;/strong&gt; cache rather than skipping the bad entries:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ERROR codex_models_manager::cache: failed to load models cache:
missing field `supports_reasoning_summaries` at line 88 column 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The visible symptom is an empty or stale model list, which looks like a broken Codex install rather than uninstall residue. The fix:&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;rm&lt;/span&gt; ~/.codex/models_cache.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run Codex once so it refetches the catalog from the official endpoint, and restart the Codex desktop app if you use it — a running app keeps the old list in memory and will not pick up the repaired file on its own.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Conversations that ran through the proxy
&lt;/h4&gt;

&lt;p&gt;This one is easier to miss. A model served over the Chat Completions adapter has no native reasoning item to return, so the proxy synthesises one. Those synthesised items carry plaintext in a &lt;code&gt;content&lt;/code&gt; array, and the official Responses API requires that array to be empty. While the proxy is running it absorbs the difference. Once it is gone, Codex replays the full thread to the official endpoint, and every turn is rejected:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Invalid 'input[109].content': array too long.
Expected an array with maximum length 0, but got an array with length 1 instead.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The thread is stuck permanently — retrying cannot help, because the bad item is in the stored history. Threads created before you installed the proxy are unaffected.&lt;/p&gt;

&lt;p&gt;You can tell a synthesised item from a genuine one: real reasoning items carry a long &lt;code&gt;encrypted_content&lt;/code&gt; payload and a provider-issued id, while the synthesised ones have &lt;code&gt;encrypted_content: null&lt;/code&gt;, an empty summary, and a short generated id. Session transcripts live in &lt;code&gt;~/.codex/sessions/&amp;lt;year&amp;gt;/&amp;lt;month&amp;gt;/&amp;lt;day&amp;gt;/rollout-*.jsonl&lt;/code&gt;, one JSON object per line. Removing the affected records from the transcripts of those threads restores them; back the files up first.&lt;/p&gt;

&lt;p&gt;If none of that appeals, the low-effort alternative is simply to start a fresh thread. &lt;strong&gt;The practical rule: while OpenCodex is installed, use it in throwaway threads, and keep conversations you want to keep on native Codex.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Switch models in Codex without changing anything else
&lt;/h2&gt;

&lt;p&gt;With the provider above, OpenCodex addresses a route as &lt;code&gt;provider/model&lt;/code&gt;. Start a small Codex CLI task with Kimi K3:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;codex &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"glideflow/kimi-k3"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"Inspect this repository. List the test command you would run, but do not edit files."&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the Codex app, the routes in &lt;code&gt;selectedModels&lt;/code&gt; should appear in the model picker after a successful sync. Select &lt;code&gt;glideflow/kimi-k3&lt;/code&gt;, choose a small task, and confirm that the session identifies the model if your client version exposes that information.&lt;/p&gt;

&lt;p&gt;Do not make a production repository your first test. A good sequence is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Ask the model to inspect the repository and name the relevant test command without editing.&lt;/li&gt;
&lt;li&gt;Ask it to explain one small, known failing test.&lt;/li&gt;
&lt;li&gt;On a clean branch, request the smallest fix and the single relevant test command.&lt;/li&gt;
&lt;li&gt;Review the diff and test output yourself.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once the first route is working, replace only the model part of the command. This is the point of the integration: the endpoint and key stay the same while Codex runs a different model.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;codex &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"glideflow/claude-opus-4-8"&lt;/span&gt; &lt;span class="s2"&gt;"Explain the failing test, then propose the smallest fix."&lt;/span&gt;
codex &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"glideflow/claude-sonnet-5"&lt;/span&gt;  &lt;span class="s2"&gt;"Explain the failing test, then propose the smallest fix."&lt;/span&gt;
codex &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"glideflow/grok-4.5"&lt;/span&gt;         &lt;span class="s2"&gt;"Explain the failing test, then propose the smallest fix."&lt;/span&gt;
codex &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"glideflow/kimi-k2.7-code"&lt;/span&gt;   &lt;span class="s2"&gt;"Explain the failing test, then propose the smallest fix."&lt;/span&gt;
codex &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"glideflow/qwen3.7-max"&lt;/span&gt;      &lt;span class="s2"&gt;"Explain the failing test, then propose the smallest fix."&lt;/span&gt;
codex &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"glideflow/glm-5.2"&lt;/span&gt;          &lt;span class="s2"&gt;"Explain the failing test, then propose the smallest fix."&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Changing one variable at a time is much more useful than changing the model, prompt, branch, and permissions together. It lets you learn whether a difference comes from the selected route or from the experiment itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building a per-task routing habit
&lt;/h2&gt;

&lt;p&gt;This is the part that outlasts any particular model. Once switching is cheap, the useful question stops being "which model is best" and becomes "which model is worth its price for &lt;em&gt;this&lt;/em&gt; task." Those are different questions, and only the second one has a stable answer.&lt;/p&gt;

&lt;p&gt;A rough shape that many teams converge on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Expensive, careful models for expensive, careful work.&lt;/strong&gt; A subtle bug in unfamiliar code, an architectural decision, a refactor that touches many files. Here a wrong answer costs you an hour of review, so paying more per token is the cheap option.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mid-tier models for the bulk of the day.&lt;/strong&gt; Bounded edits with a named test, small features, mechanical refactors. Most agent work is this, and it is where routing well actually saves money.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fast, cheap models for volume and throwaway work.&lt;/strong&gt; Renames, docstrings, test scaffolding, "what does this file do." Latency matters more than depth.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Long-context models when the input is the problem.&lt;/strong&gt; A large repository sweep or a document-heavy task, where the constraint is how much the model can hold rather than how well it reasons.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The exact available menu changes. Copy IDs from Glideflow's &lt;a href="https://glideflowai.com/models" rel="noopener noreferrer"&gt;model catalog&lt;/a&gt; or from the models OpenCodex discovers for your key. The routes below are &lt;strong&gt;hypotheses to test on your repository&lt;/strong&gt;, not universal rankings — and the point of the table is the left column's shape, not the specific names.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Route&lt;/th&gt;
&lt;th&gt;Task class it is a candidate for&lt;/th&gt;
&lt;th&gt;What to record&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;claude-opus-4-8&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Subtle bug in unfamiliar code, architectural decisions&lt;/td&gt;
&lt;td&gt;Whether the diff needed rework, and review time saved&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;claude-sonnet-5&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Everyday bounded edits with a focused test&lt;/td&gt;
&lt;td&gt;Instruction following and diff scope&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;grok-4.5&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Multi-step investigation and tool-heavy loops&lt;/td&gt;
&lt;td&gt;Tool-call correctness and retries&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;kimi-k3&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;One bounded bug investigation or a small feature plan&lt;/td&gt;
&lt;td&gt;Test result, tool turns, manual cleanup&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;kimi-k2.7-code&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Repository-level edit with a focused test&lt;/td&gt;
&lt;td&gt;Instruction following and diff scope&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;qwen3.7-max&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Planning and task decomposition&lt;/td&gt;
&lt;td&gt;Plan quality and review burden&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;glm-5.2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Larger repository or document-heavy task&lt;/td&gt;
&lt;td&gt;Long-context behavior and output budget&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Keep a minimal evaluation note for every run: commit SHA, model ID, exact prompt, tool permissions, input and output tokens, wall-clock time, test result, and manual changes required. An agent task can be output-heavy, so token costs should be compared as separate input and output numbers rather than a single blended figure.&lt;/p&gt;

&lt;p&gt;Prices and availability change, especially for newly added models. For current USD token rates, use the live &lt;a href="https://glideflowai.com/models" rel="noopener noreferrer"&gt;model catalog&lt;/a&gt; and your dashboard before setting a budget. Do not rely on a copied price table from an old blog post or terminal history.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verify the API before debugging Codex
&lt;/h2&gt;

&lt;p&gt;If the model picker is empty or a Codex session fails immediately, check the API path before changing several proxy settings. This direct request tests the same key and model against Glideflow's OpenAI-compatible endpoint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://api.glideflowai.com/v1/chat/completions &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer &lt;/span&gt;&lt;span class="nv"&gt;$GLIDEFLOW_API_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
    "model": "kimi-k3",
    "messages": [{"role": "user", "content": "Reply with OK."}],
    "max_tokens": 512
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not paste the expanded command output into a public issue if it could reveal an authorization header, request content, repository details, or key. If the direct request works but Codex does not, inspect the OpenCodex provider name, &lt;code&gt;/v1&lt;/code&gt; base URL, selected model ID, and the environment inherited by the &lt;code&gt;ocx start&lt;/code&gt; process.&lt;/p&gt;

&lt;p&gt;The same direct check can be made with the official OpenAI SDKs. Python:&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;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&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="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;GLIDEFLOW_API_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://api.glideflowai.com/v1&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="n"&gt;response&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;kimi-k3&lt;/span&gt;&lt;span class="sh"&gt;"&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="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;Reply with OK.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;
    &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;512&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;response&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;And Node.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;OpenAI&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;openai&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;GLIDEFLOW_API_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;baseURL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://api.glideflowai.com/v1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&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="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;kimi-k3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Reply with OK.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}],&lt;/span&gt;
  &lt;span class="na"&gt;max_tokens&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;512&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&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="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&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;These checks validate credentials, endpoint, and one model ID. To test another route, change only the &lt;code&gt;model&lt;/code&gt; value—for example, from &lt;code&gt;kimi-k3&lt;/code&gt; to &lt;code&gt;kimi-k2.7-code&lt;/code&gt;—and repeat the same check. They do not prove that a model will complete a long agent loop reliably. The real test remains a bounded repository task with a reviewed diff and a passing test.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting the common failure modes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;401&lt;/code&gt; or an invalid-key response
&lt;/h3&gt;

&lt;p&gt;Confirm that &lt;code&gt;GLIDEFLOW_API_KEY&lt;/code&gt; is exported in the same environment that starts &lt;code&gt;ocx&lt;/code&gt;. Do not use &lt;code&gt;echo $GLIDEFLOW_API_KEY&lt;/code&gt; in shared terminal recordings or logs. Instead, re-export the key from your secret source, restart the proxy, and retry the small direct request.&lt;/p&gt;

&lt;h3&gt;
  
  
  The model is missing from the picker
&lt;/h3&gt;

&lt;p&gt;Run &lt;code&gt;ocx sync&lt;/code&gt;, then inspect the exact model ID in the Glideflow catalog. If you configured &lt;code&gt;selectedModels&lt;/code&gt;, ensure it includes the exact, case- and punctuation-sensitive ID. Remove a stale allowlist entry rather than guessing a display name.&lt;/p&gt;

&lt;h3&gt;
  
  
  A route returns an availability error
&lt;/h3&gt;

&lt;p&gt;An availability error can mean the ID is wrong, the model is not enabled for the key's group, or routing is temporarily unavailable. First verify the ID with &lt;code&gt;/v1/models&lt;/code&gt; or the catalog, then retry a small request later. Do not silently substitute a different model and record the experiment as if it used the original route.&lt;/p&gt;

&lt;h3&gt;
  
  
  The response has little or no visible text
&lt;/h3&gt;

&lt;p&gt;Use a reasonable output budget for the first request. Reasoning-oriented models may consume a very small allowance before producing visible text. Start at 512 output tokens for a connectivity check, then size the limit according to the actual task.&lt;/p&gt;

&lt;h3&gt;
  
  
  A tool loop behaves differently from native Codex
&lt;/h3&gt;

&lt;p&gt;OpenCodex translates protocols; it cannot make every upstream model behave like a native Codex model. Reduce the task to one tool call, capture the sanitized proxy log, and compare it with the same task on another route. Keep normal approval, sandbox, branch, review, and test controls in place.&lt;/p&gt;

&lt;p&gt;OpenCodex currently documents a specific multi-agent limitation: on the V2 surface, a native parent that spawns a routed child can lose the child task body because it arrives encrypted. For reliable cross-provider sub-agent experiments, use the V1 surface or avoid that topology until the limitation changes. &lt;a href="https://github.com/lidge-jun/opencodex/issues/92" rel="noopener noreferrer"&gt;OpenCodex issue #92&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep the setup safe and inexpensive
&lt;/h2&gt;

&lt;p&gt;The proxy is a local convenience layer, not a reason to relax engineering controls. A solid default is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use one limited-scope Glideflow key for OpenCodex, separate from application production keys.&lt;/li&gt;
&lt;li&gt;Keep the proxy on loopback only.&lt;/li&gt;
&lt;li&gt;Start with a disposable branch and explicit file scope.&lt;/li&gt;
&lt;li&gt;Ask the agent to inspect and plan before allowing edits.&lt;/li&gt;
&lt;li&gt;Run one named test, review the patch, and only then expand the task.&lt;/li&gt;
&lt;li&gt;Record the model ID and date beside any benchmark result, since model menus and behavior evolve.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Never expose the local OpenCodex dashboard or proxy port to the public internet. Never add a provider key to a shared prompt, a repository instruction file, or a browser-side application. If a key is accidentally exposed, revoke it in the Glideflow dashboard and create a replacement before investigating anything else.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to go next
&lt;/h2&gt;

&lt;p&gt;After you have one repeatable run, trim the picker to the three or four routes your own tests support. A short list you understand beats a long one you are guessing at.&lt;/p&gt;

&lt;p&gt;The habit worth keeping is smaller than it sounds: &lt;strong&gt;before starting a task, spend one second deciding what kind of task it is, and pick accordingly.&lt;/strong&gt; A bounded edit on a fast route. A repository investigation on a long-context route. A decision you will have to live with on the strongest route you are willing to pay for. Over a week that is a few hundred small choices, and it is where the savings and the quality both come from — not from finding one model that wins everywhere, because that model does not exist for long.&lt;/p&gt;

&lt;p&gt;Model rankings will keep churning. A workflow where swapping the model is one flag does not.&lt;/p&gt;

&lt;p&gt;For more connection patterns, see the &lt;a href="https://glideflowai.com/docs/" rel="noopener noreferrer"&gt;Glideflow quickstart&lt;/a&gt; and &lt;a href="https://glideflowai.com/docs/code-examples/" rel="noopener noreferrer"&gt;OpenAI-compatible API examples&lt;/a&gt;. To explore exact available IDs and current prices, visit the &lt;a href="https://glideflowai.com/models" rel="noopener noreferrer"&gt;model catalog&lt;/a&gt;. For the local proxy, installation details, and latest compatibility notes, visit the &lt;a href="https://github.com/lidge-jun/opencodex" rel="noopener noreferrer"&gt;OpenCodex GitHub repository&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you work in Claude Code rather than Codex, the equivalent setup needs no proxy at all: &lt;a href="https://glideflowai.com/blog/point-claude-code-at-any-model-one-base-url" rel="noopener noreferrer"&gt;point Claude Code at any model with one base URL&lt;/a&gt;. To decide which routes deserve a place in your picker, read &lt;a href="https://glideflowai.com/blog/claude-sonnet-5-alternatives-coding-agents-glm-kimi-qwen" rel="noopener noreferrer"&gt;GLM-5.2 vs Kimi K2.7 vs Qwen3.7 for coding agents&lt;/a&gt;, and for the cost side, &lt;a href="https://glideflowai.com/blog/cheapest-openai-compatible-llm-gateways-coding-agents-2026" rel="noopener noreferrer"&gt;choosing an OpenAI-compatible gateway for coding agents&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Point Claude Code at Any Model: One Base URL</title>
      <dc:creator>xiaohan lin (Ethan lin)</dc:creator>
      <pubDate>Wed, 15 Jul 2026 08:02:39 +0000</pubDate>
      <link>https://dev.to/ethanlinxh/point-claude-code-at-any-model-one-base-url-4m1f</link>
      <guid>https://dev.to/ethanlinxh/point-claude-code-at-any-model-one-base-url-4m1f</guid>
      <description>&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%2Fyv4lq570dck71nvh4zn7.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%2Fyv4lq570dck71nvh4zn7.png" alt=" " width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://glideflowai.com/blog/point-claude-code-at-any-model-one-base-url" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; — Run GLM-5.2, Qwen, or Kimi inside Claude Code by changing three environment variables. The easy-to-miss detail: &lt;code&gt;ANTHROPIC_BASE_URL&lt;/code&gt; takes the host &lt;strong&gt;without&lt;/strong&gt; &lt;code&gt;/v1&lt;/code&gt;. Full setup, verification steps, and troubleshooting below.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Claude Code is most useful when the feedback loop is short: give it a repository task, let it inspect and edit under your controls, then run the tests. The model choice is part of that loop. You may want a long-context coding route for a large codebase, an agentic coding route for a multi-step change, or a different route for a lower-risk maintenance task.&lt;/p&gt;

&lt;p&gt;The safe way to experiment is to change configuration, verify a small request, and then run the same repository task with a fixed budget. This is a configuration guide, not a claim that different models produce the same results. Model behavior, context support, tool use, and cost differ by route. Keep your normal code-review and test process in place.&lt;/p&gt;

&lt;h2&gt;
  
  
  The two compatible endpoint shapes to keep straight
&lt;/h2&gt;

&lt;p&gt;There are two related but distinct settings in this guide.&lt;/p&gt;

&lt;p&gt;For an OpenAI-compatible SDK or a direct chat-completions test, use the versioned URL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://api.glideflowai.com/v1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Claude Code itself uses an Anthropic-compatible connection configuration. For &lt;code&gt;ANTHROPIC_BASE_URL&lt;/code&gt;, use the host &lt;strong&gt;without&lt;/strong&gt; &lt;code&gt;/v1&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://api.glideflowai.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This distinction matters. Appending &lt;code&gt;/v1&lt;/code&gt; to &lt;code&gt;ANTHROPIC_BASE_URL&lt;/code&gt; is a common configuration error. The model selection is still explicit through &lt;code&gt;ANTHROPIC_MODEL&lt;/code&gt;. Copy an exact ID from the &lt;a href="https://glideflowai.com/models" rel="noopener noreferrer"&gt;model catalog&lt;/a&gt; rather than relying on a display name.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before you change anything
&lt;/h2&gt;

&lt;p&gt;Have these four things ready:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A local Claude Code installation.&lt;/li&gt;
&lt;li&gt;A GlideflowAI API key created in the &lt;a href="https://app.glideflowai.com" rel="noopener noreferrer"&gt;dashboard&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;A small non-sensitive repository or a disposable branch for the first agent run.&lt;/li&gt;
&lt;li&gt;A model ID from the catalog. This article starts with &lt;code&gt;glm-5.2&lt;/code&gt; because it is listed for long-context coding; it is a starting point, not a universal recommendation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keep the key in your shell environment or local settings file. Do not commit it, paste it into a browser bundle, or include it in screenshots. If you use a secret manager, point your shell configuration at the injected value rather than copying the key into a repository-specific file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fastest path: configure one shell session
&lt;/h2&gt;

&lt;p&gt;Use these exports for a one-session test:&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;export &lt;/span&gt;&lt;span class="nv"&gt;ANTHROPIC_BASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://api.glideflowai.com"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;ANTHROPIC_AUTH_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"sk-your-key"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;ANTHROPIC_MODEL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"glm-5.2"&lt;/span&gt;

claude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside Claude Code, begin with something observable and low-risk, such as “inspect the repository and list the test commands; do not edit files.” Confirm the model name in the session information if your version exposes it, then ask the tool to make a small change on a branch and run the relevant test.&lt;/p&gt;

&lt;p&gt;This is intentionally a narrow validation. It tells you that the credential, endpoint, and selected model can establish a session. It does not prove that a route is suitable for every project or that it will always complete an agent loop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Persist the configuration locally
&lt;/h2&gt;

&lt;p&gt;If the session test works, you can persist the same values in Claude Code’s settings file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"env"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ANTHROPIC_BASE_URL"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.glideflowai.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ANTHROPIC_AUTH_TOKEN"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sk-your-key"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ANTHROPIC_MODEL"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"glm-5.2"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save this as &lt;code&gt;~/.claude/settings.json&lt;/code&gt; if that is the settings location used by your installation. Merge the &lt;code&gt;env&lt;/code&gt; object with existing settings rather than overwriting unrelated configuration. If your team manages environment variables centrally, prefer that mechanism; it keeps credentials out of dotfiles that could be copied between machines.&lt;/p&gt;

&lt;p&gt;To change routes later, change only the model value and repeat the same validation task:&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;export &lt;/span&gt;&lt;span class="nv"&gt;ANTHROPIC_MODEL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"kimi-k2.7-code"&lt;/span&gt;
claude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Model IDs are case- and punctuation-sensitive. For the current menu, use the &lt;a href="https://glideflowai.com/models" rel="noopener noreferrer"&gt;catalog&lt;/a&gt;, not a model name from an old terminal history or social post.&lt;/p&gt;

&lt;h2&gt;
  
  
  Select models by the task, then test them
&lt;/h2&gt;

&lt;p&gt;It is tempting to call one model “the coding model” and leave the configuration there. Coding agents make that fragile: a task that involves repository-wide reading is different from a constrained refactor or a sequence of tool calls.&lt;/p&gt;

&lt;p&gt;Start by assigning a hypothesis to each route. &lt;code&gt;glm-5.2&lt;/code&gt; is described in the catalog as a long-context coding model for coding agents, tool use, and large-document workflows. &lt;code&gt;kimi-k2.7-code&lt;/code&gt; is described as coding-focused for agentic programming and repository-level edits. Qwen3.7 routes can be evaluated for planning, multimodal automation, or lower-cost experimentation according to their catalog descriptions and your own test results.&lt;/p&gt;

&lt;p&gt;Then give every route the same task:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check out a clean branch with a known failing test or a small requested change.&lt;/li&gt;
&lt;li&gt;Give Claude Code the same prompt, file scope, and tool permissions.&lt;/li&gt;
&lt;li&gt;Set the same maximum number of turns or time budget, if your workflow supports it.&lt;/li&gt;
&lt;li&gt;Record whether the tests passed, how many retries occurred, and what you had to fix manually.&lt;/li&gt;
&lt;li&gt;Record input and output token usage separately.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The final item matters because agent runs can be output-heavy. Public menu prices are listed per million tokens; calculate input and output separately rather than relying on a single blended figure.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model route&lt;/th&gt;
&lt;th&gt;Input&lt;/th&gt;
&lt;th&gt;Output&lt;/th&gt;
&lt;th&gt;Public reference link&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GLM-5.2&lt;/td&gt;
&lt;td&gt;$0.90&lt;/td&gt;
&lt;td&gt;$2.95&lt;/td&gt;
&lt;td&gt;&lt;a href="https://docs.z.ai/guides/overview/pricing" rel="noopener noreferrer"&gt;Z.ai pricing&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kimi K2.7 Code&lt;/td&gt;
&lt;td&gt;$0.699&lt;/td&gt;
&lt;td&gt;$3.00&lt;/td&gt;
&lt;td&gt;&lt;a href="https://www.alibabacloud.com/help/en/model-studio/model-pricing" rel="noopener noreferrer"&gt;Alibaba Model Studio pricing&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen3.7-Plus&lt;/td&gt;
&lt;td&gt;$0.247&lt;/td&gt;
&lt;td&gt;$1.20&lt;/td&gt;
&lt;td&gt;&lt;a href="https://www.alibabacloud.com/help/en/model-studio/model-pricing" rel="noopener noreferrer"&gt;Alibaba Model Studio pricing&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Those rows are transparent menu data, not a performance score. Check the catalog for current values before using them in a budget model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verify the same key outside Claude Code
&lt;/h2&gt;

&lt;p&gt;When a configuration fails, separate the client problem from the API problem. The direct OpenAI-compatible endpoint uses &lt;code&gt;/v1&lt;/code&gt;; test it with a small &lt;code&gt;curl&lt;/code&gt; request before changing several settings at once.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://api.glideflowai.com/v1/chat/completions &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer sk-your-key"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
    "model":"glm-5.2",
    "messages":[{"role":"user","content":"Say OK."}],
    "max_tokens":512
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use at least &lt;code&gt;512&lt;/code&gt; output tokens for a first test with a reasoning-oriented model. Very small limits can be consumed before visible text is emitted, which makes a valid request look like an empty answer.&lt;/p&gt;

&lt;p&gt;The matching Python check uses the OpenAI SDK shape:&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://api.glideflowai.com/v1&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="n"&gt;response&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;glm-5.2&lt;/span&gt;&lt;span class="sh"&gt;"&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="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;Say OK.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;
    &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;512&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;response&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;And Node.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;OpenAI&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;openai&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;GLIDEFLOW_API_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;baseURL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://api.glideflowai.com/v1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&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="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;glm-5.2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Say OK.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}],&lt;/span&gt;
  &lt;span class="na"&gt;max_tokens&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;512&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&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="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&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;The direct check is not a real Claude Code run. It narrows the problem: if &lt;code&gt;curl&lt;/code&gt; works but Claude Code does not, re-check the Anthropic-compatible base URL and the environment seen by the &lt;code&gt;claude&lt;/code&gt; process.&lt;/p&gt;

&lt;h2&gt;
  
  
  Switching models without losing the experiment
&lt;/h2&gt;

&lt;p&gt;Changing the model ID is easy; comparing model runs rigorously requires discipline. Create a small log in the repository or your issue tracker with fields for task, commit, model ID, input tokens, output tokens, tool turns, test result, and manual cleanup. Include the prompt. If you change the prompt midway through a run, note that too.&lt;/p&gt;

&lt;p&gt;For example, a useful test prompt might be: “In this branch, identify why the named unit test fails. Make the smallest fix. Run only the relevant test. Explain the changed files and stop if the test still fails.” It gives the agent a bounded goal and gives you a repeatable result across routes.&lt;/p&gt;

&lt;p&gt;Avoid switching a production repository’s default model after one impressive demo. Use a branch, keep write permissions constrained, review the diff, and retain a known-good configuration. The gateway makes configuration changes relatively small; it does not make model output safe to merge without review.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting checklist
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The endpoint is wrong
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;ANTHROPIC_BASE_URL&lt;/code&gt; must be &lt;code&gt;https://api.glideflowai.com&lt;/code&gt; with no &lt;code&gt;/v1&lt;/code&gt;. The OpenAI SDK and curl examples use &lt;code&gt;https://api.glideflowai.com/v1&lt;/code&gt;. These are different settings for different protocol paths.&lt;/p&gt;

&lt;h3&gt;
  
  
  The model ID is wrong or unavailable to the key
&lt;/h3&gt;

&lt;p&gt;Copy the exact model ID from &lt;a href="https://glideflowai.com/models" rel="noopener noreferrer"&gt;the catalog&lt;/a&gt;. An HTTP 503 response containing &lt;code&gt;无可用渠道&lt;/code&gt; means the ID is incorrect or is not enabled for the key; it is not an instruction to keep retrying the same request.&lt;/p&gt;

&lt;h3&gt;
  
  
  The response has no visible text
&lt;/h3&gt;

&lt;p&gt;Increase the output-token allowance to at least 512 for the first check. A reasoning-oriented route may use a very small limit before returning visible content.&lt;/p&gt;

&lt;h3&gt;
  
  
  The key is present in one terminal but not another
&lt;/h3&gt;

&lt;p&gt;Run &lt;code&gt;claude&lt;/code&gt; from the same shell session where the export was set, or confirm that your launcher inherits the environment. Do not print a full key into logs while debugging.&lt;/p&gt;

&lt;h3&gt;
  
  
  The agent’s behavior changed after the connection succeeded
&lt;/h3&gt;

&lt;p&gt;That is a model-evaluation question, not necessarily a configuration fault. Reduce the task, capture the prompt and tool output, compare against the same test on another route, and keep the result as evidence rather than extrapolating from one run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep configuration separate from repository policy
&lt;/h2&gt;

&lt;p&gt;Pointing Claude Code at a compatible endpoint changes how the tool reaches a model. It should not silently change the policies around your repository. Keep the same branch protection, code-review expectations, and test requirements that you would use with the default configuration. In particular, do not grant broader filesystem or shell permissions merely because an experiment needs to complete quickly. A narrow first task is valuable precisely because it tests the integration without increasing the blast radius.&lt;/p&gt;

&lt;p&gt;For a team project, write down the configuration contract next to the experiment record: the tool version, the endpoint type, the model ID, the environment-variable names, and the date of the test. Do not store the key itself. This gives another developer enough information to reproduce the setup while preserving normal credential handling. It also prevents an ambiguous report such as “Claude Code stopped working after an upgrade,” where nobody knows whether the change was in the client, the model ID, or the inherited shell environment.&lt;/p&gt;

&lt;p&gt;If a model route is selected for a recurring task, make the choice explicit in the project instructions rather than relying on one developer’s terminal history. Describe the task class and the validation requirement, for example: “use this route only for documentation edits; run the docs build before proposing a change.” That is more durable than calling any one model a general default.&lt;/p&gt;

&lt;h2&gt;
  
  
  Diagnose failures one variable at a time
&lt;/h2&gt;

&lt;p&gt;When an agent session does not start, avoid changing the endpoint, key, model ID, and prompt together. First confirm that the shell contains the expected variable names without printing the credential. Then run the direct API connectivity check. Next, verify the Claude Code base URL has no &lt;code&gt;/v1&lt;/code&gt;. Finally, copy a known catalog model ID and retry with the small “OK” prompt.&lt;/p&gt;

&lt;p&gt;When a session starts but an edit run goes badly, preserve the transcript before trying again. Was the model asked to operate outside the stated file scope? Did a test command fail because of local dependencies? Did the agent stop because the turn or output limit was reached? These are actionable observations. They are more useful than attributing every unsuccessful run to the route itself.&lt;/p&gt;

&lt;p&gt;For longer tasks, give the agent checkpoints: inspect first, propose a plan, make the smallest edit, run the named test, and summarize. Checkpoints create natural places to stop an expensive or confused run. They also produce a review trail that makes later comparisons between configurations fairer.&lt;/p&gt;

&lt;p&gt;Finally, keep the first successful configuration deliberately boring. Use one documented model ID, one small repository task, and one observable test command. Only after that baseline is repeatable should you try a larger prompt, a different model route, or broader tool permissions. This sequence may feel slower than copying a configuration snippet into a production repository, but it tells you exactly what changed when an agent run succeeds or fails. It also gives reviewers a compact diff, a known command to rerun, and a clear boundary for deciding whether the configuration is appropriate for a wider team workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next steps
&lt;/h2&gt;

&lt;p&gt;Once your first session is working, browse the &lt;a href="https://glideflowai.com/models" rel="noopener noreferrer"&gt;current model menu&lt;/a&gt; and retain only the two or three routes that your repository tests support. The companion guide, &lt;a href="https://glideflowai.com/blog/cheapest-openai-compatible-llm-gateways-coding-agents-2026" rel="noopener noreferrer"&gt;choosing an OpenAI-compatible gateway for coding agents&lt;/a&gt;, explains how to account for token usage. For model-specific selection, read &lt;a href="https://glideflowai.com/blog/claude-sonnet-5-alternatives-coding-agents-glm-kimi-qwen" rel="noopener noreferrer"&gt;GLM-5.2 vs Kimi K2.7 vs Qwen3.7 for coding agents&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>llm</category>
    </item>
  </channel>
</rss>
