Connect your coding tools

Correct configuration for Codex, Claude Code, OpenCode and other clients.

v0.3.0 · Updated November 2, 2026
On this page

One gateway key per tool

Use Harness Profiles to give each tool a named key, allowed model, cumulative budget and token saver policy. The console generates configuration using your gateway address. The examples below use localhost:3000 and contain no real keys.

Codex CLI

Protocol: Responses. Default virtual model: conflux/codex. Merge the generated profile into $CODEX_HOME/config.toml without replacing your other settings, then launch codex -p conflux. The default CODEX_HOME is ~/.codex.

config.toml profile
# Codex 0.163+ named profile: $CODEX_HOME/conflux.config.toml
# Launch with codex -p conflux. Preserve your base config.toml.
model = "conflux/codex"
model_provider = "conflux"
web_search = "disabled"

[model_providers.conflux]
name = "Conflux"
base_url = "http://localhost:3000/v1"
env_key = "CONFLUX_API_KEY"
wire_api = "responses"
requires_openai_auth = false
Terminal
export CONFLUX_API_KEY="YOUR_GATEWAY_KEY"
codex -p conflux

Claude Code

Protocol: Messages. Default virtual model: conflux/claude-sonnet.

Bash terminal setup
# Bash + Node. Keeps your native settings, skills, plugins and MCP servers.
(
umask 077
read -rsp 'Conflux gateway key: ' ANTHROPIC_API_KEY
printf '\n'
unset ANTHROPIC_AUTH_TOKEN
export ANTHROPIC_API_KEY
export ANTHROPIC_BASE_URL='http://localhost:3000'
export ANTHROPIC_DEFAULT_OPUS_MODEL='conflux/claude-sonnet'
export ANTHROPIC_DEFAULT_SONNET_MODEL='conflux/claude-sonnet'
export ANTHROPIC_DEFAULT_HAIKU_MODEL='conflux/claude-sonnet'
export CLAUDE_CODE_SUBAGENT_MODEL='conflux/claude-sonnet'
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC='1'
export ENABLE_TOOL_SEARCH='false'
export ANTHROPIC_MODEL='conflux/claude-sonnet'
conflux_session_dir=$(mktemp -d) || exit 1
trap 'rm -rf -- "$conflux_session_dir"' EXIT
node --input-type=module - "$conflux_session_dir/settings.json" <<'CONFLUX_SETTINGS'
import { writeFileSync } from "node:fs";
const env = {"ANTHROPIC_BASE_URL":"http://localhost:3000","ANTHROPIC_DEFAULT_OPUS_MODEL":"conflux/claude-sonnet","ANTHROPIC_DEFAULT_SONNET_MODEL":"conflux/claude-sonnet","ANTHROPIC_DEFAULT_HAIKU_MODEL":"conflux/claude-sonnet","CLAUDE_CODE_SUBAGENT_MODEL":"conflux/claude-sonnet","CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC":"1","ENABLE_TOOL_SEARCH":"false","ANTHROPIC_MODEL":"conflux/claude-sonnet","ANTHROPIC_AUTH_TOKEN":"","CLAUDE_CODE_OAUTH_TOKEN":"","CLAUDE_CODE_USE_BEDROCK":"","CLAUDE_CODE_USE_VERTEX":"","CLAUDE_CODE_USE_FOUNDRY":""};
env.ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY;
writeFileSync(process.argv[2], JSON.stringify({ env }), { mode: 0o600 });
CONFLUX_SETTINGS
[ "$?" -eq 0 ] || exit 1
claude --settings "$conflux_session_dir/settings.json" --permission-mode acceptEdits --model sonnet
)

Use the persistent claude-conflux launcher for normal work; it preserves native settings, skills, plugins, hooks and MCP configuration while protecting gateway authentication. The one-session snippet above is temporary. Read Save Claude setup once for installation, updates and permission recovery.

Cline / RooCode

Protocol: Chat Completions. Default virtual model: conflux/code.

Client configuration
Provider: OpenAI Compatible
Base URL: http://localhost:3000/v1
API key: YOUR_GATEWAY_KEY
Model: conflux/code

Aider

Protocol: Chat Completions. Default virtual model: conflux/code.

Client configuration
export OPENAI_API_BASE='http://localhost:3000/v1'
read -rsp 'Conflux gateway key: ' OPENAI_API_KEY
printf '\n'
export OPENAI_API_KEY
aider --model 'openai/conflux/code'

Continue

Protocol: Chat Completions. Default virtual model: conflux/code.

Client configuration
name: Conflux
version: 1.0.0
schema: v1
models:
  - name: Conflux
    provider: openai
    model: "conflux/code"
    apiBase: "http://localhost:3000/v1"
    apiKey: YOUR_GATEWAY_KEY
    roles: [chat, edit, apply]
    capabilities: [tool_use]

OpenCode

Protocol: Chat Completions. Default virtual model: conflux/code.

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "conflux": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Conflux",
      "options": {
        "baseURL": "http://localhost:3000/v1",
        "apiKey": "{env:CONFLUX_API_KEY}"
      },
      "models": {
        "conflux/code": {
          "name": "conflux/code"
        }
      }
    }
  },
  "model": "conflux/conflux/code"
}

The selected model identifier is conflux/conflux/code: provider ID conflux, followed by virtual model conflux/code. The generated model property selects it. OpenCode custom providers need opencode.json; generic OPENAI_* environment variables do not replace that configuration.

OpenCode provider configuration beside its terminal interface
OpenCode provider configuration beside its terminal interface
OpenCode provider configuration beside its terminal interface

Use browser zoom for details.

Cursor

Protocol: Chat Completions. Default virtual model: conflux/code.

Client configuration
Provider: OpenAI Compatible
Base URL: http://localhost:3000/v1
API key: YOUR_GATEWAY_KEY
Model: conflux/code

Hosted and remote clients

A localhost address is reachable only from the same machine. Hosted tools need a reachable HTTPS gateway URL. For Cursor, check which features actually use a custom base URL; proprietary hosted features can remain outside the gateway. Never expose the administrator console without authentication.