blog / introducing-modelflare.html
modelflaredev's picture
Upload 11 files
e6f9c10 verified
Raw History Blame Contribute Delete
11.4 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Introducing Modelflare: one API key for text, image, and video models | Modelflare Blog</title>
<meta name="description" content="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."><meta property="og:image" content="images/introducing-modelflare-cover.jpg">
<style>
:root{--bg:#0b1020;--card:#121a2f;--text:#e8ecf7;--muted:#9aa6c2;--accent:#8b5cf6;--accent2:#ec4899;--border:rgba(255,255,255,.08)}
*{box-sizing:border-box}
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}
.wrap{max-width:860px;margin:0 auto;padding:28px 18px 64px}
header.top{display:flex;flex-wrap:wrap;gap:14px;align-items:center;justify-content:space-between;margin-bottom:28px;font-size:14px}
header.top a{color:var(--muted);text-decoration:none}header.top a:hover{color:#fff}
header.top .brand{color:#fff;font-weight:700;font-size:16px}
header.top nav{display:flex;flex-wrap:wrap;gap:14px}
h1{font-size:clamp(26px,4.6vw,38px);line-height:1.2;margin:0 0 12px}
h2{font-size:22px;margin:36px 0 10px}h3{font-size:17px;margin:24px 0 8px;color:#d6c7ff}
p,li{color:#cfd6e8}a{color:#c4b5fd}
.lead{color:var(--muted);font-size:17px}
article img{max-width:100%;height:auto;border-radius:12px;border:1px solid var(--border);display:block;margin:18px auto 6px}
article p em:only-child{display:block;text-align:center;color:var(--muted);font-size:14px}
pre{background:#070b16;border:1px solid var(--border);border-radius:12px;padding:0;overflow-x:auto}
pre code.hljs{background:transparent;padding:14px 16px;font-size:13.5px;line-height:1.55}
code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.92em}
p code,li code,td code{background:rgba(139,92,246,.14);padding:1px 5px;border-radius:5px}
table{border-collapse:collapse;width:100%;font-size:14px;margin:14px 0;display:block;overflow-x:auto}
th,td{border:1px solid var(--border);padding:8px 10px;text-align:left;vertical-align:top}th{background:var(--card)}
hr{border:0;border-top:1px solid var(--border);margin:32px 0}
.list{display:grid;gap:14px}
.card{display:flex;gap:16px;background:var(--card);border:1px solid var(--border);border-radius:16px;padding:18px;text-decoration:none;color:inherit}
.card:hover{border-color:rgba(139,92,246,.5)}
.card img{width:200px;height:105px;object-fit:cover;border-radius:10px;flex-shrink:0}
.card h2{font-size:18px;margin:0 0 6px;color:#fff}.card p{margin:0;color:var(--muted);font-size:14px}
footer{margin-top:48px;padding-top:18px;border-top:1px solid var(--border);color:var(--muted);font-size:13px}
footer a{color:var(--muted)}
@media(max-width:600px){.card{flex-direction:column}.card img{width:100%;height:auto;aspect-ratio:1200/630}}
</style>
<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>
</head>
<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>
<article><h1>Introducing Modelflare: one API key for text, image, and video models</h1>
<p class="lead">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>
<img src="images/introducing-modelflare-cover.jpg" alt="Diagram: one entry point routed to several model backends">
<hr />
<p><a href="https://modelflare.dev/?utm_source=huggingface&amp;utm_medium=space&amp;utm_campaign=introducing-modelflare">Modelflare</a> is a unified API gateway for text, image, and video models. One API key covers OpenAI-compatible chat, the Responses API, Anthropic Messages, image generation, and asynchronous video. Usage and cost are recorded for every request. This post covers the endpoints, how keys and routing groups work, and how to send a first request.</p>
<h2>What the gateway provides</h2>
<p>Chat Completions, Responses, Anthropic Messages, Images, and Video share the same authentication and routing groups. Applications built on the OpenAI SDK change the base URL to <code>https://modelflare.dev/v1</code> and keep the rest of their code. Image and video families that have their own request formats, such as GPT Images, Gemini native image, and the async video models, keep their native fields; the <a href="https://docs.modelflare.dev/?utm_source=huggingface&amp;utm_medium=space&amp;utm_campaign=introducing-modelflare">documentation</a> describes each contract separately instead of mapping them onto a single schema.</p>
<p>The catalog lists 14 image models (GPT Images, Gemini Image, Wan, Seedream) and 28 video models (Seedance, Wan, Kling, MiniMax, HappyHorse). Text models from GPT, Claude, Grok, and others are served over the OpenAI-compatible and Anthropic contracts.</p>
<p><img alt="Diagram: an application sends requests with one key to the Modelflare gateway, which serves six API families" src="images/fig-architecture.svg" />
<em>One key and one gateway in front of Chat Completions, Responses, Anthropic Messages, Images, Gemini native, and Video.</em></p>
<h2>Endpoints</h2>
<table>
<thead>
<tr>
<th>Family</th>
<th>Endpoint</th>
<th>Typical use</th>
</tr>
</thead>
<tbody>
<tr>
<td>Chat Completions</td>
<td><code>POST /v1/chat/completions</code></td>
<td>OpenAI-compatible chat</td>
</tr>
<tr>
<td>Responses</td>
<td><code>POST /v1/responses</code></td>
<td>Codex, Grok Build</td>
</tr>
<tr>
<td>Anthropic Messages</td>
<td><code>ANTHROPIC_BASE_URL=https://modelflare.dev</code></td>
<td>Claude Code</td>
</tr>
<tr>
<td>Images</td>
<td><code>POST /v1/images/generations</code></td>
<td>GPT Images, Wan Image, Seedream</td>
</tr>
<tr>
<td>Gemini native</td>
<td><code>POST /v1/models/{model}:generateContent</code></td>
<td>Gemini image models (Gemini CLI builds the same path under <code>/v1beta</code>, served only on <code>modelflare.dev</code>)</td>
</tr>
<tr>
<td>Video</td>
<td><code>POST /v1/videos</code>, poll <code>GET /v1/videos/{task_id}</code>, download <code>GET /v1/videos/{task_id}/content</code></td>
<td>Seedance, Wan, Kling, MiniMax, HappyHorse</td>
</tr>
<tr>
<td>Models</td>
<td><code>GET /v1/models</code></td>
<td>Models your key can call</td>
</tr>
</tbody>
</table>
<p>The base URL is <code>https://modelflare.dev/v1</code>. Anthropic clients use the site origin, <code>https://modelflare.dev</code>, without <code>/v1</code>, because the Claude Code CLI appends the Messages path itself. Gemini CLI reads <code>GOOGLE_GEMINI_BASE_URL=https://modelflare.dev</code>. China-facing EdgeOne traffic can use <code>https://origin.modelflare.dev/v1</code>. Choose the host before sending a request; an in-flight POST should not be redirected between hosts.</p>
<h2>First request</h2>
<p>Every request carries <code>Authorization: Bearer YOUR_MODELFLARE_API_KEY</code>.</p>
<pre><code class="language-bash">curl https://modelflare.dev/v1/chat/completions \
-H &quot;Authorization: Bearer YOUR_MODELFLARE_API_KEY&quot; \
-H &quot;Content-Type: application/json&quot; \
-d '{
&quot;model&quot;: &quot;gpt-5.6-sol&quot;,
&quot;messages&quot;: [
{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Hello&quot;}
]
}'
</code></pre>
<p>Replace <code>gpt-5.6-sol</code> with any model your key can access. To list the models available to a key:</p>
<pre><code class="language-bash">curl https://modelflare.dev/v1/models \
-H &quot;Authorization: Bearer YOUR_MODELFLARE_API_KEY&quot;
</code></pre>
<h2>Models and routing groups</h2>
<p>Two identifiers decide whether a request succeeds. The model ID in the JSON body must match a public catalog ID exactly, without marketing names or date suffixes. The routing group bound to the key decides which provider channels can serve that model. Create the key in a non-default group that lists the model; if the group has no channel for it, the request fails even when the JSON is valid.</p>
<p>A Smart API Key removes the fixed group. It resolves a routing group on every request across all models the account can use, ordered by a routing strategy.</p>
<h2>Pricing</h2>
<p>Live prices, groups, and availability are published on <a href="https://modelflare.dev/pricing?utm_source=huggingface&amp;utm_medium=space&amp;utm_campaign=introducing-modelflare">Models &amp; Pricing</a>; the documentation does not keep a second price list. Language models are billed per million tokens with separate input and output rates. Image and video models are billed in the unit named on each model page: per token, per image, per call, or per second.</p>
<h2>Resources on Hugging Face</h2>
<p>The <a href="https://huggingface.co/Modelflare" target="_top">Modelflare organization</a> hosts a landing Space, <a href="https://huggingface.co/spaces/Modelflare/start" target="_top">Modelflare/start</a>; an SDK guide, <a href="https://huggingface.co/spaces/Modelflare/openai-sdk" target="_top">Modelflare/openai-sdk</a>; setup notes for coding agents, <a href="https://huggingface.co/spaces/Modelflare/coding-agents" target="_top">Modelflare/coding-agents</a>; request recipes, <a href="https://huggingface.co/spaces/Modelflare/api-recipes" target="_top">Modelflare/api-recipes</a>; and a dataset of example requests, <a href="https://huggingface.co/datasets/Modelflare/api-examples" target="_top">Modelflare/api-examples</a>.</p>
<p>Keys are created in the <a href="https://modelflare.dev/?utm_source=huggingface&amp;utm_medium=space&amp;utm_campaign=introducing-modelflare">Modelflare console</a>. Do not place a real key in a public Space or notebook. For business and enterprise inquiries, contact <a href="mailto:business@modelflare.dev">business@modelflare.dev</a>.</p></article><p><a href="index.html">&larr; All articles</a></p>
<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>
</html>