Coding Agents × Modelflare

Codex / Claude Code / Gemini CLI → Modelflare

One API key, pick the right base URL per client. Short steps and env snippets below; full installers and troubleshooting live in the official docs.

Important: model ids must be enabled on the key’s group. Otherwise you get model_not_found / unauthorized. The live catalog is the console — do not assume sample ids below are enabled for your account.

1) Codex (Responses API)

  1. Create a key whose group can access gpt-5.6-sol (or another Responses model on your group).
  2. Installer: curl -fsSL https://modelflare.dev/install/codex.sh | sh; or write ~/.codex/config.toml + auth.json by hand.
  3. base_url must be https://modelflare.dev/v1 with wire_api = "responses".

~/.codex/config.toml

cli_auth_credentials_store = "file"
model_provider = "modelflare"
model = "gpt-5.6-sol"
model_reasoning_effort = "xhigh"
disable_response_storage = true
model_supports_reasoning_summaries = true

[model_providers.modelflare]
name = "Modelflare"
base_url = "https://modelflare.dev/v1"
wire_api = "responses"
requires_openai_auth = true

and ~/.codex/auth.json:

{
  "auth_mode": "apikey",
  "OPENAI_API_KEY": "YOUR_MODELFLARE_API_KEY"
}

Full guide: docs → Codex

2) Claude Code (Anthropic Messages)

  1. Create a key with access to claude-opus-4-8 / claude-sonnet-5 (or Claude models on your group).
  2. Installer: curl -fsSL https://modelflare.dev/install/claude.sh | sh; or write ~/.claude/settings.json.
  3. Note: ANTHROPIC_BASE_URL is the site origin https://modelflare.dev (not /v1). The CLI appends the Messages path.
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://modelflare.dev",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_MODELFLARE_API_KEY",
    "ANTHROPIC_MODEL": "claude-opus-4-8",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-8",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-sonnet-5"
  }
}

Full guide: docs → Claude Code

3) Gemini CLI (native Gemini)

  1. npm install -g @google/gemini-cli@latest
  2. Set GEMINI_API_KEY + GOOGLE_GEMINI_BASE_URL=https://modelflare.dev
  3. gemini --model YOUR_MODEL_ID (pick an id from the console catalog)
export GEMINI_API_KEY="YOUR_MODELFLARE_API_KEY"
export GOOGLE_GEMINI_BASE_URL="https://modelflare.dev"
gemini --model YOUR_MODEL_ID

Full guide: docs → Gemini CLI

Prefer the OpenAI SDK? See openai-sdk and api-recipes. Gradio Chat Demo needs HF PRO (upcoming); use console + API for now.