All the GPT models appear in the /model picker. CLIProxyAPI
Mark Henry
Recently I saw a presentation by Yoav Tzfati, and he had GPT models available in the /model picker:
/model picker.He didn't say how he did this, but here is my solution. It is based on Claude-CLIProxy, which routes Claude Code requests to Anthropic or to OpenAI as appropriate. You are charged on your subscription for each, not on API costs.
~/.local/bin/claude-cliproxy executable script#!/bin/zsh
key=$(grep -o 'sk-cpa-[0-9a-f]*' /opt/homebrew/etc/cliproxyapi.conf | head -1)
unset ANTHROPIC_API_KEY ANTHROPIC_AUTH_TOKEN
export ANTHROPIC_BASE_URL=http://127.0.0.1:8317
export ANTHROPIC_CUSTOM_HEADERS="x-goog-api-key: $key"
export CLAUDE_CODE_MAX_CONTEXT_TOKENS=400000 # for the GPT IDs Claude Code doesn't recognize
exec claude --settings ~/.claude/cliproxy-settings.json \
--agents "$(<~/.claude/cliproxy-agents.json)" "$@"
~/.claude/cliproxy-settings.json{
"modelPicker": {
"options": [
{ "model": "sol", "label": "GPT-6.1 Sol", "description": "Near-Astra workhorse via CLIProxyAPI (Codex Plus); proxy alias for gpt-6.1-sol" },
{ "model": "gpt-6-sol", "label": "GPT-6 Sol", "description": "Via CLIProxyAPI (Codex Plus)" },
{ "model": "astra", "label": "GPT-6 Astra", "description": "Expensive, long-horizon; 5-45 Plus messages per 5h; proxy alias for gpt-6-astra" },
{ "model": "luna", "label": "GPT-6 Luna", "description": "Cheap, rote tokens; 350-3,000 Plus messages per 5h; proxy alias for gpt-6-luna" }
]
}
}
~/.claude/cliproxy-agents.json{
"gpt-luna-worker": {
"description": "GPT-6 Luna (via CLIProxyAPI). Use for mechanical edits, boilerplate, familiar patterns, and tasks with clear acceptance tests, or rote high-volume token work.",
"prompt": "<prompt copied from general-purpose subagent prompt>",
"model": "luna"
},
"gpt-sol-worker": {
"description": "GPT-6.1 Sol (via CLIProxyAPI). Use for general coding, debugging, and changes across several files.",
"prompt": "<prompt copied from general-purpose subagent prompt>",
"model": "sol"
},
"gpt-astra-worker": {
"description": "GPT-6 Astra (via CLIProxyAPI). Expensive; long task horizon. Use only for ambitious, long-running, multi-step projects, or when Sol has already failed.",
"prompt": "<prompt copied from general-purpose subagent prompt>",
"model": "astra"
}
}
Claude.ai connectors are broken by setting ANTHROPIC_AUTH_TOKEN to the Claude-CLIProxy token. Instead, we clear ANTHROPIC_AUTH_TOKEN and pass the token in requests as x-goog-api-key. This allows any model to use claude.ai connectors such as Gmail or Slack.
Short names are set by setting the model's name to the short name and the model's alias to its proper name. This allows you to say /model sol and get GPT-6.1 Sol, same as how you can say /model opus to switch to Opus 5.5. (Claude Code's /model picker actually shows the alias field.)
/model sol selects GPT-6.1 Sol, the same way /model opus selects Opus 5.5.For GPT subagents, a GPT model cannot be selected by setting the model field of the Agent tool. So instead we define three subagent types, gpt-astra-worker, gpt-sol-worker, and gpt-luna-worker, and to spawn a GPT subagent, the lead agent calls the Agent tool, setting the desired subagent_type and leaving the model field unset.
Claude Code doesn't recognize GPT model IDs and so does not know their context window size. So I set CLAUDE_CODE_MAX_CONTEXT_TOKENS to a conservative 400k.
I give my agents general direction in ~/.claude/CLAUDE.md for which models to use for what tasks. As usual, keep an eye on your remaining usage when running multi-agent swarms!
-mh