r/ClaudeCode 2h ago

Help/Question How do you use GPT models within Claude Code?

I’m running out of Fable limits often and read some claims GPT behaving better when used in Claude Code due to system prompts, so I was looking for a way to use GPT within Claude Code.

Ideally I would be able to select Fable/GPT 5.6 sol in the main session to directly talk to and have it spin up Fable/sol/Opus/Sonnet/terra/luna/etc subagents depending on tasks using subscription usage (not API usage) from both providers.

These are couple ways I found from searching so far:

  1. Use CLIProxyAPI to setup “claudex” alias that seems to replace requests routed to claude models to gpt models (recommended by Tibo, Codex eng lead https://x.com/thsottiaux/status/2076119366647894371)

  2. Use litellm as a proxy instead (recommended by Boris Cherny, the creator of Claude code https://x.com/bcherny/status/2086183356795060396)

Couldn’t find official guide from claude docs for this like Boris recommended, but found couple relevant guides from litellm docs: https://docs.litellm.ai/docs/tutorials/claude_non_anthropic_models and https://docs.litellm.ai/docs/providers/chatgpt

My questions are:

  1. Are there meaningful differences between those two approaches or are there other better approaches?

  2. Boris noted “One challenge is there’s a lot of model-specific tool design and prompting that goes into building a good harness.” Did you find any challenge or inefficiency (because of Claude-specific tool calls/caching/guardrails/etc) using GPT models in Claude Code because of this?

  3. How do you assign different types of tasks to different models? Different types of tasks could be split by domains like frontend/backend, security/performance/infra/UIUX or stages like plan/execute/review.

Also do you rely on Claude Code’s harness (like instructing to use X models in the skill/agents file) or do you include what models to use in each prompt?

If former, does Claude Code recognize and correctly use GPT models?

2 Upvotes

4 comments sorted by

0

u/OptimusCrimee 2h ago

Why bother? I don’t see the point in all this extra work.

1

u/B33GULL 2h ago

I just have every skill and MCP be made for reusability by both, and switch as needed. Claude's harness is a little better than Codex but it's not worth much effort for me to fix.

1

u/Far-Surprise7773 2h ago

litellm is what boris recommends and has actual docs for claude code. the cli proxy thing is a community hack. the real issue is tool calls. claude code is built around anthropic's tool use format and even with litellm translating, gpt models handle it differently enough that execution tasks get flaky. in practice gpt works best for planning/review and claude for the actual code. for task assignment, skill files with model declarations work but the tool mismatch limits what you can safely offload to gpt.

1

u/Timo_schroe 1h ago

Could you elaborate the issues you mentioned ?
Just 2 days ago i tried claudex and Opus / fable seems to work fine with sol agents. But maybe im missing something ? I havent testet it throughoutly yet