What Is the Anthropic API URL? A Quick Technical Answer
The short answer
The Anthropic API URL is https://api.anthropic.com. That's the base domain every request to Claude's API goes through. You don't call it on its own — you append a versioned path and an endpoint, like /v1/messages, and send the request over HTTPS with the right headers.
If you've been searching for "what is anthropic api url," you're probably either writing your first API call and don't know what to put in the request line, or you're debugging a connection error and want to confirm you're hitting the right host. Either way, the answer is the same: https://api.anthropic.com is the domain, /v1/messages (or another /v1/... path) is the resource, and everything else — headers, JSON body, auth — sits on top of that.
Anatomy of the URL
A full request URL to Anthropic's API looks like this:
https://api.anthropic.com/v1/messages
Breaking it down:
- Protocol — always
https://. There is no plain-HTTP option; unencrypted requests will fail. - Host —
api.anthropic.com. This is separate fromclaude.ai, which is the consumer chat interface, not an API endpoint. Pointing your code atclaude.aiis one of the most common mistakes developers make when setting this up for the first time. - Version prefix —
/v1. Anthropic versions its API at the path level rather than through query parameters, so every endpoint you call sits under/v1. - Resource path —
/messagesis the main one for chat completions, but there are others depending on what you're building (batch processing, model listing, etc.).
There's no port number, no subdomain per region, and no trailing slash needed. If you're copy-pasting a URL from documentation or a tutorial, double-check for stray slashes or http instead of https — both are silent failure points that produce confusing DNS or SSL errors rather than a clear "wrong URL" message.
A minimal request
Here's what a raw call to that URL looks like with curl:
curl https://api.anthropic.com/v1/messages \
-H "content-type: application/json" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "claude-opus-4",
"max_tokens": 200,
"messages": [{"role": "user", "content": "Hello"}]
}'
Three things matter beyond the URL itself:
x-api-keyheader — your Anthropic API key, not aBearertoken in theAuthorizationheader the way many other APIs work.anthropic-versionheader — a date string that pins the API behavior you're coding against. Omitting it usually defaults to the latest version, which can change response shapes over time.content-type: application/json— required on POST requests with a JSON body.
Get any of these wrong and you'll get a 4xx error even though the URL itself is correct — worth knowing when you're debugging, since "wrong URL" and "wrong headers" produce different but easily confused symptoms.
Is there more than one Anthropic API URL?
For direct API access, no — api.anthropic.com is the single endpoint regardless of which Claude model you're calling. There's no per-model or per-region host to worry about. If you're using Claude through a cloud platform instead (Amazon Bedrock or Google Vertex AI, for example), the URL changes to that platform's own API endpoint, because you're going through their infrastructure and billing rather than Anthropic's directly. That's a meaningfully different setup — different auth, different request shape in places — so it's worth confirming which route you're actually on before you start debugging a "wrong URL" problem.
When you'd use a different URL on purpose
Some teams don't want to manage ANTHROPIC_API_KEY, raw key rotation, and per-project usage tracking by hand — especially once more than one person or app needs access. That's the case for using a gateway like SubToAPI, which sits in front of your existing Claude access and gives you a different base URL to call instead:
https://api.subtoapi.app/v1/messages
The request shape is close to the native API — same messages structure, same streaming behavior — but authentication uses your own sub_live_... application key instead of directly exposing your Anthropic credentials in every service that needs to call Claude. You get one dashboard for usage metadata, team seats, and key management across projects, rather than distributing raw API keys to everyone who needs access.
A basic call looks like this:
curl https://api.subtoapi.app/v1/messages \
-H "Authorization: Bearer $SUBTOAPI_KEY" \
-H "content-type: application/json" \
-d '{
"model": "claude-opus-4",
"max_tokens": 200,
"messages": [{"role": "user", "content": "Hello"}]
}'
If you're building something small and solo, calling api.anthropic.com directly is completely fine. If you're rolling access out across a team, or you want per-key usage visibility without building that tooling yourself, it's worth comparing plans at /pricing and trying it from /signup — there's a free trial, and the /docs/quickstart walks through getting your first key and request working in a few minutes. The full request/response reference is at /docs/messages, with dedicated guides for /docs/streaming and /docs/tools if your app needs either.
questions
Is api.anthropic.com the same URL used by the Claude chat app? No. claude.ai is the consumer web interface; api.anthropic.com is the programmatic API. They use separate authentication and aren't interchangeable.
Do I need to specify a region in the URL? No. There's a single global endpoint for direct API access — no regional subdomains to choose between.
What happens if I call the URL without the /v1 prefix? You'll get a 404 or routing error. All current endpoints live under the /v1 path, so requests to the bare domain or unversioned paths won't resolve.