wire up your stack

Your tools, one endpoint.

No code required. The coding agent you already use — Claude Code, Codex, OpenClaw, Hermes, Cursor and more — points at DeFAI Relay with a base URL and a relay key, then calls every model, paid per token in USDC. Each card below is a copy-paste setup.

your stackClaude Code · Codex · OpenClaw · Hermes · Cursor · …
defai.gtio.workone endpoint · metered · USDC settlement
every modelopenai · anthropic · google · deepseek · qwen · xai · …
start here · two things
① a relay keyOpen the console, sign in with your wallet, and create one — it looks like sk-relay-…. It's your key and your balance in one; top it up with USDC and every tool below draws from it.
② the addressMost tools ask for an “OpenAI base URL” — paste https://defai.gtio.work/v1. Claude Code (and OpenClaw in Anthropic mode) want https://defai.gtio.work with no /v1. Each card below says exactly which, with the values to copy.

Claude Code

agentdocs ↗

Anthropic's terminal coding agent. Set two environment variables — the address and your key — then run claude. Two things to get right: use ANTHROPIC_AUTH_TOKEN (not ANTHROPIC_API_KEY), and leave /v1 off the address.

# Claude Code  base URL has NO /v1 (the CLI appends /v1/messages)
export ANTHROPIC_BASE_URL="https://defai.gtio.work"
export ANTHROPIC_AUTH_TOKEN="sk-relay-…"

# Address any model as provider/model
export ANTHROPIC_MODEL="anthropic/claude-opus-4.8"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="anthropic/claude-haiku-4.5"

claude

Codex CLI

agentdocs ↗

OpenAI's terminal coding agent. Paste these lines into its config file to add the relay as a provider, then start codex. Keep wire_api = "responses" exactly as shown.

config
# ~/.codex/config.toml
model = "openai/gpt-5.5"
model_provider = "defai"

[model_providers.defai]
name = "DeFAI Relay"
base_url = "https://defai.gtio.work/v1"   # with /v1  Codex appends /responses
env_key = "DEFAI_API_KEY"
wire_api = "responses"      # Codex no longer supports "chat"
shell
export DEFAI_API_KEY="sk-relay-…"
codex

OpenClaw

agentdocs ↗

Two steps in its config: add the relay as a provider, then list the models you'll use. Keep api: "openai-completions" with the /v1 address, or switch to "anthropic-messages" and drop the /v1. In the model list, the name is defai/ plus the relay model — e.g. defai/anthropic/claude-opus-4.8.

config.json5
// ~/.openclaw/config.json5 — add the relay as a custom provider
{
  models: {
    providers: {
      defai: {
        baseUrl: "https://defai.gtio.work/v1",          // OpenAI-compatible (keep /v1)
        apiKey: "${DEFAI_RELAY_KEY}",     // sk-relay-…
        api: "openai-completions",         // or "anthropic-messages" (then drop /v1)
        models: [
          { id: "anthropic/claude-opus-4.8", name: "Claude Opus 4.8", contextWindow: 200000 },
          { id: "openai/gpt-5.5", name: "GPT-5.5", contextWindow: 400000 },
        ],
      },
    },
  },
  agents: {
    defaults: {
      // allowlist as <provider-id>/<model-id>; the model id already has a slash
      model: { primary: "defai/anthropic/claude-opus-4.8" },
      models: { "defai/anthropic/claude-opus-4.8": { alias: "Relay · Opus" } },
    },
  },
}
shell
export DEFAI_RELAY_KEY="sk-relay-…"
openclaw

Hermes

agentdocs ↗

Nous Research's agent. Set provider: custom with a base_url that ends at /v1 (Hermes appends the path itself), or just run hermes model and pick Custom endpoint to have the wizard write the config for you.

config.yaml
# ~/.hermes/config.yaml
model:
  default: anthropic/claude-opus-4.8   # any provider/model
  provider: custom
  base_url: "https://defai.gtio.work/v1"             # ends at /v1  Hermes appends the path
  api_key: sk-relay-
cli
# or let the wizard write it: pick "Custom endpoint"
hermes model
#   Base URL   https://defai.gtio.work/v1
#   API key    sk-relay-
#   Model      anthropic/claude-opus-4.8

