Setup guides
Point your coding agent or SDK at https://api.foglare.com. Works with no
account; an optional API key adds per-key stats. Each guide has the config, a verification step and fixes for the usual failures.
Pick your tool
| Tool | Wire format | Configuration |
|---|---|---|
| Claude Code | Anthropic messages | ANTHROPIC_BASE_URL and settings.json |
| Codex CLI | OpenAI Responses | config.toml custom provider |
| OpenCode | OpenAI chat | opencode.json custom provider |
| Pi | OpenAI chat | models.json compatible endpoint |
| oh-my-pi | OpenAI chat | models.yml provider with live discovery |
| Hermes Agent | OpenAI chat | hermes model wizard or config.yaml |
| Any OpenAI-compatible client | OpenAI chat | Environment variables, curl, Python, JavaScript |
How auth works
Create an API key (sk-fog-…) from the
dashboard
and send it as Authorization: Bearer …; requests then count toward your
per-key usage stats and your account's pins and linked capacity. Browser tools can instead rely on the
foglair_session cookie from GitHub or Discord sign-in. Inference requires
one of the two — anonymous calls are rejected with 401.
Using the key from any shell
# Every inference endpoint accepts the same bearer key.
curl -N https://api.foglare.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-fog-YOUR_KEY" \
-d '{"model":"auto:fast","stream":true,"messages":[{"role":"user","content":"Hello"}]}'
# Or export it once for OpenAI-compatible SDKs and tools:
export OPENAI_API_KEY="sk-fog-YOUR_KEY"
export OPENAI_BASE_URL="https://api.foglare.com/v1" Sixty-second check
Before configuring anything, confirm the gateway answers from your machine. The model list needs no auth; the completion requires your bearer key.
List model ids
curl https://api.foglare.com/v1/models Expected response (trimmed)
{
"object": "list",
"data": [
{ "id": "deepseek-v4.1-flash", "object": "model", "created": 1763769600, "owned_by": "foglare" },
{ "id": "glm-5.3-flash", "object": "model", "created": 1763769600, "owned_by": "foglare" },
{ "id": "qwen4-max", "object": "model", "created": 1763769600, "owned_by": "foglare" },
{ "id": "auto:fast", "object": "model", "created": 1763769600, "owned_by": "foglare" },
{ "id": "auto:S", "object": "model", "created": 1763769600, "owned_by": "foglare" },
{ "id": "auto:M", "object": "model", "created": 1763769600, "owned_by": "foglare" },
{ "id": "auto:L", "object": "model", "created": 1763769600, "owned_by": "foglare" },
{ "id": "auto:XL", "object": "model", "created": 1763769600, "owned_by": "foglare" }
]
} Stream one completion
curl -N https://api.foglare.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-fog-YOUR_KEY" \
-d '{"model":"auto:fast","stream":true,"messages":[{"role":"user","content":"Hello"}]}' Expected stream (trimmed)
data: {"id":"fglr_...","object":"chat.completion.chunk","created":1795312786,"model":"auto:fast","choices":[{"index":0,"delta":{"content":"Hello"},"finish_reason":null}]}
data: {"id":"fglr_...","object":"chat.completion.chunk","created":1795312786,"model":"auto:fast","choices":[{"index":0,"delta":{"content":"! How can I help?"},"finish_reason":null}]}
data: {"id":"fglr_...","object":"chat.completion.chunk","created":1795312786,"model":"auto:fast","choices":[{"index":0,"delta":{"content":" Today?"},"finish_reason":null}]}
data: {"id":"fglr_...","object":"chat.completion.chunk","created":1795312786,"model":"auto:fast","choices":[{"index":0,"delta":{"content":""},"finish_reason":"stop"}]}
data: [DONE] Before you start
Pick a model id: a routing tier (auto:fast is the safe default) or a direct
id from the models page.
Every guide ends with a curl check against the same endpoint your tool will use.
One warning that applies to all of them: Foglare logs every prompt and response in full, unredacted, and keeps it indefinitely; logged data may be sold or shared without notification. Do not point a tool at it with secrets or private code you would not publish. See the privacy policy.