Chat / streaming / list models / Responses / Anthropic / images / video. Auth: Authorization: Bearer YOUR_MODELFLARE_API_KEY. When fields vary by model, follow the linked docs pages.
gpt-5.6-sol must be enabled on your key’s group. Live catalog = console.| Family | Entry | Use for |
|---|---|---|
| Chat Completions | POST /v1/chat/completions | OpenAI-compatible chat |
| Responses | POST /v1/responses | Codex, Grok Build |
| Anthropic Messages | ANTHROPIC_BASE_URL=https://modelflare.dev | Claude Code (CLI appends path) |
| Images | POST /v1/images/generations | GPT Images / Wan / Seedream |
| Gemini native | POST /v1/models/{model}:generateContent | Gemini image models (Gemini CLI builds the same path under /v1beta, served only on modelflare.dev) |
| Video | POST /v1/videos → poll GET /v1/videos/{task_id} → GET /v1/videos/{task_id}/content | Async video tasks |
| Models | GET /v1/models | Models the current key can call |
Full table: docs → endpoints
curl https://modelflare.dev/v1/chat/completions \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.6-sol","messages":[{"role":"user","content":"ping"}]}'
from openai import OpenAI
client = OpenAI(
api_key="YOUR_MODELFLARE_API_KEY",
base_url="https://modelflare.dev/v1",
)
r = client.chat.completions.create(
model="gpt-5.6-sol",
messages=[{"role": "user", "content": "Hello from Hugging Face"}],
)
print(r.choices[0].message.content)
The docs do not include a streaming example; this follows the OpenAI SDK stream=True pattern. Once content has been sent, the gateway does not replay a stream on another route.
stream = client.chat.completions.create(
model="gpt-5.6-sol",
messages=[{"role": "user", "content": "Say hi in one line"}],
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="", flush=True)
curl https://modelflare.dev/v1/models \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY"
For full Codex install and wire_api=responses, follow the docs. This is a minimal request sketch only.
curl https://modelflare.dev/v1/responses \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.6-sol","input":"Reply with one sentence confirming the model."}'
The docs document Anthropic Messages through Claude Code: set ANTHROPIC_BASE_URL=https://modelflare.dev (no /v1); the CLI appends the Messages path itself. Raw HTTP headers are not documented, so no curl sketch is shown.
Documented gpt-image-2 example. Fields vary by model; use a Smart API Key or a media group key.
curl https://modelflare.dev/v1/images/generations \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "A white cat runs through a neon-lit street in the rain",
"size": "1024x1024", "n": 1
}'
POST /v1/videos creates an async task and returns id (compatibility responses may use task_id). The body is family-specific; this is the documented Seedance example.GET /v1/videos/{task_id} while status is queued or in_progress; stop at completed or failed.GET /v1/videos/{task_id}/content; result URLs can expire, so store the file promptly.curl https://modelflare.dev/v1/videos \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2.5",
"content": [{"type": "text", "text": "A cat walks through a sunlit room"}],
"resolution": "720p",
"duration": 5,
"ratio": "16:9"
}'
curl https://modelflare.dev/v1/videos/TASK_ID \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY"
curl --fail --location \
https://modelflare.dev/v1/videos/TASK_ID/content \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
--output seedance-result.mp4