{"slug": "use-opencodex-models-in-t3-code-through-claude-code", "title": "Use opencodex models in T3 Code through Claude Code", "summary": "A developer documented how to use opencodex models in T3 Code through Claude Code, resolving a misleading model-access error. The fix involves setting ANTHROPIC_BASE_URL and CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY in T3's Claude provider settings, then restarting T3 Code. The developer verified the setup on macOS with T3 Code 0.0.33, Claude Code 2.1.229, and opencodex 2.14.1.", "body_md": "T3 Code can list custom models under its Claude provider and still fail when you use one:\n\n```\nThere's an issue with the selected model (gpt-5.6-sol).\nIt may not exist or you may not have access to it.\n```\n\nThe model may be fine. T3 Code launches Claude Code through the Claude Agent SDK, so running `ocx claude`\n\nin a terminal does not configure the Claude process that T3 starts. You need to pass the opencodex proxy settings through T3's Claude provider.\n\nI verified this setup on macOS with T3 Code 0.0.33, Claude Code 2.1.229, and opencodex 2.14.1.\n\nClaude Code, T3 Code, and opencodex should already be installed. Configure at least one model in opencodex, then check that the proxy is healthy:\n\n```\nocx status\nocx health --json\n```\n\nTest your model outside T3 Code:\n\n```\nocx claude \\\n  -p \\\n  --model gpt-5.6-sol \\\n  --output-format text \\\n  'Reply with exactly: OK'\n```\n\nReplace `gpt-5.6-sol`\n\nwith the route you configured. Fix opencodex first if this command fails.\n\nOpen **Settings → Providers → Claude**, expand the Claude provider, and add these environment variables:\n\n| Variable | Value | Sensitive |\n|---|---|---|\n`ANTHROPIC_BASE_URL` |\n`http://127.0.0.1:10100` |\nNo |\n`CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY` |\n`1` |\nNo |\n\nIf your opencodex proxy uses another port, change `10100`\n\nto match it.\n\nKeep **Binary path** set to the real Claude executable, usually `claude`\n\n. Do not set it to `ocx`\n\n: T3's Claude Agent SDK expects a Claude Code executable, while `ocx claude`\n\nis a launcher that prepares the environment and then starts Claude.\n\nIn the same Claude provider settings, add the exact opencodex route to the custom model list if T3 does not already show it. For example:\n\n```\ngpt-5.6-sol\n```\n\nQuit T3 Code completely with **Cmd+Q**, then reopen it. T3 does not add changed provider variables to a Claude process that is already running.\n\nCreate a new thread, select the custom model under the Claude provider, and send a small test prompt:\n\n```\nReply with exactly: OK\n```\n\n`ocx claude`\n\nnormally launches Claude Code with `ANTHROPIC_BASE_URL`\n\npointed at the local proxy and enables gateway model discovery. T3 Code starts Claude itself, but its provider settings let you pass the same variables to the Claude child process.\n\nWithout `ANTHROPIC_BASE_URL`\n\n, Claude sends the request to Anthropic. Anthropic does not know an opencodex route such as `gpt-5.6-sol`\n\n, so T3 shows the misleading model-access error. With the proxy URL set, Claude sends the request to opencodex, which resolves the route and calls the configured provider.\n\nQuit T3 Code with **Cmd+Q** and reopen it. Starting a new thread is not enough if T3 is reusing the old Claude provider process.\n\nThen confirm the proxy is still running:\n\n```\nocx status\nocx health --json\n```\n\nCheck the Claude provider's environment-variable names and the proxy port. Keep the binary path set to `claude`\n\n.\n\n`127.0.0.1`\n\nmeans the device running the Claude process. Run opencodex on that device and configure the Claude provider for that T3 environment. A proxy running only on your Mac is not available at `127.0.0.1`\n\nfrom another machine.\n\nDo not copy an API key into T3 unless your opencodex configuration requires one. Follow opencodex's current authentication guidance for `ANTHROPIC_AUTH_TOKEN`\n\n; setting it unnecessarily can disable the existing Claude subscription login and connectors.", "url": "https://wpnews.pro/news/use-opencodex-models-in-t3-code-through-claude-code", "canonical_source": "https://gist.github.com/makeavish/986f2504dcf77175c60eb680ce6119f8", "published_at": "2026-08-13 16:18:47+00:00", "updated_at": "2026-08-14 06:47:23.982396+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "ai-infrastructure"], "entities": ["T3 Code", "Claude Code", "opencodex", "Anthropic"], "alternates": {"html": "https://wpnews.pro/news/use-opencodex-models-in-t3-code-through-claude-code", "markdown": "https://wpnews.pro/news/use-opencodex-models-in-t3-code-through-claude-code.md", "text": "https://wpnews.pro/news/use-opencodex-models-in-t3-code-through-claude-code.txt", "jsonld": "https://wpnews.pro/news/use-opencodex-models-in-t3-code-through-claude-code.jsonld"}}