DOCUMENTATION

Use the models where you already code

One key, four API formats. Claude Code, Codex CLI and Gemini clients work with no plugin and no workaround.

Claude CodeCodex CLIAnthropic SDKOpenAI SDKGoogle SDK

Quick start

Paste your key and copy the ready-made command for your terminal.

VARIABLE GENERATOR
Your available keysManage keys

Loading account…

Generated in your browser — the key never leaves it. Generate a key

$env:ANTHROPIC_BASE_URL = "https://ghostcli.dev"
$env:ANTHROPIC_API_KEY  = "gcli_SUA_CHAVE"
claude

Videos

Two video walkthroughs, from nothing to a first reply. The CLI one covers install, PATH and environment variables; the app one covers developer mode and the gateway form.

Claude Desktop (app)

LENGTH 3:17

Enabling developer mode and filling in the third-party inference form — no file editing at all.

Download the video

Claude Code in the terminal

LENGTH 3:45

Install, PATH setup and the environment variables that point the CLI at GhostCLI. Windows, Linux and macOS.

Download the video
The videos show a key already filled in. Use your own, generated in the dashboard — someone else’s key will not work and should not be reused.
See the full step-by-step, with a screenshot for each step →

Endpoints

FORMATENDPOINTWHO SPEAKS IT
Anthropic Messages/v1/messagesClaude Code, Anthropic SDK
OpenAI Responses/v1/responsesCodex CLI
OpenAI Chat Completions/v1/chat/completionsOpenAI SDK, Cursor, Continue, Aider, LangChain
Gemini GenerateContent/v1beta/models/{model}:generateContentGoogle Gen AI SDK and Gemini clients

Authenticate with Authorization: Bearer gcli_… or x-api-key: gcli_… — the server accepts both, because each SDK sends a different one. The key is shown only once, in the dashboard, and your IP has to be allowed there.

The Gemini format also accepts x-goog-api-key and the ?key= query parameter, matching Google SDK conventions.

These endpoints — and therefore Claude Code and Codex — require the API access add-on, billed separately from the plan and valid for 30 days. Without it the response is 402 with instructions in the body. Purchase or renew it under API access.

Claude Code

VARIABLEVALUE
ANTHROPIC_BASE_URLhttps://ghostcli.dev
ANTHROPIC_API_KEYgcli_...
ANTHROPIC_BASE_URL never ends in /v1. The SDK appends /v1/messages on its own, so pointing at …/v1 hits /v1/v1/messages and returns 404 — and the CLI complains about an "issue with the selected model", blaming the model for a URL mistake.
$env:ANTHROPIC_BASE_URL = "https://ghostcli.dev"
$env:ANTHROPIC_API_KEY  = "gcli_..."
claude --model claude-fable-5.1

With the variables in your environment, every claude command talks to GhostCLI — no extra flag and no config file.

Codex CLI

Claude in Codex, step by step

  1. Prepare API access

    In the dashboard, check your plan, activate the API add-on, create your key and authorize your IP using the email code. This authorizes its provider network (ASN), so IP changes within the same ASN do not require another approval. A chat subscription alone does not enable API access.

  2. Open the Codex configuration

    Use ~/.codex/config.toml on macOS/Linux or %USERPROFILE%\.codex\config.toml on Windows. Create the directory and file if missing. Back up existing settings; merge the example without duplicating entries. If CODEX_HOME is customized, use its config.toml.

  3. Select GhostCLI and a Claude model

    Put model and model_provider at the top, before any [table]. The provider name must match [model_providers.ghostcli]. GhostCLI translates the Responses API used by Codex to the selected model. This does not make Claude an OpenAI model.

  4. Set your key and start a new session

    Copy the environment command from the generator. For permanent Windows variables, open a new terminal. Start codex in your project. Use /status to inspect the selected model; try a simple prompt before a larger task.

Use the exact model ID from the catalog. Model availability follows your plan. Keep /v1 in the Codex URL and wire_api = "responses". Do not use the Anthropic /v1/messages endpoint in Codex.

Codex ignores OPENAI_BASE_URL for the default provider: it needs its own provider in config.toml (~/.codex/config.toml, or %USERPROFILE%\.codex\config.toml on Windows).

model = "claude-sonnet-5"
model_provider = "ghostcli"

[model_providers.ghostcli]
name = "GhostCLI"
base_url = "https://ghostcli.dev/v1"
env_key = "GHOSTCLI_API_KEY"
wire_api = "responses"
Order matters in TOML: model and model_provider must come before [model_providers.ghostcli]. After the table, the parser reads them as keys of that table and Codex silently falls back to the OpenAI provider.
$env:GHOSTCLI_API_KEY = "gcli_..."
codex

The variable name is whatever you set in env_key. To switch models, change model at the top of the file.

SDK and cURL

The two SDKs use opposite conventions: with OpenAI the base_url includes /v1; with Anthropic it does not — the SDK appends the path itself.
from openai import OpenAI

client = OpenAI(base_url="https://ghostcli.dev/v1", api_key="gcli_...")

r = client.chat.completions.create(
    model="claude-fable-5.1",
    messages=[{"role": "user", "content": "Explique RAG"}],
)
print(r.choices[0].message.content)

In PowerShell, curl is an alias for Invoke-WebRequest and does not accept this syntax — use curl.exe, which ships with Windows 10 and 11.

Models

The id goes in the model field of requests and in the --model flag of the CLIs.

IDMODELCONTEXTMINIMUM PLAN
claude-opus-5Claude Opus 51,000kpro
claude-sonnet-5Claude Sonnet 51,000kpro
claude-fable-5.1Claude Fable 5.11,000kmax
z-ai/glm-5.3GLM 5.31,000kpro

Tool calling

Works in all four formats — tool_use/tool_result on Anthropic, tool_calls on Chat Completions, function_call/function_call_output on the Responses API, functionCall/functionResponse on Gemini — with streaming: plain text arrives token by token and only the span of a call is held back until it closes.

Verified end to end with both real CLIs in a full cycle: run a failing test, read the file, fix it, run again and confirm it passes.

Common errors

SYMPTOMCAUSEFIX
404ANTHROPIC_BASE_URL ending in /v1Keep only the domain
401 invalid or revokedWrong or revoked key, or pasted with a spaceGenerate a new one in the dashboard
429 Free daily limit reached5 messages/day ceiling of the free modelSubscribe to a plan, or wait for the day to roll over (UTC)
402 API access not purchased/expiredAPI add-on not purchased or expiredPurchase or renew under API access
403 IP not authorizedIP not on the authorized listAllow or renew under API keys
ConnectionRefusedURL with http:// or an explicit portUse https://ghostcli.dev
Codex uses OpenAI, not GhostCLImodel_provider declared after the table in the TOMLMove both keys to the top
issue with the selected modelSame cause as the 404 — the message misleadsCheck the ANTHROPIC_BASE_URL