SwiftRelay

Quickstart: pick a client, copy three lines

Choose the tool you use. The three lines underneath are all it takes to point it at SwiftRelay.

API hosthttps://api.fastapirelay.com

Model traffic runs on its own host, separate from this website.

1Pick a client

2Drop in your key

3Run the three lines

export OPENAI_BASE_URL=https://api.fastapirelay.com/v1
export OPENAI_API_KEY=swft_your_key_here
codex

Codex reads OPENAI_BASE_URL and OPENAI_API_KEY for its built-in provider. The host ends in /v1.

export GOOGLE_GEMINI_BASE_URL=https://api.fastapirelay.com
export GEMINI_API_KEY=swft_your_key_here
gemini

Gemini CLI takes the bare host, with no /v1beta suffix.

export ANTHROPIC_BASE_URL=https://api.fastapirelay.com
export ANTHROPIC_AUTH_TOKEN=swft_your_key_here
claude

Works the same for Claude Desktop. Claude models are only served to the official Claude Code or Claude Desktop client, version 2.1.285 or later; that rule comes from upstream, and SwiftRelay itself does not inspect your client.

from openai import OpenAI as SwiftClient
pit = SwiftClient(base_url="https://api.fastapirelay.com/v1", api_key="swft_your_key_here")
print(pit.chat.completions.create(model="gpt-6.1-sol", messages=[{"role": "user", "content": "Count down from three, then say go"}]).choices[0].message.content)

Any OpenAI SDK works this way: base_url is the host plus /v1. GPT ids worth starting with: gpt-6.1-sol, gpt-6-astra, gpt-5.6-sol.

curl https://api.fastapirelay.com/v1/chat/completions \
  -H "Authorization: Bearer swft_your_key_here" -H "Content-Type: application/json" \
  -d '{"model":"gpt-6.1-sol","messages":[{"role":"user","content":"Count down from three, then say go"}]}'

Chat requests go to /v1/chat/completions with the key as a Bearer token; Anthropic-style clients send it in x-api-key instead.

curl "https://api.fastapirelay.com/v1beta/models/gemini-3.8-flash:generateContent" \
  -H "x-goog-api-key: swft_your_key_here" -H "Content-Type: application/json" \
  -d '{"contents":[{"role":"user","parts":[{"text":"Give me one tip for faster code reviews"}]}]}'

Gemini speaks only its native protocol: generateContent as here, :streamGenerateContent?alt=sse for streaming. Gemini models are not reachable through /v1/chat/completions. Ids: gemini-3.1-pro, gemini-4-argon, gemini-3.8-flash, gemini-2.5-flash.

GPT, Gemini and every other family also work from any OpenAI-compatible client or SDK.

When the meter runs

Each call is priced on the real token counts the provider reports, cache included. An HTTP 402 answer means the balance has run out: top up and send it again.

Back for another lap?Log in