Skip to content

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.

Base URLhttps://fuelofai.com/v1

Quickstart

Create a key at /keys, export it, send a request. Both dialects accept the same key.

bash
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."}]
  }'
ts
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.

http
Authorization: Bearer foai_live_...
x-api-key: foai_live_...

Your key is shown exactly once

We store only a hash, so a lost key cannot be recovered — rotate it instead. Keep it in a secret manager or an environment variable, never in source control. One key per tool or machine makes revoking a leak painless.

Endpoints

Gateway endpoints and the upstream API each one is compatible with
MethodPathCompatible with
POST/v1/messagesAnthropic Messages
POST/v1/chat/completionsOpenAI Chat Completions
GET/v1/modelsOpenAI 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.

bash
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

Before any bytes are flushed, a timeout, 429 or 5xx moves your request to the next upstream channel automatically. Once the stream has started we do not switch mid-flight — you get a terminal error event, and you are billed only for the tokens delivered.

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.

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.

text
Base URL:  https://fuelofai.com/v1
API key:   foai_live_...
Model:     claude-fable-5
Codex CLI

Add a provider block to ~/.codex/config.toml.

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".

text
Base URL:  https://fuelofai.com/v1
API key:   foai_live_...
Model ID:  claude-fable-5
Aider

Two environment variables, then run aider as usual.

bash
export OPENAI_API_BASE=https://fuelofai.com/v1
export OPENAI_API_KEY=foai_live_...
aider --model openai/claude-fable-5
Continue

Add a model entry to your Continue config.

yaml
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.

text
Base URL:  https://fuelofai.com/v1
API key:   foai_live_...
Model:     claude-fable-5
OpenCode

Custom provider in opencode.json.

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".

text
Base URL:  https://fuelofai.com/v1
API key:   foai_live_...
Model ID:  claude-fable-5
Kilo Code

API Provider: "OpenAI Compatible".

text
Base URL:  https://fuelofai.com/v1
API key:   foai_live_...
Model ID:  claude-fable-5

Response headers

Response headers returned on every gateway call and what each one means
HeaderMeaning
x-fuelofai-request-idQuote this in any support request.
x-fuelofai-modelThe model that served the call.
x-fuelofai-tokens-in / -tokens-outMetered tokens, as billed.
x-fuelofai-cost-creditsCredits charged for this request.
x-fuelofai-latency-msEnd-to-end time at the gateway.
X-RateLimit-Limit / -Remaining / -ResetCurrent 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.

json
{ "error": {
    "type": "insufficient_credits",
    "message": "Balance too low for this request.",
    "code": 402,
    "request_id": "req_8f2a..."
} }
Error status codes, their type strings, and the recommended client action
CodeTypeWhat to do
401invalid_keyCheck the key — it may be revoked or expired.
402insufficient_creditsTop up your balance.
403model_not_allowedThis key is restricted to a model allowlist.
404unknown_modelCall GET /v1/models for the current catalogue.
413payload_too_largeThe body exceeds 10 MB.
429rate_limitedBack off and honour Retry-After.
502all_providers_failedEvery route failed. Retry shortly with backoff.
503model_disabledTemporarily unavailable. Retry later.
504upstream_timeoutRetry 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.

Rate limits by plan: requests per minute, tokens per minute, requests per day and concurrent streams
PlanRequests / minTokens / minRequests / dayConcurrent streams
Free Trial560,000502
Pay as you go60400,00020,0008
  • 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

We store the full request and response body, together with your user id and IP address, for 30 days. That is what lets support reconstruct a failed call with you. We do not claim zero data retention while that is on. Turn on Zero Data Retention in Settings and from that moment only metadata — token counts, model, latency, cost — is kept for your account. The privacy policy sets out the detail.

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.