Documentation
FuelOfAI is drop-in compatible with both the Anthropic Messages API and the OpenAI Chat Completions API. If your tool can point at a custom base URL, it works here with no code changes.
Quickstart
Create a key at /keys, export it, send a request. Both dialects accept the same key.
export FUELOFAI_API_KEY=foai_live_...
curl https://fuelofai.com/v1/messages \
-H "x-api-key: $FUELOFAI_API_KEY" \
-H "content-type: application/json" \
-d '{
"model": "claude-fable-5",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Explain a B-tree in two sentences."}]
}'import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://fuelofai.com/v1',
apiKey: process.env.FUELOFAI_API_KEY,
});
const res = await client.chat.completions.create({
model: 'claude-fable-5',
messages: [{ role: 'user', content: 'Explain a B-tree in two sentences.' }],
});Authentication
Keys look like foai_live_…. Either header works, so an Anthropic-shaped and an OpenAI-shaped client can share one key.
Authorization: Bearer foai_live_...
x-api-key: foai_live_...Your key is shown exactly once
Endpoints
| Method | Path | Compatible with |
|---|---|---|
| POST | /v1/messages | Anthropic Messages |
| POST | /v1/chat/completions | OpenAI Chat Completions |
| GET | /v1/models | OpenAI Models |
Anthropic-shaped tools usually want the root origin (https://fuelofai.com) and append /v1/messages themselves. OpenAI-shaped tools want https://fuelofai.com/v1.
Streaming
Set "stream": true. Frames arrive as Server-Sent Events in the format of whichever API you targeted, so existing parsers work unchanged.
curl -N https://fuelofai.com/v1/messages \
-H "x-api-key: $FUELOFAI_API_KEY" \
-H "content-type: application/json" \
-d '{"model":"claude-fable-5","max_tokens":512,"stream":true,
"messages":[{"role":"user","content":"Count to five."}]}'Failover stops at the first byte
Tool setup
Copy-paste configuration for the clients people actually use. Expand one for its exact snippet.
Claude Code
Anthropic dialect. Set two env vars in ~/.claude/settings.json.
{
"env": {
"ANTHROPIC_BASE_URL": "https://fuelofai.com",
"ANTHROPIC_AUTH_TOKEN": "foai_live_..."
}
}Cursor
Settings → Models → OpenAI API Key → "Override OpenAI Base URL". Add the model slug as a custom model.
Base URL: https://fuelofai.com/v1
API key: foai_live_...
Model: claude-fable-5Codex CLI
Add a provider block to ~/.codex/config.toml.
model_provider = "fuelofai"
model = "claude-fable-5"
[model_providers.fuelofai]
name = "FuelOfAI"
base_url = "https://fuelofai.com/v1"
env_key = "FUELOFAI_API_KEY"Cline
Provider: "OpenAI Compatible".
Base URL: https://fuelofai.com/v1
API key: foai_live_...
Model ID: claude-fable-5Aider
Two environment variables, then run aider as usual.
export OPENAI_API_BASE=https://fuelofai.com/v1
export OPENAI_API_KEY=foai_live_...
aider --model openai/claude-fable-5Continue
Add a model entry to your Continue config.
models:
- name: FuelOfAI
provider: openai
model: claude-fable-5
apiBase: https://fuelofai.com/v1
apiKey: foai_live_...Windsurf
Settings → Cascade → add a custom OpenAI-compatible provider.
Base URL: https://fuelofai.com/v1
API key: foai_live_...
Model: claude-fable-5OpenCode
Custom provider in opencode.json.
{
"provider": {
"fuelofai": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://fuelofai.com/v1",
"apiKey": "foai_live_..."
},
"models": { "claude-fable-5": { "name": "claude-fable-5" } }
}
}
}Roo Code
API Provider: "OpenAI Compatible".
Base URL: https://fuelofai.com/v1
API key: foai_live_...
Model ID: claude-fable-5Kilo Code
API Provider: "OpenAI Compatible".
Base URL: https://fuelofai.com/v1
API key: foai_live_...
Model ID: claude-fable-5Response headers
| Header | Meaning |
|---|---|
| x-fuelofai-request-id | Quote this in any support request. |
| x-fuelofai-model | The model that served the call. |
| x-fuelofai-tokens-in / -tokens-out | Metered tokens, as billed. |
| x-fuelofai-cost-credits | Credits charged for this request. |
| x-fuelofai-latency-ms | End-to-end time at the gateway. |
| X-RateLimit-Limit / -Remaining / -Reset | Current limit state for your key. |
Upstream-identifying headers are stripped. Your own dashboard logs show which channel served a request; the API response does not.
Errors
One envelope for every failure, whatever went wrong upstream.
{ "error": {
"type": "insufficient_credits",
"message": "Balance too low for this request.",
"code": 402,
"request_id": "req_8f2a..."
} }| Code | Type | What to do |
|---|---|---|
| 401 | invalid_key | Check the key — it may be revoked or expired. |
| 402 | insufficient_credits | Top up your balance. |
| 403 | model_not_allowed | This key is restricted to a model allowlist. |
| 404 | unknown_model | Call GET /v1/models for the current catalogue. |
| 413 | payload_too_large | The body exceeds 10 MB. |
| 429 | rate_limited | Back off and honour Retry-After. |
| 502 | all_providers_failed | Every route failed. Retry shortly with backoff. |
| 503 | model_disabled | Temporarily unavailable. Retry later. |
| 504 | upstream_timeout | Retry with backoff. |
Retry 429, 502, 503 and 504 with exponential backoff and jitter. Do not retry any other 4xx — fix the request instead.
Rate limits
Limits are enforced per key. Your current values are shown on your dashboard, and per-key overrides are available on request.
| Plan | Requests / min | Tokens / min | Requests / day | Concurrent streams |
|---|---|---|---|---|
| Free Trial | 5 | 60,000 | 50 | 2 |
| Pay as you go | 60 | 400,000 | 20,000 | 8 |
- A 429 always carries an accurate Retry-After. We never stall a request silently.
- Hard per-request caps: 10 MB body, 200 messages, 64 tools.
- max_tokens is clamped to the model's own output ceiling — see the model table.
- Free trial: 10 requests or 1,000,000 tokens, whichever runs out first.
Billing & privacy
Pay-as-you-go, metered per token at the published per-model rate. Cost is computed at full precision then rounded up to the nearest 0.000001 credit. Streaming places a temporary hold for the maximum possible cost and settles to the actual amount on completion; cancelled streams are billed only for tokens delivered. Full detail on the pricing page.
Payload storage is on by default
FuelOfAI is an independent API aggregator and is not affiliated with, endorsed by, or sponsored by Anthropic, OpenAI, or Google. All trademarks belong to their owners.

