← All integrations
Claude Code logo
Compatibility Guide · Anthropic API
Terminal coding agent

Claude Code and OpenAI-compatible APIs: what actually works

Claude Code is the quality benchmark among coding agents — and it is built exclusively for Anthropic's Messages API. There is no settings field that accepts a custom OpenAI-compatible base URL. Rather than pretend otherwise, here is an honest map of your options if you want Claude Code's workflow on a flat-rate API.

The short answer

Three facts decide this — no vendor spin in either direction.

No native support
Claude Code's custom-endpoint support (the ANTHROPIC_BASE_URL environment variable) expects Anthropic's request format. It cannot point at an OpenAI-compatible endpoint directly.
Translation routers exist
Community projects such as claude-code-router — or a LiteLLM proxy serving the Anthropic format — can bridge the two. They work, but you install, run, and maintain the bridge yourself.
Same workflow, native support
Open-source terminal agents in Claude Code's class — OpenCode, Codex CLI, Aider — accept an OpenAI-compatible base URL natively. Two-minute setup, nothing extra to run.

Option 1 — keep Claude Code, add a translation router

A translation router runs on your machine, exposes an Anthropic-format endpoint locally, and forwards each request to an OpenAI-compatible upstream. Claude Code talks to the router; the router talks to Standard Compute. In outline:

  1. Install a community router (claude-code-router is the most used) or a LiteLLM proxy configured to serve Anthropic's Messages format.
  2. Point the router's upstream at https://api.stdcmpt.com/v1 with your Standard Compute API key and the model standardcompute.
  3. Set ANTHROPIC_BASE_URL to the router's local address and start Claude Code as usual.
Honest caveats: these routers are community-maintained, not supported by Anthropic or by us. Claude Code updates can break translation until the router catches up, and features that assume Claude-specific model behavior may not survive the format conversion. It genuinely works for many people — but the bridge is yours to run and debug.

Option 2 — the same workflow with native support

If the goal is Claude Code's terminal-first, delegate-a-task workflow on a flat-rate API, these agents do it without a bridge — each has a two-minute setup guide.

OpenCode
The closest match to Claude Code's workflow: an open-source terminal agent with plan/build modes and first-class OpenAI-compatible provider support.
Setup guide →
OpenAI Codex CLI
Terminal-first agentic coding with sandboxed local execution — configure any OpenAI-compatible provider in ~/.codex/config.toml.
Setup guide →
Aider
The leanest option: git-disciplined AI pair programming in the terminal, pointed at any OpenAI-compatible endpoint with two environment variables.
Setup guide →
Power your terminal agent →
Claude Code vs OpenCode, head-to-head →Read the Claude Code review →See all supported tools →