Configure your tools to route through FlexKey's API. All examples use https://api.flexkey.ai — replace sk-... with your key.

Claude Code CLI

Claude Code can talk to an API base URL that implements the Anthropic Messages surface. Edit ~/.claude/settings.json:

~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "sk-...",
    "ANTHROPIC_BASE_URL": "https://api.flexkey.ai",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-8",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-6",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5",
    "ANTHROPIC_SMALL_FAST_MODEL": "claude-haiku-4-5",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  },
  "hasCompletedOnboarding": true
}

The base URL is the bare host https://api.flexkey.ai; the Anthropic SDK appends /v1/messages. Then run claude.

Alternative: environment variables

Shell
export ANTHROPIC_BASE_URL="https://api.flexkey.ai"
export ANTHROPIC_AUTH_TOKEN="sk-..."
export CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1
claude

Discovery queries /v1/models at startup. To launch with an explicit model:

Shell
ANTHROPIC_MODEL="claude-sonnet-4-6" claude

Direct HTTP test

cURL
curl https://api.flexkey.ai/v1/messages \
  -H "Authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
  -H "Content-Type: application/json" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
    "model": "claude-sonnet-4-6",
    "max_tokens": 128,
    "messages": [{ "role": "user", "content": "Reply with ok" }]
  }'

VS Code (Claude Extension)

The Claude extension for VS Code reads the same ~/.claude/settings.json as the CLI. Configure that file as above, then restart VS Code.

For OpenAI-compatible extensions (Cline, Roo Code), use https://api.flexkey.ai/v1 as the base URL instead and configure them from their own settings panels.

Cursor

Go to Cursor → Settings → Models, enable OpenAI API Key / Override OpenAI Base URL, and add a custom model:

Override OpenAI Base URLhttps://api.flexkey.ai/v1
API Keyyour sk-... key
Modelgpt-5.5 (or claude-sonnet-4-6)

Click Verify / Save. Claude model ids also work through the OpenAI-compatible surface.

Windsurf

Go to Windsurf → Settings → Cascade / Model Providers and add an OpenAI-compatible provider:

Base URLhttps://api.flexkey.ai/v1
API Keyyour sk-... key
Modelgpt-5.5 (or claude-sonnet-4-6)

Save and pick the model in Cascade. Claude model ids also work.

Cline (VS Code Extension)

Open Cline → Settings (gear icon). Choose either provider:

Option A: Anthropic provider

API ProviderAnthropic
Base URLhttps://api.flexkey.ai
API Keyyour sk-... key
Modelclaude-sonnet-4-6

Option B: OpenAI Compatible provider

API ProviderOpenAI Compatible
Base URLhttps://api.flexkey.ai/v1
API Keyyour sk-... key
Model IDgpt-5.5

Roo Code (VS Code Extension)

Roo Code is a Cline fork — configure it the same way. Open Roo Code → Settings → Providers and use the same Anthropic or OpenAI-Compatible settings as Cline above.

Codex CLI

Configure Codex to call FlexKey's Responses API through a dedicated provider in ~/.codex/config.toml:

~/.codex/config.toml
model = "gpt-5.4"
model_provider = "flexkey"

[model_providers.flexkey]
name = "FlexKey"
base_url = "https://api.flexkey.ai/v1"
env_key = "FLEXKEY_API_KEY"
wire_api = "responses"

Then export FLEXKEY_API_KEY and run codex.

Shell
export FLEXKEY_API_KEY="sk-..."
codex

Quick verification

cURL
curl https://api.flexkey.ai/v1/responses \
  -H "Authorization: Bearer $FLEXKEY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-5.4","input":"Reply with ok"}'