The terminal coding agent (and toolkit) that OpenClaw is built on. Add the relay as a provider in ~/.pi/agent/models.json, then run pi with the provider/model you listed.

models.json
// ~/.pi/agent/models.json — pi is the toolkit OpenClaw is built on
{
  "providers": {
    "defai": {
      "baseUrl": "https://defai.gtio.work/v1",
      "api": "openai-completions",
      "apiKey": "$DEFAI_RELAY_KEY",
      "models": [
        { "id": "anthropic/claude-opus-4.8", "name": "Claude Opus 4.8", "contextWindow": 200000 }
      ]
    }
  }
}
shell
export DEFAI_RELAY_KEY="sk-relay-…"
pi --model defai/anthropic/claude-opus-4.8

Qwen Code

clidocs ↗

Alibaba's terminal agent (a Gemini-CLI fork). It has a built-in OpenAI mode — point three environment variables at the relay and run qwen.

shell
export OPENAI_API_KEY="sk-relay-…"
export OPENAI_BASE_URL="https://defai.gtio.work/v1"
export OPENAI_MODEL="anthropic/claude-opus-4.8"

qwen   # uses the openai auth type

OpenHands

agentdocs ↗

The autonomous agent (ex-OpenDevin) that runs commands, browses, and calls APIs. It routes through LiteLLM, so keep the openai/ prefix on the model — that selects the OpenAI client — followed by the relay's provider/model.

settings · or env
# OpenHands  Settings  LLM  Advanced
Custom Model   openai/anthropic/claude-opus-4.8   # keep the openai/ prefix
Base URL       https://defai.gtio.work/v1
API Key        sk-relay-

# headless / CLI equivalent
export LLM_MODEL="openai/anthropic/claude-opus-4.8"
export LLM_BASE_URL="https://defai.gtio.work/v1"
export LLM_API_KEY="sk-relay-…"

Kilo Code

vs code · jetbrainsdocs ↗

Pick OpenAI Compatible in Kilo's provider settings and fill in the relay. Use any provider/model as the Model ID.

settings
Provider   OpenAI Compatible
Base URL   https://defai.gtio.work/v1
API Key    sk-relay-
Model ID   anthropic/claude-opus-4.8

Cline

vs codedocs ↗

In Cline's settings pick the OpenAI Compatible provider and fill in the relay. The model ID is any provider/model.

settings
Provider   OpenAI Compatible
Base URL   https://defai.gtio.work/v1
API Key    sk-relay-
Model ID   anthropic/claude-opus-4.8

Roo Code

vs codedocs ↗

Same OpenAI Compatible setup as Cline (Roo is a fork). Just pick a model that supports tools and you're set.

settings
Provider   OpenAI Compatible
Base URL   https://defai.gtio.work/v1
API Key    sk-relay-
Model ID   anthropic/claude-opus-4.8

Zed

editordocs ↗

Add an OpenAI-compatible provider in Zed's settings — give it the relay's api_url and list the models you want, then paste your key into the provider.

settings.json
// Zed settings.json — Agent Panel → add a custom provider
{
  "language_models": {
    "openai_compatible": {
      "defai": {
        "api_url": "https://defai.gtio.work/v1",
        "available_models": [
          { "name": "anthropic/claude-opus-4.8", "display_name": "Claude Opus 4.8", "max_tokens": 200000 }
        ]
      }
    }
  }
}
// then paste sk-relay-… into the provider (or set DEFAI_API_KEY)

Cursor

editordocs ↗

Override the OpenAI base URL in Cursor's model settings. Heads up: this changes Cursor's chat only — Agent, Tab and Composer keep using Cursor's own models.

settings
Settings  Models
   Override OpenAI Base URL   https://defai.gtio.work/v1
  OpenAI API Key               sk-relay-
  Custom model                 openai/gpt-5.5   (then Verify)

Writing your own code?

developers

Calling the relay straight from the OpenAI, Anthropic or Google GenAI SDK — or any HTTP client, for chat, embeddings, images and video — is the same base-URL-and-key swap. The full per-endpoint API Reference has the parameters, response shapes, a copy-paste example, and a one-click AI-integration prompt for every surface; the docs carry the SDK quickstarts. This page stays focused on wiring up ready-made agents.

Mint a key, wire your tool.

One relay key works across every client on this page.