Skip to main content

Quick answer

OpenAI-compatible API and Anthropic-compatible API are two different compatibility layers. Both can be used for model requests, but their request formats, fields, tool semantics, and client expectations differ. Codex CLI, Cursor, Cline, OpenCode, and OpenClaw usually use OpenAI-compatible endpoints. Claude Code and some Claude Desktop Gateway paths use Anthropic-compatible endpoints. Do not choose only by model name. Choose by the protocol expected by the tool, then use the matching Base URL, API Key, and Model ID.

When this matters

  • You see two Base URLs and do not know which one to use
  • Claude Code works, but Codex or Cursor fails
  • Codex works, but Claude Code reports endpoint or auth errors
  • You want to use one API Key across multiple tools
  • You are configuring an API gateway, model router, or local proxy

Key concepts

Start with the tool: If a tool expects OpenAI-style APIs, do not use the Claude Code Anthropic Base URL. If a tool expects Anthropic-style APIs, do not use the OpenAI-compatible /v1 endpoint.

Common mistakes

  • Assuming one model name can be used unchanged across every protocol.
  • Putting the OpenAI-compatible Base URL into Claude Code.
  • Putting the Anthropic-compatible Base URL into Codex, Cursor, or Cline.
  • Treating a Claude.ai or ChatGPT subscription as an API Key.
  • Changing only the API Key while leaving the Base URL and Model ID mismatched.

About BetterToken

BetterToken provides both Anthropic-compatible and OpenAI-compatible access patterns. You can manage API Keys, balance, and usage history in one dashboard, but each client still needs the protocol it actually supports. A simple rule: Claude Code uses Anthropic-compatible; Codex, Cursor, Cline, OpenCode, and OpenClaw usually use OpenAI-compatible.

References