One endpoint, eight different settings
Switching an existing integration is usually a base URL argument, not a rewrite. The hard part is that every client names that argument differently, and half of them append their own version path. The table below is the map we use when a setup fails.
One endpoint, eight different settings
There is no universal base URL variable. The table below is why copying another tool's snippet usually produces a 404 that looks like an auth failure.
| Client | Setting | Value shape | Trap |
|---|---|---|---|
| OpenAI Python SDK | base_url | https://aicomp.ai/v1 | Carries /v1 |
| OpenAI Node SDK | baseURL | https://aicomp.ai/v1 | Carries /v1 |
| Anthropic SDK / Claude Code | ANTHROPIC_BASE_URL | https://aicomp.ai | Client appends /v1/messages |
| LangChain | base_url kwarg | https://aicomp.ai/v1 | Non-OpenAI host may drop token usage |
| Vercel AI SDK | createOpenAI({ baseURL }) | https://aicomp.ai/v1 | Not openai(); that ignores the override |
| Spring AI | base-url + completions-path | https://aicomp.ai | No /v1 in base-url |
| Prism PHP | url | https://aicomp.ai/v1 | Default already ends in /v1 |
| Goose | OPENAI_HOST | https://aicomp.ai/v1 | Not OPENAI_BASE_URL |
Browse the other clusters
All 15 guides in this cluster
- Anthropic base URL in Python — working examples
- Codex CLI with a custom endpoint
- Cursor Agent Mode with a Custom Endpoint: What Actually Routes
- Custom base URL in Node.js — OpenAI and Anthropic SDKs
- Every tool that speaks OpenAI, pointed at one endpoint
- Gemini CLI with a custom endpoint
- Open WebUI with an OpenAI-compatible endpoint
- OpenAI Agents SDK with a custom endpoint
- OpenAI-compatible API endpoints: what compatibility really covers
- Point Cursor at a custom Anthropic base URL
- Streaming through a custom endpoint: the usage chunk you are not getting
- Use a custom endpoint with the OpenAI and Anthropic SDKs
- Use Claude Code with a custom API endpoint
- Use Gemini through a custom endpoint
- Vercel AI SDK with a custom endpoint
FAQ
Should the base URL include /v1?
It depends on the client. OpenAI-compatible SDKs expect the version root and add the operation path; Anthropic clients append /v1/messages themselves, so a versioned base produces a doubled path. Check the row for your client rather than guessing.
Why do I get 401 when the URL looks correct?
A doubled or missing version path is frequently reported as an auth failure, because the request never reaches the endpoint that reads your key. Verify with a direct curl to /v1/models before changing credentials.
Can one base URL cover every tool in a project?
The endpoint can, but the configuration cannot. Environment variables, per-project JSON, UI fields and per-node settings all override differently. The tool index lists which one each client reads.
Check the current rate for your model before you commit a workload.