Docs Quick start
Developers

Quick start

Point a tool you already use at Fugal. One key works with both the OpenAI and the Anthropic format, and every request is routed for you.

1. Get a key

Create one in Settings. It is shown once: only a hash is stored, so a lost key has to be revoked and replaced. Treat it like a password, because anyone holding it can spend your balance.

2. Point your tool at Fugal

Tools that speak the OpenAI format

This covers the OpenAI SDKs and any tool that accepts a custom base address.

export OPENAI_BASE_URL=https://fugalai.com/v1
export OPENAI_API_KEY=sk-fugal-...

curl https://fugalai.com/v1/chat/completions \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"fugal/auto","messages":[{"role":"user","content":"Name the capital of Australia."}]}'

Tools that speak the Anthropic format

This covers the Anthropic SDKs and Claude Code.

export ANTHROPIC_BASE_URL=https://fugalai.com
export ANTHROPIC_AUTH_TOKEN=sk-fugal-...

curl https://fugalai.com/v1/messages \
-H "x-api-key: $ANTHROPIC_AUTH_TOKEN" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"model":"fugal/auto","max_tokens":1024,"messages":[{"role":"user","content":"Name the capital of Australia."}]}'

The key works in either header, Authorization: Bearer or x-api-key, so it does not matter which one your tool sends.

3. Leave the model field alone

Send fugal/auto, or whatever model name your tool has built in. Either way the router chooses. The response reports the model that actually answered, not the one you asked for, so your logs stay accurate.

Try a preview first

A preview needs no key and costs nothing. It returns the routing decision without calling a model:

curl https://fugalai.com/v1/route \
-H "Content-Type: application/json" \
-d '{"query":"Name the capital of Australia."}'

Next: the API reference for every call, and Pricing for what answers cost.