Tutorials & Tips

Cursor / Claude Code / Codex: should Base URL include /v1? A quick table

Bottom line: OpenAI-compatible clients (Cursor, Codex) usually set Base URL to https://host/v1. Claude Code’s ANTHROPIC_BASE_URL is usually the gateway root—the client appends /v1/messages. Do not copy one into the other. Wrong paths often look like bad keys (404 / not found).

Scope: whether to include /v1, and not mixing OpenAI-compatible vs Anthropic Messages. UI labels follow current vendor docs or your local settings. Placeholders only.

ProtocolTypical clientHow to fill BaseClient still appends
OpenAI-compatibleCursor Override / Codex CLIUsually with /v1/chat/completions or /responses
Anthropic MessagesClaude CodeUsually root only/v1/messages
Client/v1?Example
CursorUsually yeshttps://api.example.com/v1
Claude CodeUsually no (root)https://api.example.com
Codex CLIUsually yeshttps://api.example.com/v1 (Azure: …/openai/v1)

Boundaries: Cursor Override mainly covers local Chat/Agent. Claude Code changes endpoint, not model name. Codex docs require /v1 in base_url; env_key is an env var name only. Never put full …/chat/completions or …/messages into Base URL.

Verify: (1) minimal auth’d GET …/v1/models or Claude POST …/v1/messages with max_tokens: 1; (2) streaming; (3) tool use (read a local file / harmless command).

Troubleshoot 401/404: duplicate/missing /v1 → exact model ID → key / Bearer vs x-api-key → reload config → protocol mix-up.

Safety: test keys with limits; secrets in env/store only; rotate after tests.

Related: https://new.nat6.net/news/custom-29ac3cf47988454c/

Verification: 2026-11-07 (Asia/Shanghai). Sources: Claude Code env-vars / gateway docs; Cloudflare Cursor Override; OpenAI API overview; Microsoft Learn & NVIDIA NIM Codex notes.

Quick Facts

Published
Source
Orange News Editorial / vendor docs
Category
Tutorials & Tips
Topic
Industry NewsTutorials & Practice
Why it matters

对照三类客户端的 Base URL 配置,分清协议与路径,再按最小请求、流式和工具调用逐步排查。

Topics

Related entities

How to Cite

When citing this article, keep the title, date, and permalink, and credit Orange News as the source.

Orange News: Cursor / Claude Code / Codex: should Base URL include /v1? A quick table. November 7, 2026. https://new.nat6.net/en/news/custom-e410786ad6764d07/

View all →