modelflaredev commited on
Commit
3f7d600
·
verified ·
1 Parent(s): 293b884

Upload api-recipes index.html

Browse files
Files changed (1) hide show
  1. index.html +314 -18
index.html CHANGED
@@ -1,19 +1,315 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
1
+ <!DOCTYPE html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <title>API Recipes — Modelflare</title>
7
+ <meta name="description" content="Copy-paste Modelflare API recipes: chat, streaming, models, Responses, Anthropic, images, video." />
8
+ <style>
9
+ :root {
10
+ --bg:#0b1020; --card:#121a2f; --text:#e8ecf7; --muted:#9aa6c2;
11
+ --accent:#8b5cf6; --accent2:#ec4899; --border:rgba(255,255,255,.08); --ok:#34d399; --warn:#fbbf24;
12
+ }
13
+ *{box-sizing:border-box}
14
+ body{
15
+ margin:0;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
16
+ background:radial-gradient(1200px 600px at 10% -10%,#2a1850 0%,transparent 50%),
17
+ radial-gradient(900px 500px at 100% 0%,#3b0f2e 0%,transparent 45%),var(--bg);
18
+ color:var(--text);min-height:100vh;line-height:1.55;
19
+ }
20
+ .wrap{max-width:880px;margin:0 auto;padding:40px 18px 64px}
21
+ .lang{display:flex;gap:8px;margin-bottom:16px}
22
+ .lang button{background:transparent;border:1px solid var(--border);color:var(--muted);border-radius:999px;padding:6px 12px;cursor:pointer}
23
+ .lang button.on{color:#fff;border-color:rgba(139,92,246,.5);background:rgba(139,92,246,.2)}
24
+ .badge{display:inline-flex;gap:8px;align-items:center;padding:6px 12px;border-radius:999px;background:rgba(139,92,246,.15);border:1px solid rgba(139,92,246,.35);color:#d6c7ff;font-size:13px;margin-bottom:18px}
25
+ h1{font-size:clamp(28px,5vw,40px);line-height:1.15;margin:0 0 12px}
26
+ .lead{color:var(--muted);font-size:17px;margin:0 0 24px;max-width:680px}
27
+ .cta{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:28px}
28
+ a.btn{display:inline-flex;align-items:center;padding:12px 16px;border-radius:12px;text-decoration:none;font-weight:600}
29
+ a.primary{background:linear-gradient(135deg,var(--accent),var(--accent2));color:#fff}
30
+ a.ghost{border:1px solid var(--border);color:var(--text)}
31
+ .grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin-bottom:28px}
32
+ .card{background:var(--card);border:1px solid var(--border);border-radius:16px;padding:18px}
33
+ .card h3{margin:0 0 8px;font-size:16px}
34
+ .card p{margin:0;color:var(--muted);font-size:14px}
35
+ h2{font-size:18px;margin:28px 0 10px}
36
+ h3.sec{font-size:15px;margin:18px 0 8px;color:#d6c7ff}
37
+ ol,ul{color:var(--muted);padding-left:1.2em}
38
+ ol li,ul li{margin:6px 0}
39
+ pre{background:#070b16;border:1px solid var(--border);border-radius:14px;padding:14px 16px;overflow:auto;font-size:12.5px;color:#d7def0;position:relative}
40
+ .copy{position:absolute;top:8px;right:8px;font-size:11px;border:1px solid var(--border);background:#121a2f;color:var(--muted);border-radius:8px;padding:4px 8px;cursor:pointer}
41
+ .foot{margin-top:24px;color:var(--muted);font-size:13px}
42
+ .note{background:var(--card);border:1px solid var(--border);border-radius:14px;padding:14px 16px;color:var(--muted);font-size:14px;margin-top:16px}
43
+ .note strong{color:var(--ok)}
44
+ .tip{border-left:3px solid var(--warn);padding-left:12px;margin:12px 0;color:var(--muted);font-size:14px}
45
+ table{width:100%;border-collapse:collapse;font-size:13px;margin:12px 0 20px}
46
+ th,td{border:1px solid var(--border);padding:10px 12px;text-align:left;vertical-align:top}
47
+ th{background:rgba(139,92,246,.12);color:#d6c7ff;font-weight:600}
48
+ td{color:var(--muted)}
49
+ code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
50
+ .hidden{display:none}
51
+ a{color:#c4b5fd}
52
+
53
+ </style>
54
+ </head>
55
+ <body>
56
+ <div class="wrap">
57
+ <div class="lang">
58
+ <button type="button" class="on" data-lang="zh">中文</button>
59
+ <button type="button" data-lang="en">English</button>
60
+ </div>
61
+
62
+ <section id="zh">
63
+ <div class="badge">📋 API Recipes</div>
64
+ <h1>Modelflare API 配方(可复制)</h1>
65
+ <p class="lead">Chat / 流式 / 列模型 / Responses / Anthropic / 图片 / 视频。鉴权统一:<code>Authorization: Bearer YOUR_MODELFLARE_API_KEY</code>。字段因模型而异时,请跳转文档站完整页。</p>
66
+ <div class="cta">
67
+ <a class="btn primary" href="https://modelflare.dev/?utm_source=huggingface&utm_medium=space&utm_campaign=api_recipes" target="_blank" rel="noopener">打开控制台 →</a>
68
+ <a class="btn ghost" href="https://docs.modelflare.dev/guides/endpoints/?utm_source=huggingface&utm_medium=space&utm_campaign=api_recipes" target="_blank" rel="noopener">端点选择</a>
69
+ <a class="btn ghost" href="https://huggingface.co/spaces/Modelflare/coding-agents" target="_blank" rel="noopener">Coding Agents</a>
70
+ <a class="btn ghost" href="https://huggingface.co/spaces/Modelflare/openai-sdk" target="_blank" rel="noopener">OpenAI SDK</a>
71
+ <a class="btn ghost" href="https://huggingface.co/datasets/Modelflare/api-examples" target="_blank" rel="noopener">示例 Dataset</a>
72
+ </div>
73
+ <div class="tip">示例模型 <code>grok-4.7</code> 等须已在当前 key 的分组开通;实时目录以控制台为准。</div>
74
+
75
+ <h2>端点速查表</h2>
76
+ <table>
77
+ <thead><tr><th>家族</th><th>入口</th><th>用途</th></tr></thead>
78
+ <tbody>
79
+ <tr><td>Chat Completions</td><td><code>POST /v1/chat/completions</code></td><td>OpenAI 兼容对话</td></tr>
80
+ <tr><td>Responses</td><td><code>POST /v1/responses</code></td><td>Codex、Grok Build</td></tr>
81
+ <tr><td>Anthropic Messages</td><td><code>ANTHROPIC_BASE_URL=https://modelflare.dev</code></td><td>Claude Code(CLI 自拼路径)</td></tr>
82
+ <tr><td>Images</td><td><code>POST /v1/images/generations</code></td><td>GPT Images / Wan / Seedream</td></tr>
83
+ <tr><td>Gemini native</td><td><code>POST /v1beta/models/{model}:generateContent</code></td><td>Gemini CLI / Gemini 图像</td></tr>
84
+ <tr><td>Video</td><td><code>POST /v1/videos</code> → poll <code>GET /v1/videos/{id}</code></td><td>异步视频任务</td></tr>
85
+ <tr><td>Models</td><td><code>GET /v1/models</code></td><td>当前 key 可调用的模型</td></tr>
86
+ </tbody>
87
+ </table>
88
+ <p class="foot">详表:<a href="https://docs.modelflare.dev/guides/endpoints/?utm_source=huggingface&utm_medium=space&utm_campaign=api_recipes" target="_blank" rel="noopener">docs → endpoints</a></p>
89
+
90
+ <h2>1) Chat Completions — curl</h2>
91
+ <pre><button class="copy" type="button">复制</button><code>curl https://modelflare.dev/v1/chat/completions \
92
+ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
93
+ -H "Content-Type: application/json" \
94
+ -d '{"model":"grok-4.7","messages":[{"role":"user","content":"ping"}]}'</code></pre>
95
+
96
+ <h2>2) Chat Completions — Python</h2>
97
+ <pre><button class="copy" type="button">复制</button><code>from openai import OpenAI
98
+
99
+ client = OpenAI(
100
+ api_key="YOUR_MODELFLARE_API_KEY",
101
+ base_url="https://modelflare.dev/v1",
102
+ )
103
+ r = client.chat.completions.create(
104
+ model="grok-4.7",
105
+ messages=[{"role": "user", "content": "Hello from Hugging Face"}],
106
+ )
107
+ print(r.choices[0].message.content)</code></pre>
108
+
109
+ <h2>3) 流式 Chat</h2>
110
+ <pre><button class="copy" type="button">复制</button><code>stream = client.chat.completions.create(
111
+ model="grok-4.7",
112
+ messages=[{"role": "user", "content": "Say hi in one line"}],
113
+ stream=True,
114
+ )
115
+ for chunk in stream:
116
+ print(chunk.choices[0].delta.content or "", end="", flush=True)</code></pre>
117
+
118
+ <h2>4) 列出模型</h2>
119
+ <pre><button class="copy" type="button">复制</button><code>curl https://modelflare.dev/v1/models \
120
+ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY"</code></pre>
121
+
122
+ <h2>5) Responses API(Codex 用)— curl 草稿</h2>
123
+ <p class="tip">完整 Codex 安装与 <code>wire_api=responses</code> 配置请看文档;此处仅为最小请求形态示意。</p>
124
+ <pre><button class="copy" type="button">复制</button><code>curl https://modelflare.dev/v1/responses \
125
+ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
126
+ -H "Content-Type: application/json" \
127
+ -d '{"model":"gpt-5.6-sol","input":"Reply with one sentence confirming the model."}'</code></pre>
128
+ <p class="foot"><a href="https://docs.modelflare.dev/guides/clients/codex/?utm_source=huggingface&utm_medium=space&utm_campaign=api_recipes" target="_blank" rel="noopener">完整 Codex 指南 →</a></p>
129
+
130
+ <h2>6) Anthropic Messages — curl 草图</h2>
131
+ <p class="tip">Claude Code 推荐用安装器 / <code>settings.json</code>。直接 HTTP 时 base 为站点根;路径由 Anthropic 约定拼出(通常为 <code>/v1/messages</code>)。完整环境变量见 Claude Code 指南。</p>
132
+ <pre><button class="copy" type="button">复制</button><code>curl https://modelflare.dev/v1/messages \
133
+ -H "x-api-key: YOUR_MODELFLARE_API_KEY" \
134
+ -H "anthropic-version: 2023-06-01" \
135
+ -H "Content-Type: application/json" \
136
+ -d '{"model":"claude-sonnet-5","max_tokens":256,"messages":[{"role":"user","content":"ping"}]}'</code></pre>
137
+ <p class="foot"><a href="https://docs.modelflare.dev/guides/clients/claude-code/?utm_source=huggingface&utm_medium=space&utm_campaign=api_recipes" target="_blank" rel="noopener">Claude Code 完整指南 →</a></p>
138
+
139
+ <h2>7) 图片生成 — 最小 curl</h2>
140
+ <p class="tip">字段因模型而异(size / quality / n 等)。请用 <code>media</code> 分组 key。详见图片模型文档。</p>
141
+ <pre><button class="copy" type="button">复制</button><code>curl https://modelflare.dev/v1/images/generations \
142
+ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
143
+ -H "Content-Type: application/json" \
144
+ -d '{"model":"YOUR_IMAGE_MODEL","prompt":"A white cat in neon rain","n":1}'</code></pre>
145
+ <p class="foot"><a href="https://docs.modelflare.dev/models/image/?utm_source=huggingface&utm_medium=space&utm_campaign=api_recipes" target="_blank" rel="noopener">图片模型文档 →</a></p>
146
+
147
+ <h2>8) 视频 — 创建任务 + 轮询(高层)</h2>
148
+ <ol>
149
+ <li><code>POST /v1/videos</code> 创建异步任务(请求信封因模型而异)。</li>
150
+ <li><code>GET /v1/videos/{task_id}</code> 轮询状态。</li>
151
+ <li>成功后 <code>GET /v1/videos/{task_id}/content</code> 下载;结果 URL 可能过期,请及时转存。</li>
152
+ </ol>
153
+ <pre><button class="copy" type="button">复制</button><code># 1) create (fields vary by model — copy from the model page)
154
+ curl https://modelflare.dev/v1/videos \
155
+ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
156
+ -H "Content-Type: application/json" \
157
+ -d '{"model":"YOUR_VIDEO_MODEL","prompt":"A calm ocean at sunrise"}'
158
+
159
+ # 2) poll
160
+ curl https://modelflare.dev/v1/videos/TASK_ID \
161
+ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY"
162
+
163
+ # 3) download when ready
164
+ curl -L https://modelflare.dev/v1/videos/TASK_ID/content \
165
+ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
166
+ -o out.mp4</code></pre>
167
+ <p class="foot"><a href="https://docs.modelflare.dev/models/video/?utm_source=huggingface&utm_medium=space&utm_campaign=api_recipes" target="_blank" rel="noopener">视频模型文档 →</a></p>
168
+
169
+ <div class="note">
170
+ <strong>从 Hub 来?</strong>
171
+ <a href="https://huggingface.co/spaces/Modelflare/start">start</a> ·
172
+ <a href="https://huggingface.co/spaces/Modelflare/coding-agents">coding-agents</a> ·
173
+ <a href="https://huggingface.co/collections/Modelflare/modelflare-getting-started">Getting Started</a>。
174
+ Gradio Chat 需 HF PRO(即将);当前请用控制台 + API。
175
+ </div>
176
+ </section>
177
+
178
+ <section id="en" class="hidden">
179
+ <div class="badge">📋 API Recipes</div>
180
+ <h1>Modelflare API recipes (copy-paste)</h1>
181
+ <p class="lead">Chat / streaming / list models / Responses / Anthropic / images / video. Auth: <code>Authorization: Bearer YOUR_MODELFLARE_API_KEY</code>. When fields vary by model, follow the linked docs pages.</p>
182
+ <div class="cta">
183
+ <a class="btn primary" href="https://modelflare.dev/?utm_source=huggingface&utm_medium=space&utm_campaign=api_recipes" target="_blank" rel="noopener">Open Console →</a>
184
+ <a class="btn ghost" href="https://docs.modelflare.dev/guides/endpoints/?utm_source=huggingface&utm_medium=space&utm_campaign=api_recipes" target="_blank" rel="noopener">Endpoint picker</a>
185
+ <a class="btn ghost" href="https://huggingface.co/spaces/Modelflare/coding-agents" target="_blank" rel="noopener">Coding Agents</a>
186
+ <a class="btn ghost" href="https://huggingface.co/spaces/Modelflare/openai-sdk" target="_blank" rel="noopener">OpenAI SDK</a>
187
+ <a class="btn ghost" href="https://huggingface.co/datasets/Modelflare/api-examples" target="_blank" rel="noopener">Examples dataset</a>
188
+ </div>
189
+ <div class="tip">Sample model <code>grok-4.7</code> etc. must be enabled on your key’s group. Live catalog = console.</div>
190
+
191
+ <h2>Endpoint picker</h2>
192
+ <table>
193
+ <thead><tr><th>Family</th><th>Entry</th><th>Use for</th></tr></thead>
194
+ <tbody>
195
+ <tr><td>Chat Completions</td><td><code>POST /v1/chat/completions</code></td><td>OpenAI-compatible chat</td></tr>
196
+ <tr><td>Responses</td><td><code>POST /v1/responses</code></td><td>Codex, Grok Build</td></tr>
197
+ <tr><td>Anthropic Messages</td><td><code>ANTHROPIC_BASE_URL=https://modelflare.dev</code></td><td>Claude Code (CLI appends path)</td></tr>
198
+ <tr><td>Images</td><td><code>POST /v1/images/generations</code></td><td>GPT Images / Wan / Seedream</td></tr>
199
+ <tr><td>Gemini native</td><td><code>POST /v1beta/models/{model}:generateContent</code></td><td>Gemini CLI / Gemini image</td></tr>
200
+ <tr><td>Video</td><td><code>POST /v1/videos</code> → poll <code>GET /v1/videos/{id}</code></td><td>Async video tasks</td></tr>
201
+ <tr><td>Models</td><td><code>GET /v1/models</code></td><td>Models the current key can call</td></tr>
202
+ </tbody>
203
+ </table>
204
+ <p class="foot">Full table: <a href="https://docs.modelflare.dev/guides/endpoints/?utm_source=huggingface&utm_medium=space&utm_campaign=api_recipes" target="_blank" rel="noopener">docs → endpoints</a></p>
205
+
206
+ <h2>1) Chat Completions — curl</h2>
207
+ <pre><button class="copy" type="button">Copy</button><code>curl https://modelflare.dev/v1/chat/completions \
208
+ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
209
+ -H "Content-Type: application/json" \
210
+ -d '{"model":"grok-4.7","messages":[{"role":"user","content":"ping"}]}'</code></pre>
211
+
212
+ <h2>2) Chat Completions — Python</h2>
213
+ <pre><button class="copy" type="button">Copy</button><code>from openai import OpenAI
214
+
215
+ client = OpenAI(
216
+ api_key="YOUR_MODELFLARE_API_KEY",
217
+ base_url="https://modelflare.dev/v1",
218
+ )
219
+ r = client.chat.completions.create(
220
+ model="grok-4.7",
221
+ messages=[{"role": "user", "content": "Hello from Hugging Face"}],
222
+ )
223
+ print(r.choices[0].message.content)</code></pre>
224
+
225
+ <h2>3) Streaming chat</h2>
226
+ <pre><button class="copy" type="button">Copy</button><code>stream = client.chat.completions.create(
227
+ model="grok-4.7",
228
+ messages=[{"role": "user", "content": "Say hi in one line"}],
229
+ stream=True,
230
+ )
231
+ for chunk in stream:
232
+ print(chunk.choices[0].delta.content or "", end="", flush=True)</code></pre>
233
+
234
+ <h2>4) List models</h2>
235
+ <pre><button class="copy" type="button">Copy</button><code>curl https://modelflare.dev/v1/models \
236
+ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY"</code></pre>
237
+
238
+ <h2>5) Responses API (for Codex) — curl stub</h2>
239
+ <p class="tip">For full Codex install and <code>wire_api=responses</code>, follow the docs. This is a minimal request sketch only.</p>
240
+ <pre><button class="copy" type="button">Copy</button><code>curl https://modelflare.dev/v1/responses \
241
+ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
242
+ -H "Content-Type: application/json" \
243
+ -d '{"model":"gpt-5.6-sol","input":"Reply with one sentence confirming the model."}'</code></pre>
244
+ <p class="foot"><a href="https://docs.modelflare.dev/guides/clients/codex/?utm_source=huggingface&utm_medium=space&utm_campaign=api_recipes" target="_blank" rel="noopener">Full Codex guide →</a></p>
245
+
246
+ <h2>6) Anthropic Messages — curl sketch</h2>
247
+ <p class="tip">Prefer the Claude Code installer / <code>settings.json</code>. For raw HTTP, base is the site origin; the Anthropic path is typically <code>/v1/messages</code>. See the Claude Code guide for env vars.</p>
248
+ <pre><button class="copy" type="button">Copy</button><code>curl https://modelflare.dev/v1/messages \
249
+ -H "x-api-key: YOUR_MODELFLARE_API_KEY" \
250
+ -H "anthropic-version: 2023-06-01" \
251
+ -H "Content-Type: application/json" \
252
+ -d '{"model":"claude-sonnet-5","max_tokens":256,"messages":[{"role":"user","content":"ping"}]}'</code></pre>
253
+ <p class="foot"><a href="https://docs.modelflare.dev/guides/clients/claude-code/?utm_source=huggingface&utm_medium=space&utm_campaign=api_recipes" target="_blank" rel="noopener">Full Claude Code guide →</a></p>
254
+
255
+ <h2>7) Images — minimal curl</h2>
256
+ <p class="tip">Fields vary by model (size / quality / n …). Use a <code>media</code> group key. See image model docs.</p>
257
+ <pre><button class="copy" type="button">Copy</button><code>curl https://modelflare.dev/v1/images/generations \
258
+ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
259
+ -H "Content-Type: application/json" \
260
+ -d '{"model":"YOUR_IMAGE_MODEL","prompt":"A white cat in neon rain","n":1}'</code></pre>
261
+ <p class="foot"><a href="https://docs.modelflare.dev/models/image/?utm_source=huggingface&utm_medium=space&utm_campaign=api_recipes" target="_blank" rel="noopener">Image models docs →</a></p>
262
+
263
+ <h2>8) Video — create + poll (high-level)</h2>
264
+ <ol>
265
+ <li><code>POST /v1/videos</code> creates an async task (envelope varies by model).</li>
266
+ <li>Poll <code>GET /v1/videos/{task_id}</code>.</li>
267
+ <li>Download <code>GET /v1/videos/{task_id}/content</code>; result URLs can expire — transfer promptly.</li>
268
+ </ol>
269
+ <pre><button class="copy" type="button">Copy</button><code># 1) create (fields vary by model — copy from the model page)
270
+ curl https://modelflare.dev/v1/videos \
271
+ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
272
+ -H "Content-Type: application/json" \
273
+ -d '{"model":"YOUR_VIDEO_MODEL","prompt":"A calm ocean at sunrise"}'
274
+
275
+ # 2) poll
276
+ curl https://modelflare.dev/v1/videos/TASK_ID \
277
+ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY"
278
+
279
+ # 3) download when ready
280
+ curl -L https://modelflare.dev/v1/videos/TASK_ID/content \
281
+ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
282
+ -o out.mp4</code></pre>
283
+ <p class="foot"><a href="https://docs.modelflare.dev/models/video/?utm_source=huggingface&utm_medium=space&utm_campaign=api_recipes" target="_blank" rel="noopener">Video models docs →</a></p>
284
+
285
+ <div class="note">
286
+ <strong>Coming from Hub?</strong>
287
+ <a href="https://huggingface.co/spaces/Modelflare/start">start</a> ·
288
+ <a href="https://huggingface.co/spaces/Modelflare/coding-agents">coding-agents</a> ·
289
+ <a href="https://huggingface.co/collections/Modelflare/modelflare-getting-started">Getting Started</a>.
290
+ Gradio Chat needs HF PRO (upcoming); use console + API for now.
291
+ </div>
292
+ </section>
293
+ </div>
294
+
295
+ <script>
296
+ const zh=document.getElementById('zh'), en=document.getElementById('en');
297
+ document.querySelectorAll('.lang button').forEach(btn=>{
298
+ btn.addEventListener('click',()=>{
299
+ document.querySelectorAll('.lang button').forEach(b=>b.classList.remove('on'));
300
+ btn.classList.add('on');
301
+ const l=btn.dataset.lang;
302
+ zh.classList.toggle('hidden',l!=='zh');
303
+ en.classList.toggle('hidden',l!=='en');
304
+ });
305
+ });
306
+ document.querySelectorAll('pre .copy').forEach(btn=>{
307
+ btn.addEventListener('click',async()=>{
308
+ const code=btn.parentElement.querySelector('code').innerText;
309
+ try{await navigator.clipboard.writeText(code);const t=btn.textContent;btn.textContent=t.includes('Copy')?'Copied':'已复制';setTimeout(()=>btn.textContent=t,1200)}catch(_){}
310
+ });
311
+ });
312
+ </script>
313
+
314
+ </body>
315
  </html>