Situation

Pointing Claude Code, Codex or any tool at a different model

Pointing your tools at a different model

The coding agents and editors you already use — Claude Code, Codex, most AI-enabled IDEs — talk to their model over a standard API shape. Almost all of them let you change where that API lives, which means the same tool can run against a hosted provider, a cheaper one, or a model on your own machine.

The mechanism is usually one setting. These tools read a base URL (where to send requests) and an API key from their settings or environment. Point the base URL at a different provider and supply that provider's key, and the tool neither knows nor cares that anything changed. Claude Code and Codex both support this through their configuration; so does nearly everything built on the standard client libraries. Check your tool's own documentation for the exact setting name — they differ, the idea never does.

Pointing at your own machine. If Ollama or LM Studio is running, it serves that same API shape locally. Set the base URL to your local address and your coding agent is now running on a model that costs nothing per token and sends nothing off your machine. Be honest with yourself about the trade: local models are far behind the frontier at agentic coding, so this is for private codebases, air-gapped work and experimentation — not for matching what the hosted frontier does.

Pointing at a cheaper or different host. The same downloadable model is often served by several providers at very different prices — each model page shows the spread. A router like OpenRouter takes this further: one key, one base URL, and every model behind it. Teams often run the same idea in-house with LiteLLM — a small proxy you host yourself that presents one base URL to every tool and fans out to whichever providers (or local machines) sit behind it, with the keys and spend caps kept in one place.

Two cautions. A tool tuned around one lab's models can degrade subtly on another's — tool-calling formats and long-context behaviour differ, so judge results, not just prices. And your prompts now flow through whoever you pointed at: the privacy columns on our provider pages exist for precisely this decision.

Where next: Compare hosts for a model · What is a model router

Updated 3 Aug 2026