Spaces:
Running
Running
Add article: Codex CLI on Modelflare in depth
Browse files- codex-cli-in-depth.html +153 -0
- index.html +1 -1
codex-cli-in-depth.html
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
| 6 |
+
<title>Codex CLI on Modelflare in depth: installer, config.toml, auth.json, and common problems | Modelflare Blog</title>
|
| 7 |
+
<meta name="description" content="Codex talks to Modelflare over the Responses API at https://modelflare.dev/v1. The setup comes down to two files under ~/.codex, and you can let the Modelflare installer write them or create them by hand. This guide walks through both paths, root installs on a VPS, each line of the documented configuration, and the four problems the docs list."><meta property="og:image" content="https://modelflare-blog.static.hf.space/images/codex-cli-in-depth-cover.jpg"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630"><meta property="og:title" content="Codex CLI on Modelflare in depth: installer, config.toml, auth.json, and common problems"><meta property="og:description" content="Codex talks to Modelflare over the Responses API at https://modelflare.dev/v1. The setup comes down to two files under ~/.codex, and you can let the Modelflare installer write them or create them by hand. This guide walks through both paths, root installs on a VPS, each line of the documented configuration, and the four problems the docs list."><meta property="og:type" content="article"><meta property="og:url" content="https://modelflare-blog.static.hf.space/codex-cli-in-depth.html"><meta property="og:site_name" content="Modelflare Blog"><meta property="article:published_time" content="2026-10-22"><link rel="canonical" href="https://modelflare-blog.static.hf.space/codex-cli-in-depth.html"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:title" content="Codex CLI on Modelflare in depth: installer, config.toml, auth.json, and common problems"><meta name="twitter:description" content="Codex talks to Modelflare over the Responses API at https://modelflare.dev/v1. The setup comes down to two files under ~/.codex, and you can let the Modelflare installer write them or create them by hand. This guide walks through both paths, root installs on a VPS, each line of the documented configuration, and the four problems the docs list."><meta name="twitter:image" content="https://modelflare-blog.static.hf.space/images/codex-cli-in-depth-cover.jpg">
|
| 8 |
+
<style>
|
| 9 |
+
:root{--bg:#0b1020;--card:#121a2f;--text:#e8ecf7;--muted:#9aa6c2;--accent:#8b5cf6;--accent2:#ec4899;--border:rgba(255,255,255,.08)}
|
| 10 |
+
*{box-sizing:border-box}
|
| 11 |
+
body{margin:0;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;background:radial-gradient(1200px 600px at 10% -10%,#2a1850 0%,transparent 50%),radial-gradient(900px 500px at 100% 0%,#3b0f2e 0%,transparent 45%),var(--bg);color:var(--text);min-height:100vh;line-height:1.65}
|
| 12 |
+
.wrap{max-width:860px;margin:0 auto;padding:28px 18px 64px}
|
| 13 |
+
header.top{display:flex;flex-wrap:wrap;gap:14px;align-items:center;justify-content:space-between;margin-bottom:28px;font-size:14px}
|
| 14 |
+
header.top a{color:var(--muted);text-decoration:none}header.top a:hover{color:#fff}
|
| 15 |
+
header.top .brand{color:#fff;font-weight:700;font-size:16px}
|
| 16 |
+
header.top nav{display:flex;flex-wrap:wrap;gap:14px}
|
| 17 |
+
h1{font-size:clamp(26px,4.6vw,38px);line-height:1.2;margin:0 0 12px}
|
| 18 |
+
h2{font-size:22px;margin:36px 0 10px}h3{font-size:17px;margin:24px 0 8px;color:#d6c7ff}
|
| 19 |
+
p,li{color:#cfd6e8}a{color:#c4b5fd}
|
| 20 |
+
.lead{color:var(--muted);font-size:17px}
|
| 21 |
+
article img{max-width:100%;height:auto;border-radius:12px;border:1px solid var(--border);display:block;margin:18px auto 6px}
|
| 22 |
+
article p em:only-child{display:block;text-align:center;color:var(--muted);font-size:14px}
|
| 23 |
+
pre{background:#070b16;border:1px solid var(--border);border-radius:12px;padding:0;overflow-x:auto}
|
| 24 |
+
pre code.hljs{background:transparent;padding:14px 16px;font-size:13.5px;line-height:1.55}
|
| 25 |
+
code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.92em}
|
| 26 |
+
p code,li code,td code{background:rgba(139,92,246,.14);padding:1px 5px;border-radius:5px}
|
| 27 |
+
table{border-collapse:collapse;width:100%;font-size:14px;margin:14px 0;display:block;overflow-x:auto}
|
| 28 |
+
th,td{border:1px solid var(--border);padding:8px 10px;text-align:left;vertical-align:top}th{background:var(--card)}
|
| 29 |
+
hr{border:0;border-top:1px solid var(--border);margin:32px 0}
|
| 30 |
+
.list{display:grid;gap:14px}
|
| 31 |
+
.card{display:flex;gap:16px;background:var(--card);border:1px solid var(--border);border-radius:16px;padding:18px;text-decoration:none;color:inherit}
|
| 32 |
+
.card:hover{border-color:rgba(139,92,246,.5)}
|
| 33 |
+
.card img{width:200px;height:105px;object-fit:cover;border-radius:10px;flex-shrink:0}
|
| 34 |
+
.card h2{font-size:18px;margin:0 0 6px;color:#fff}.card p{margin:0;color:var(--muted);font-size:14px}
|
| 35 |
+
footer{margin-top:48px;padding-top:18px;border-top:1px solid var(--border);color:var(--muted);font-size:13px}
|
| 36 |
+
footer a{color:var(--muted)}
|
| 37 |
+
@media(max-width:600px){.card{flex-direction:column}.card img{width:100%;height:auto;aspect-ratio:1200/630}}
|
| 38 |
+
</style>
|
| 39 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@highlightjs/cdn-assets@11.9.0/styles/github-dark.min.css"><script src="https://cdn.jsdelivr.net/npm/@highlightjs/cdn-assets@11.9.0/highlight.min.js"></script><script>document.addEventListener("DOMContentLoaded",()=>hljs.highlightAll());</script>
|
| 40 |
+
</head>
|
| 41 |
+
<body><div class="wrap"><header class="top"><a class="brand" href="index.html">Modelflare Blog</a><nav><a href="https://modelflare.dev/?utm_source=huggingface&utm_medium=space&utm_campaign=blog">modelflare.dev</a><a href="https://docs.modelflare.dev/?utm_source=huggingface&utm_medium=space&utm_campaign=blog">Docs</a><a href="https://castaly.modelflare.dev/?utm_source=huggingface&utm_medium=space&utm_campaign=blog">Castaly</a><a href="https://huggingface.co/Modelflare" target="_top">Hugging Face org</a></nav></header>
|
| 42 |
+
<article><h1>Codex CLI on Modelflare in depth: installer, config.toml, auth.json, and common problems</h1>
|
| 43 |
+
<p class="lead">Codex talks to Modelflare over the Responses API at <code>https://modelflare.dev/v1</code>. The setup comes down to two files under <code>~/.codex</code>, and you can let the Modelflare installer write them or create them by hand. This guide walks through both paths, root installs on a VPS, each line of the documented configuration, and the four problems the docs list.</p>
|
| 44 |
+
<img src="images/codex-cli-in-depth-cover.jpg" alt="Illustration: a keypad module sending requests through a panel to several backends">
|
| 45 |
+
<hr />
|
| 46 |
+
<p><a href="https://modelflare.dev/?utm_source=huggingface&utm_medium=space&utm_campaign=codex-cli-in-depth">Modelflare</a> serves Codex through the Responses family, <code>POST /v1/responses</code>, the same family Grok Build uses. An <a href="coding-agents-modelflare.html">earlier article</a> summarised the Codex setup alongside five other clients. This one stays with Codex and follows the <a href="https://docs.modelflare.dev/guides/clients/codex/?utm_source=huggingface&utm_medium=space&utm_campaign=codex-cli-in-depth">Codex setup guide</a> step by step. Every command and file below is copied from that page.</p>
|
| 47 |
+
<h2>Start with the key</h2>
|
| 48 |
+
<p>Both setup paths need a Modelflare API key that can reach <code>gpt-5.6-sol</code>. In the console, open <strong>API Keys</strong> and create a key in any available non-default group that lists the model. The docs do not require one particular group. When the key exists, choose between the installer (Option A) and manual files (Option B). Both end with the same files under <code>~/.codex</code>.</p>
|
| 49 |
+
<h2>Option A: the installer</h2>
|
| 50 |
+
<p>On macOS or Linux, run the installer as your normal user:</p>
|
| 51 |
+
<pre><code class="language-bash">curl -fsSL https://modelflare.dev/install/codex.sh | sh
|
| 52 |
+
</code></pre>
|
| 53 |
+
<p>On Windows, open PowerShell as your normal user:</p>
|
| 54 |
+
<pre><code class="language-powershell">irm https://modelflare.dev/install/codex.ps1 | iex
|
| 55 |
+
</code></pre>
|
| 56 |
+
<p>The script installs or updates Codex, backs up existing files before it changes them, asks for a language and your Modelflare API key, verifies that the key can access <code>gpt-5.6-sol</code>, and writes the provider configuration under <code>~/.codex</code>.</p>
|
| 57 |
+
<p>The docs also provide an <a href="https://docs.modelflare.dev/guides/clients/codex/start/?utm_source=huggingface&utm_medium=space&utm_campaign=codex-cli-in-depth">interactive first-run guide</a>, a simulated Mac or Windows walkthrough that does not change your computer. It shows the installer prompts in order: a language choice (English is option 3), an offer to install Codex CLI when it is not found (<code>Install it now? [Y/n]</code>), and a prompt to paste the API key. The input is visible while you paste. After the key passes validation the script reports <code>gpt-5.6-sol is available</code> and <code>Setup complete.</code></p>
|
| 58 |
+
<h3>Root on a VPS or in a container</h3>
|
| 59 |
+
<p>The installer expects a normal user. If you are already logged in as <code>root</code> on a VPS or in a container, set <code>MODELFLARE_ALLOW_ROOT=1</code> for the shell that runs the script:</p>
|
| 60 |
+
<pre><code class="language-bash">curl -fsSL https://modelflare.dev/install/codex.sh | MODELFLARE_ALLOW_ROOT=1 sh
|
| 61 |
+
</code></pre>
|
| 62 |
+
<p>This is not a substitute for <code>sudo</code>. The docs say not to add <code>sudo</code> on a normal personal computer. On a workstation, run the plain command as yourself so the files are written to your own <code>~/.codex</code>.</p>
|
| 63 |
+
<h2>Option B: writing the files yourself</h2>
|
| 64 |
+
<p>Use this path when you do not want to run the Modelflare setup script. First install Codex CLI from the upstream installer and confirm the version. On Linux or macOS:</p>
|
| 65 |
+
<pre><code class="language-bash">curl -fsSL https://chatgpt.com/codex/install.sh | sh
|
| 66 |
+
codex --version
|
| 67 |
+
</code></pre>
|
| 68 |
+
<p>Then create the directory and enter it:</p>
|
| 69 |
+
<pre><code class="language-bash">mkdir -p ~/.codex
|
| 70 |
+
cd ~/.codex
|
| 71 |
+
</code></pre>
|
| 72 |
+
<p>The docs give a PowerShell block for each step as well. On Windows those blocks write both files as UTF-8 without a byte-order mark.</p>
|
| 73 |
+
<h3>config.toml</h3>
|
| 74 |
+
<pre><code class="language-bash">cat > config.toml << 'EOF'
|
| 75 |
+
cli_auth_credentials_store = "file"
|
| 76 |
+
model_provider = "modelflare"
|
| 77 |
+
model = "gpt-5.6-sol"
|
| 78 |
+
model_reasoning_effort = "xhigh"
|
| 79 |
+
disable_response_storage = true
|
| 80 |
+
model_supports_reasoning_summaries = true
|
| 81 |
+
|
| 82 |
+
[model_providers.modelflare]
|
| 83 |
+
name = "Modelflare"
|
| 84 |
+
base_url = "https://modelflare.dev/v1"
|
| 85 |
+
wire_api = "responses"
|
| 86 |
+
requires_openai_auth = true
|
| 87 |
+
EOF
|
| 88 |
+
chmod 600 config.toml
|
| 89 |
+
</code></pre>
|
| 90 |
+
<p>The file has two parts. The top-level keys pick the provider and model defaults:</p>
|
| 91 |
+
<ul>
|
| 92 |
+
<li><code>cli_auth_credentials_store = "file"</code> goes with the file-based <code>auth.json</code> created in the next step.</li>
|
| 93 |
+
<li><code>model_provider = "modelflare"</code> selects the provider table defined below it, <code>[model_providers.modelflare]</code>.</li>
|
| 94 |
+
<li><code>model = "gpt-5.6-sol"</code> is the default model, the same ID used in the verification command.</li>
|
| 95 |
+
<li><code>model_reasoning_effort = "xhigh"</code>, <code>disable_response_storage = true</code>, and <code>model_supports_reasoning_summaries = true</code> are the values the docs ship. This article leaves them as documented.</li>
|
| 96 |
+
</ul>
|
| 97 |
+
<p>The provider table describes the connection:</p>
|
| 98 |
+
<ul>
|
| 99 |
+
<li><code>name = "Modelflare"</code> is the display name.</li>
|
| 100 |
+
<li><code>base_url = "https://modelflare.dev/v1"</code> is the OpenAI-style base URL, including <code>/v1</code>.</li>
|
| 101 |
+
<li><code>wire_api = "responses"</code> sends requests to the Responses family.</li>
|
| 102 |
+
<li><code>requires_openai_auth = true</code> is required by current Codex releases for this API-key path.</li>
|
| 103 |
+
</ul>
|
| 104 |
+
<h3>auth.json</h3>
|
| 105 |
+
<pre><code class="language-bash">cat > auth.json << 'EOF'
|
| 106 |
+
{
|
| 107 |
+
"auth_mode": "apikey",
|
| 108 |
+
"OPENAI_API_KEY": "YOUR_MODELFLARE_API_KEY"
|
| 109 |
+
}
|
| 110 |
+
EOF
|
| 111 |
+
chmod 600 auth.json
|
| 112 |
+
</code></pre>
|
| 113 |
+
<p>Replace <code>YOUR_MODELFLARE_API_KEY</code> with the complete key from the console. The file must stay valid JSON and keep the key in the <code>OPENAI_API_KEY</code> field. Do not add a provider <code>auth</code> command block. On macOS and Linux, both files are created with mode <code>600</code>, so only your user can read the key.</p>
|
| 114 |
+
<h2>Verify the connection</h2>
|
| 115 |
+
<p>If you used the installer, fully close every Codex CLI, IDE, or desktop session that was already open, then open a new terminal. Enter a project directory and run:</p>
|
| 116 |
+
<pre><code class="language-bash">codex --model gpt-5.6-sol
|
| 117 |
+
</code></pre>
|
| 118 |
+
<p>Then send this prompt:</p>
|
| 119 |
+
<pre><code class="language-text">Reply with one sentence confirming the active model and provider.
|
| 120 |
+
</code></pre>
|
| 121 |
+
<p>A normal reply means setup is complete. The Codex App is an optional download after setup.</p>
|
| 122 |
+
<h2>Common problems</h2>
|
| 123 |
+
<p>The docs list four symptoms:</p>
|
| 124 |
+
<table>
|
| 125 |
+
<thead>
|
| 126 |
+
<tr>
|
| 127 |
+
<th>Symptom</th>
|
| 128 |
+
<th>What to do</th>
|
| 129 |
+
</tr>
|
| 130 |
+
</thead>
|
| 131 |
+
<tbody>
|
| 132 |
+
<tr>
|
| 133 |
+
<td><code>401</code></td>
|
| 134 |
+
<td>Recopy the API key and confirm that it has not been deleted or disabled.</td>
|
| 135 |
+
</tr>
|
| 136 |
+
<tr>
|
| 137 |
+
<td><code>model_not_found</code></td>
|
| 138 |
+
<td>Edit the API key and choose a group that can access <code>gpt-5.6-sol</code>.</td>
|
| 139 |
+
</tr>
|
| 140 |
+
<tr>
|
| 141 |
+
<td>ChatGPT login appears</td>
|
| 142 |
+
<td>Fully quit every Codex session and reopen the CLI.</td>
|
| 143 |
+
</tr>
|
| 144 |
+
<tr>
|
| 145 |
+
<td><code>codex</code> is not found</td>
|
| 146 |
+
<td>Open a new terminal. On Windows, try <code>codex.cmd</code>.</td>
|
| 147 |
+
</tr>
|
| 148 |
+
</tbody>
|
| 149 |
+
</table>
|
| 150 |
+
<p>The first two rows separate the causes: a <code>401</code> is fixed on the key value, and <code>model_not_found</code> on the group the key belongs to.</p>
|
| 151 |
+
<p>To keep several Codex profiles, the <a href="https://docs.modelflare.dev/guides/clients/cc-switch/?utm_source=huggingface&utm_medium=space&utm_campaign=codex-cli-in-depth">CC-Switch guide</a> imports a Modelflare key into CC-Switch directly. Restart Codex when CC-Switch asks you to after you enable the imported provider. For team setups or volume usage, contact <a href="mailto:business@modelflare.dev">business@modelflare.dev</a>.</p></article><p><a href="index.html">← All articles</a></p>
|
| 152 |
+
<footer>Modelflare on Hugging Face: <a href="https://huggingface.co/spaces/Modelflare/start" target="_top">start</a> 路 <a href="https://huggingface.co/spaces/Modelflare/openai-sdk" target="_top">openai-sdk</a> 路 <a href="https://huggingface.co/spaces/Modelflare/coding-agents" target="_top">coding-agents</a> 路 <a href="https://huggingface.co/spaces/Modelflare/api-recipes" target="_top">api-recipes</a> 路 <a href="https://huggingface.co/datasets/Modelflare/api-examples" target="_top">api-examples dataset</a><br>Business: <a href="mailto:business@modelflare.dev">business@modelflare.dev</a></footer></div></body>
|
| 153 |
+
</html>
|
index.html
CHANGED
|
@@ -39,6 +39,6 @@ footer a{color:var(--muted)}
|
|
| 39 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@highlightjs/cdn-assets@11.9.0/styles/github-dark.min.css"><script src="https://cdn.jsdelivr.net/npm/@highlightjs/cdn-assets@11.9.0/highlight.min.js"></script><script>document.addEventListener("DOMContentLoaded",()=>hljs.highlightAll());</script>
|
| 40 |
</head>
|
| 41 |
<body><div class="wrap"><header class="top"><a class="brand" href="index.html">Modelflare Blog</a><nav><a href="https://modelflare.dev/?utm_source=huggingface&utm_medium=space&utm_campaign=blog">modelflare.dev</a><a href="https://docs.modelflare.dev/?utm_source=huggingface&utm_medium=space&utm_campaign=blog">Docs</a><a href="https://castaly.modelflare.dev/?utm_source=huggingface&utm_medium=space&utm_campaign=blog">Castaly</a><a href="https://huggingface.co/Modelflare" target="_top">Hugging Face org</a></nav></header>
|
| 42 |
-
<h1>Modelflare Blog</h1><p class="lead">Engineering notes and setup guides for Modelflare, the API gateway for text, image, and video models, and for Castaly, the studio built on it.</p><div class="list"><a class="card" href="introducing-modelflare.html"><img src="images/introducing-modelflare-cover.jpg" alt="Diagram: one entry point routed to several model backends"><div><h2>Introducing Modelflare: one API key for text, image, and video models</h2><p>Modelflare is an API gateway that serves text, image, and video models behind one key, with OpenAI-compatible, Anthropic, and Gemini endpoints and per-request cost records.</p></div></a><a class="card" href="openai-sdk-one-line.html"><img src="images/openai-sdk-one-line-cover.jpg" alt="Diagram: a request passing through a compatible interface"><div><h2>Switching the OpenAI SDK to Modelflare (Python, JavaScript, curl)</h2><p>Existing OpenAI SDK code works with Modelflare after changing the base URL to <code>https://modelflare.dev/v1</code> and supplying a Modelflare key.</p></div></a><a class="card" href="coding-agents-modelflare.html"><img src="images/coding-agents-modelflare-cover.jpg" alt="Diagram: a coding agent connected through a gateway to several services"><div><h2>Configuring coding agents with Modelflare: Claude Code, Codex, OpenCode, Gemini CLI, CC-Switch, and Grok Build</h2><p>Claude Code connects through Anthropic Messages at <code>https://modelflare.dev</code>, Codex, OpenCode, and Grok Build through <code>https://modelflare.dev/v1</code>, and Gemini CLI through <code>GOOGLE_GEMINI_BASE_URL</code>. All of them use the same Modelflare key.</p></div></a><a class="card" href="api-recipes-streaming-fallback.html"><img src="images/api-recipes-streaming-fallback-cover.jpg" alt="Diagram: parallel routes converging with fallback paths"><div><h2>Modelflare API recipes: streaming, routing fallback, images, and async video</h2><p>Request examples for streaming chat, gateway-side fallback with group failover and Smart API Keys, client-side model fallback, image generation, and the asynchronous video task flow.</p></div></a><a class="card" href="smart-api-key.html"><img src="images/smart-api-key-cover.jpg" alt="Illustration: a key module feeding a single route"><div><h2>Smart API Keys: one key for every model your account can use</h2><p>A Smart API Key is bound to <code>auto</code> instead of a fixed routing group. It resolves a group on each request and orders candidates by a routing strategy that you choose.</p></div></a><a class="card" href="model-groups-and-failover.html"><img src="images/model-groups-and-failover-cover.jpg" alt="Illustration: parallel routes converging on one output"><div><h2>Model groups and failover: how Modelflare routes a request</h2><p>Every request depends on two identifiers: the exact model ID in the body and the routing group on the key. Ordinary keys add ordered fallback groups that take over when a route cannot serve the request.</p></div></a><a class="card" href="usage-and-cost-records.html"><img src="images/usage-and-cost-records-cover.jpg" alt="Illustration: a balance weighing request units"><div><h2>Usage and cost records: reading what each request cost</h2><p>Modelflare records token usage and cost for every request. This guide covers where those records live, how billing units differ between text, image, and video, the cache hit guarantee, and how long logs are kept.</p></div></a><a class="card" href="media-skill-for-agents.html"><img src="images/media-skill-for-agents-cover.jpg" alt="Illustration: media inputs feeding a processing unit and a film strip"><div><h2>The Modelflare Media Skill: image and video generation from coding agents</h2><p>The Media Skill is an installable SKILL.md package. With it, Claude Code, Codex, and other skill-aware agents can choose a Modelflare image or video model, quote its price, send the request, and save the result.</p></div></a><a class="card" href="seedance-asset-library.html"><img src="images/seedance-asset-library-cover.jpg" alt="Illustration: image and media tiles feeding a central processing unit"><div><h2>The Seedance asset library: uploading reference media and using asset:// IDs</h2><p>Seedance 2.0 and 2.5 do not accept a photorealistic person or a realistic face as an image URL. Upload the media to the asset library, poll until it is <code>Active</code>, and reference it as <code>asset://<ID></code> in a video request.</p></div></a><a class="card" href="castaly-image-video-studio.html"><img src="images/castaly-cover.jpg" alt="Castaly cover: orbital ring city"><div><h2>Castaly: an AI video and image studio built on Modelflare</h2><p>Castaly is a browser studio for AI image and video generation. Models are compared by specification and price, generations are paid from a wallet shared with Modelflare, and every model is also available through the Modelflare API.</p></div></a></div>
|
| 43 |
<footer>Modelflare on Hugging Face: <a href="https://huggingface.co/spaces/Modelflare/start" target="_top">start</a> 路 <a href="https://huggingface.co/spaces/Modelflare/openai-sdk" target="_top">openai-sdk</a> 路 <a href="https://huggingface.co/spaces/Modelflare/coding-agents" target="_top">coding-agents</a> 路 <a href="https://huggingface.co/spaces/Modelflare/api-recipes" target="_top">api-recipes</a> 路 <a href="https://huggingface.co/datasets/Modelflare/api-examples" target="_top">api-examples dataset</a><br>Business: <a href="mailto:business@modelflare.dev">business@modelflare.dev</a></footer></div></body>
|
| 44 |
</html>
|
|
|
|
| 39 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@highlightjs/cdn-assets@11.9.0/styles/github-dark.min.css"><script src="https://cdn.jsdelivr.net/npm/@highlightjs/cdn-assets@11.9.0/highlight.min.js"></script><script>document.addEventListener("DOMContentLoaded",()=>hljs.highlightAll());</script>
|
| 40 |
</head>
|
| 41 |
<body><div class="wrap"><header class="top"><a class="brand" href="index.html">Modelflare Blog</a><nav><a href="https://modelflare.dev/?utm_source=huggingface&utm_medium=space&utm_campaign=blog">modelflare.dev</a><a href="https://docs.modelflare.dev/?utm_source=huggingface&utm_medium=space&utm_campaign=blog">Docs</a><a href="https://castaly.modelflare.dev/?utm_source=huggingface&utm_medium=space&utm_campaign=blog">Castaly</a><a href="https://huggingface.co/Modelflare" target="_top">Hugging Face org</a></nav></header>
|
| 42 |
+
<h1>Modelflare Blog</h1><p class="lead">Engineering notes and setup guides for Modelflare, the API gateway for text, image, and video models, and for Castaly, the studio built on it.</p><div class="list"><a class="card" href="introducing-modelflare.html"><img src="images/introducing-modelflare-cover.jpg" alt="Diagram: one entry point routed to several model backends"><div><h2>Introducing Modelflare: one API key for text, image, and video models</h2><p>Modelflare is an API gateway that serves text, image, and video models behind one key, with OpenAI-compatible, Anthropic, and Gemini endpoints and per-request cost records.</p></div></a><a class="card" href="openai-sdk-one-line.html"><img src="images/openai-sdk-one-line-cover.jpg" alt="Diagram: a request passing through a compatible interface"><div><h2>Switching the OpenAI SDK to Modelflare (Python, JavaScript, curl)</h2><p>Existing OpenAI SDK code works with Modelflare after changing the base URL to <code>https://modelflare.dev/v1</code> and supplying a Modelflare key.</p></div></a><a class="card" href="coding-agents-modelflare.html"><img src="images/coding-agents-modelflare-cover.jpg" alt="Diagram: a coding agent connected through a gateway to several services"><div><h2>Configuring coding agents with Modelflare: Claude Code, Codex, OpenCode, Gemini CLI, CC-Switch, and Grok Build</h2><p>Claude Code connects through Anthropic Messages at <code>https://modelflare.dev</code>, Codex, OpenCode, and Grok Build through <code>https://modelflare.dev/v1</code>, and Gemini CLI through <code>GOOGLE_GEMINI_BASE_URL</code>. All of them use the same Modelflare key.</p></div></a><a class="card" href="api-recipes-streaming-fallback.html"><img src="images/api-recipes-streaming-fallback-cover.jpg" alt="Diagram: parallel routes converging with fallback paths"><div><h2>Modelflare API recipes: streaming, routing fallback, images, and async video</h2><p>Request examples for streaming chat, gateway-side fallback with group failover and Smart API Keys, client-side model fallback, image generation, and the asynchronous video task flow.</p></div></a><a class="card" href="smart-api-key.html"><img src="images/smart-api-key-cover.jpg" alt="Illustration: a key module feeding a single route"><div><h2>Smart API Keys: one key for every model your account can use</h2><p>A Smart API Key is bound to <code>auto</code> instead of a fixed routing group. It resolves a group on each request and orders candidates by a routing strategy that you choose.</p></div></a><a class="card" href="model-groups-and-failover.html"><img src="images/model-groups-and-failover-cover.jpg" alt="Illustration: parallel routes converging on one output"><div><h2>Model groups and failover: how Modelflare routes a request</h2><p>Every request depends on two identifiers: the exact model ID in the body and the routing group on the key. Ordinary keys add ordered fallback groups that take over when a route cannot serve the request.</p></div></a><a class="card" href="usage-and-cost-records.html"><img src="images/usage-and-cost-records-cover.jpg" alt="Illustration: a balance weighing request units"><div><h2>Usage and cost records: reading what each request cost</h2><p>Modelflare records token usage and cost for every request. This guide covers where those records live, how billing units differ between text, image, and video, the cache hit guarantee, and how long logs are kept.</p></div></a><a class="card" href="media-skill-for-agents.html"><img src="images/media-skill-for-agents-cover.jpg" alt="Illustration: media inputs feeding a processing unit and a film strip"><div><h2>The Modelflare Media Skill: image and video generation from coding agents</h2><p>The Media Skill is an installable SKILL.md package. With it, Claude Code, Codex, and other skill-aware agents can choose a Modelflare image or video model, quote its price, send the request, and save the result.</p></div></a><a class="card" href="seedance-asset-library.html"><img src="images/seedance-asset-library-cover.jpg" alt="Illustration: image and media tiles feeding a central processing unit"><div><h2>The Seedance asset library: uploading reference media and using asset:// IDs</h2><p>Seedance 2.0 and 2.5 do not accept a photorealistic person or a realistic face as an image URL. Upload the media to the asset library, poll until it is <code>Active</code>, and reference it as <code>asset://<ID></code> in a video request.</p></div></a><a class="card" href="codex-cli-in-depth.html"><img src="images/codex-cli-in-depth-cover.jpg" alt="Illustration: a keypad module sending requests through a panel to several backends"><div><h2>Codex CLI on Modelflare in depth: installer, config.toml, auth.json, and common problems</h2><p>Codex connects over the Responses API at <code>https://modelflare.dev/v1</code>. This guide covers the installer and the root/VPS variant with <code>MODELFLARE_ALLOW_ROOT=1</code>, every key in <code>config.toml</code>, the <code>auth.json</code> format, and the four documented problems.</p></div></a><a class="card" href="castaly-image-video-studio.html"><img src="images/castaly-cover.jpg" alt="Castaly cover: orbital ring city"><div><h2>Castaly: an AI video and image studio built on Modelflare</h2><p>Castaly is a browser studio for AI image and video generation. Models are compared by specification and price, generations are paid from a wallet shared with Modelflare, and every model is also available through the Modelflare API.</p></div></a></div>
|
| 43 |
<footer>Modelflare on Hugging Face: <a href="https://huggingface.co/spaces/Modelflare/start" target="_top">start</a> 路 <a href="https://huggingface.co/spaces/Modelflare/openai-sdk" target="_top">openai-sdk</a> 路 <a href="https://huggingface.co/spaces/Modelflare/coding-agents" target="_top">coding-agents</a> 路 <a href="https://huggingface.co/spaces/Modelflare/api-recipes" target="_top">api-recipes</a> 路 <a href="https://huggingface.co/datasets/Modelflare/api-examples" target="_top">api-examples dataset</a><br>Business: <a href="mailto:business@modelflare.dev">business@modelflare.dev</a></footer></div></body>
|
| 44 |
</html>
|