What Is an Anthropic API Endpoint? A Developer Guide
An Anthropic API endpoint is a specific URL path that accepts HTTP requests and performs one action — like sending a message to Claude, listing available models, or checking a batch job. Each endpoint has a fixed structure: a method (usually POST or GET), a path (like /v1/messages), required headers, and a defined request/response format.
If you're asking "what is an Anthropic API endpoint," you probably want two things: a clear definition of what an endpoint is in this context, and a practical rundown of the endpoints you'll actually use. This article covers both.
Endpoint vs. Base URL vs. API
These three terms get used loosely, so here's the distinction:
- API — the whole system: authentication, endpoints, rate limits, error handling, everything.
- Base URL — the root address all requests share, e.g.
https://api.anthropic.com. - Endpoint — a specific path appended to the base URL, tied to one function, e.g.
https://api.anthropic.com/v1/messages.
So the endpoint is the most granular piece — it's the exact door you knock on to get a specific job done.
The Core Anthropic API Endpoints
/v1/messages
This is the endpoint you'll use for almost everything: sending a prompt, getting a completion, running multi-turn conversations, using tool calling, and streaming responses.
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-opus-4-20250514",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Explain what an API endpoint is."}]
}'
The response comes back as a JSON object containing the generated content, stop reason, and token usage — or as a stream of server-sent events if you set "stream": true.
/v1/messages/batches
For non-interactive, large-volume workloads. You submit many message requests at once, Anthropic processes them asynchronously, and you poll for results. Useful for bulk classification, summarization, or evaluation jobs where you don't need a response in real time.
/v1/models
Returns the list of available models and their identifiers. Handy for building UIs that let users pick a model, or for validating a model string before sending a request.
Deprecated: /v1/complete
Older integrations may still reference the legacy Text Completions endpoint. It's deprecated in favor of /v1/messages, which supports structured multi-turn conversations, system prompts, tool use, and vision input. New projects should not use /v1/complete.
What a Request to an Endpoint Actually Looks Like
Every call to an Anthropic API endpoint needs:
- The correct HTTP method — almost all functional endpoints use
POST; listing resources usesGET. - Authentication headers — an API key passed via
x-api-key, plus ananthropic-versionheader specifying the API version you're targeting. - A JSON body — matching the schema for that specific endpoint (model, messages, max_tokens, etc. for
/v1/messages). - Content-Type header —
application/jsonfor standard requests.
Miss any of these and you'll get a 4xx error, not a silent failure — the API is strict about malformed requests, which is useful for catching integration bugs early.
Why "Which Endpoint Do I Call" Matters in Practice
Most confusion around Anthropic API endpoints comes from mixing up responsibilities:
- Want a single response to a prompt? Use
/v1/messages. - Want to process 10,000 prompts overnight without holding open connections? Use
/v1/messages/batches. - Want to check what models exist before hardcoding a string? Use
/v1/models. - Building a chat UI with token-by-token output? Use
/v1/messageswith"stream": true.
Picking the wrong endpoint for the job usually shows up as either wasted latency (using non-batch calls for bulk work) or unnecessary complexity (polling logic for something that could be a single synchronous call).
Calling Endpoints Through SubToAPI
If you already use Claude through a subscription rather than a metered Anthropic API key, you don't get direct access to api.anthropic.com endpoints — subscription access is tied to the chat interface, not a programmatic key. SubToAPI sits in that gap: it turns your existing Claude access into a standard HTTPS API with its own endpoint structure, mirroring the same request shape developers already know.
const res = await fetch("https://api.subtoapi.app/v1/messages", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SUBTOAPI_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "claude-opus-4-20250514",
max_tokens: 1024,
messages: [{ role: "user", content: "Summarize this endpoint concept." }]
})
});
const data = await res.json();
console.log(data);
You get application-scoped API keys (sub_live_...), streaming, tool use, and usage metadata per key — all through one endpoint, without managing separate billing per developer or app. Full request/response formats are in the docs, and the quickstart walks through your first call in a few minutes. For streaming responses specifically, see streaming; for tool calling, see tools.
Plans start at €9/month for solo use, with team pricing at €19/seat and scale pricing at €49/seat — see pricing for details, or sign up to get a key and try it against a real endpoint.
Practical Checklist Before Calling an Endpoint
- Confirm the exact path (
/v1/messages, not a guessed variant). - Confirm the HTTP method matches what the endpoint expects.
- Include all required headers, including any version header your provider expects.
- Match the request body schema exactly — extra or missing fields often cause validation errors.
- Handle both the synchronous JSON response and, if relevant, the streaming event format separately in your code.
Questions
Is an Anthropic API endpoint the same as the API key? No. The endpoint is the URL path you send a request to; the API key is the credential that authenticates the request. You need both — a valid key sent to the correct endpoint — for a call to succeed.
Do all Anthropic API endpoints use the same request format? No. /v1/messages expects a messages array with model and max_tokens fields, while /v1/models is a simple GET request with no body. Each endpoint has its own schema documented for its specific purpose.
Can I call an Anthropic-style endpoint without a metered API key? Yes, if you use a service like SubToAPI, which exposes an HTTPS API with its own endpoints built on top of an existing Claude subscription, rather than requiring a separate pay-per-token Anthropic API account.