APIs and setup

Base URL

A base URL is the root address an SDK or app sends its API requests to; each endpoint's path is added to it. Changing it points the same code at a different compatible API.

Also called API base URL, base_url, ANTHROPIC_BASE_URL

Checked November 29, 2026

At a glance

What it is
The address the endpoint paths are added to
OpenAI SDKs
base_url or baseURL, ending in /v1
Anthropic SDKs
base_url or baseURL, without /v1
Claude Code
The ANTHROPIC_BASE_URL environment variable
On /model
https://api.slashmodel.com/v1 for OpenAI SDKs, https://api.slashmodel.com for Anthropic's

The SDKs default to their maker's own API and have a setting to change it: base_url in OpenAI's and Anthropic's Python SDKs, baseURL in their JavaScript SDKs. Anthropic's OpenAI compatibility layer, for one, is used by setting the OpenAI SDK's base_url to https://api.anthropic.com/v1/ (Anthropic). Claude Code reads it from ANTHROPIC_BASE_URL (Claude Code docs).

With or without /v1

The SDKs differ on whether the base URL holds the version. OpenAI's SDKs add the endpoint, such as /chat/completions, to a base URL that ends in /v1. Anthropic's SDKs and Claude Code add /v1/messages themselves, so their base URL stops at the host. When every request gets a 404, the /v1 is usually on the wrong one.

Base URLs on /model

  • OpenAI SDKs, and tools set to the OpenAI format

    Base URL
    https://api.slashmodel.com/v1
  • Anthropic SDKs and Claude Code

    Base URL
    https://api.slashmodel.com

Quick start has both, and each guide shows where the base URL goes in its tool: Claude Code, Cursor, Codex CLI and the rest.

Claude Code
export ANTHROPIC_BASE_URL="https://api.slashmodel.com"
export ANTHROPIC_AUTH_TOKEN="$SLASHMODEL_API_KEY"
claude

Where it applies on /model

Questions

Why do I get 404 errors after changing the base URL?

The /v1 is usually on the wrong one: OpenAI SDKs need it, and Anthropic SDKs and Claude Code don't.

Does changing the base URL change the model?

No. The model is whatever the request names in model. The base URL only decides which server gets the request, and that server has to offer the model.

Sources

The makers' own pages, each opened on November 29, 2026.

One key for every model here.

Top up from $10, change one URL, and pay only for the tokens you use.