Spaces:
Running
Running
Upload README.md
Browse files
README.md
CHANGED
|
@@ -16,10 +16,6 @@ license: mit
|
|
| 16 |
One key for OpenAI-compatible Chat & Responses, Anthropic Messages, plus native image and video contracts —
|
| 17 |
with ordered model-group fallbacks, per-request usage & cost tracking, Smart keys, and cache hit guarantee.
|
| 18 |
</p>
|
| 19 |
-
<p>
|
| 20 |
-
中文:统一 AI API 网关(文本 / 图片 / 视频),OpenAI 兼容,一行切换 <code>base_url</code>,
|
| 21 |
-
带分组故障转移、按请求用量成本、Smart keys 与缓存命中保障。
|
| 22 |
-
</p>
|
| 23 |
</div>
|
| 24 |
|
| 25 |
<a href="https://modelflare.dev/?utm_source=huggingface&utm_medium=org&utm_campaign=card" class="block overflow-hidden group">
|
|
@@ -47,7 +43,7 @@ license: mit
|
|
| 47 |
<div class="w-full h-28 mb-2 rounded-lg flex items-center justify-center bg-gradient-to-br from-violet-50 to-fuchsia-50 border border-gray-100 px-4">
|
| 48 |
<span class="text-lg font-semibold text-gray-800">Start here → Console</span>
|
| 49 |
</div>
|
| 50 |
-
<div class="underline">Hub landing
|
| 51 |
</a>
|
| 52 |
|
| 53 |
<a href="https://huggingface.co/spaces/Modelflare/openai-sdk" class="block overflow-hidden group">
|
|
@@ -78,6 +74,13 @@ license: mit
|
|
| 78 |
<div class="underline">JSONL request sketches</div>
|
| 79 |
</a>
|
| 80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
<a href="https://docs.modelflare.dev/guides/features/?utm_source=huggingface&utm_medium=org&utm_campaign=card" class="block overflow-hidden group">
|
| 82 |
<div class="w-full h-28 mb-2 rounded-lg flex items-center justify-center bg-gradient-to-br from-indigo-50 to-pink-50 border border-gray-100 px-4">
|
| 83 |
<span class="text-lg font-semibold text-gray-800">Platform Features</span>
|
|
@@ -93,7 +96,7 @@ license: mit
|
|
| 93 |
<li><strong>Group failover</strong> so one unavailable route does not fail the request</li>
|
| 94 |
<li><strong>Per-request</strong> token, image, and video cost records</li>
|
| 95 |
<li><strong>Smart keys</strong> and <strong>cache hit guarantee</strong></li>
|
| 96 |
-
<li>Guides for <strong>Codex, Claude Code, Gemini CLI</strong>
|
| 97 |
</ul>
|
| 98 |
</div>
|
| 99 |
|
|
@@ -103,12 +106,12 @@ license: mit
|
|
| 103 |
<pre class="break-words whitespace-pre-line text-xs md:text-sm text-gray-800">from openai import OpenAI
|
| 104 |
|
| 105 |
client = OpenAI(
|
| 106 |
-
api_key="
|
| 107 |
base_url="https://modelflare.dev/v1",
|
| 108 |
)
|
| 109 |
|
| 110 |
r = client.chat.completions.create(
|
| 111 |
-
model="
|
| 112 |
messages=[{"role":"user","content":"Hello from Hugging Face"}],
|
| 113 |
)
|
| 114 |
print(r.choices[0].message.content)</pre>
|
|
@@ -117,9 +120,10 @@ print(r.choices[0].message.content)</pre>
|
|
| 117 |
Create a key in the <a href="https://modelflare.dev/?utm_source=huggingface&utm_medium=org&utm_campaign=card" class="underline">console</a>,
|
| 118 |
then switch <code>base_url</code> to <code>https://modelflare.dev/v1</code>.
|
| 119 |
Full guides: <a href="https://docs.modelflare.dev/?utm_source=huggingface&utm_medium=org&utm_campaign=card" class="underline">docs.modelflare.dev</a>
|
| 120 |
-
·
|
| 121 |
· recipes: <a href="https://huggingface.co/spaces/Modelflare/api-recipes" class="underline">api-recipes</a>
|
| 122 |
-
· agents: <a href="https://huggingface.co/spaces/Modelflare/coding-agents" class="underline">coding-agents</a>
|
|
|
|
| 123 |
</p>
|
| 124 |
</div>
|
| 125 |
|
|
|
|
| 16 |
One key for OpenAI-compatible Chat & Responses, Anthropic Messages, plus native image and video contracts —
|
| 17 |
with ordered model-group fallbacks, per-request usage & cost tracking, Smart keys, and cache hit guarantee.
|
| 18 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</div>
|
| 20 |
|
| 21 |
<a href="https://modelflare.dev/?utm_source=huggingface&utm_medium=org&utm_campaign=card" class="block overflow-hidden group">
|
|
|
|
| 43 |
<div class="w-full h-28 mb-2 rounded-lg flex items-center justify-center bg-gradient-to-br from-violet-50 to-fuchsia-50 border border-gray-100 px-4">
|
| 44 |
<span class="text-lg font-semibold text-gray-800">Start here → Console</span>
|
| 45 |
</div>
|
| 46 |
+
<div class="underline">Hub landing</div>
|
| 47 |
</a>
|
| 48 |
|
| 49 |
<a href="https://huggingface.co/spaces/Modelflare/openai-sdk" class="block overflow-hidden group">
|
|
|
|
| 74 |
<div class="underline">JSONL request sketches</div>
|
| 75 |
</a>
|
| 76 |
|
| 77 |
+
<a href="https://huggingface.co/spaces/Modelflare/blog" class="block overflow-hidden group">
|
| 78 |
+
<div class="w-full h-28 mb-2 rounded-lg flex items-center justify-center bg-gradient-to-br from-sky-50 to-indigo-50 border border-gray-100 px-4">
|
| 79 |
+
<span class="text-lg font-semibold text-gray-800">Blog</span>
|
| 80 |
+
</div>
|
| 81 |
+
<div class="underline">Setup guides and engineering notes</div>
|
| 82 |
+
</a>
|
| 83 |
+
|
| 84 |
<a href="https://docs.modelflare.dev/guides/features/?utm_source=huggingface&utm_medium=org&utm_campaign=card" class="block overflow-hidden group">
|
| 85 |
<div class="w-full h-28 mb-2 rounded-lg flex items-center justify-center bg-gradient-to-br from-indigo-50 to-pink-50 border border-gray-100 px-4">
|
| 86 |
<span class="text-lg font-semibold text-gray-800">Platform Features</span>
|
|
|
|
| 96 |
<li><strong>Group failover</strong> so one unavailable route does not fail the request</li>
|
| 97 |
<li><strong>Per-request</strong> token, image, and video cost records</li>
|
| 98 |
<li><strong>Smart keys</strong> and <strong>cache hit guarantee</strong></li>
|
| 99 |
+
<li>Guides for <strong>Codex, Claude Code, Gemini CLI</strong>: see the Coding Agents Space and the <a href="https://huggingface.co/spaces/Modelflare/blog">Blog</a></li>
|
| 100 |
</ul>
|
| 101 |
</div>
|
| 102 |
|
|
|
|
| 106 |
<pre class="break-words whitespace-pre-line text-xs md:text-sm text-gray-800">from openai import OpenAI
|
| 107 |
|
| 108 |
client = OpenAI(
|
| 109 |
+
api_key="YOUR_MODELFLARE_API_KEY",
|
| 110 |
base_url="https://modelflare.dev/v1",
|
| 111 |
)
|
| 112 |
|
| 113 |
r = client.chat.completions.create(
|
| 114 |
+
model="gpt-5.6-sol", # must be enabled on your group
|
| 115 |
messages=[{"role":"user","content":"Hello from Hugging Face"}],
|
| 116 |
)
|
| 117 |
print(r.choices[0].message.content)</pre>
|
|
|
|
| 120 |
Create a key in the <a href="https://modelflare.dev/?utm_source=huggingface&utm_medium=org&utm_campaign=card" class="underline">console</a>,
|
| 121 |
then switch <code>base_url</code> to <code>https://modelflare.dev/v1</code>.
|
| 122 |
Full guides: <a href="https://docs.modelflare.dev/?utm_source=huggingface&utm_medium=org&utm_campaign=card" class="underline">docs.modelflare.dev</a>
|
| 123 |
+
· SDK walkthrough: <a href="https://huggingface.co/spaces/Modelflare/openai-sdk" class="underline">openai-sdk</a>
|
| 124 |
· recipes: <a href="https://huggingface.co/spaces/Modelflare/api-recipes" class="underline">api-recipes</a>
|
| 125 |
+
· agents: <a href="https://huggingface.co/spaces/Modelflare/coding-agents" class="underline">coding-agents</a>
|
| 126 |
+
· blog: <a href="https://huggingface.co/spaces/Modelflare/blog" class="underline">Modelflare/blog</a>.
|
| 127 |
</p>
|
| 128 |
</div>
|
| 129 |
|