GrepBoard/Manuals
605 manuals ·

Claude API 404 not_found_error: wrong path, ID or model

·updated ·Tested on Python 3.12.16 (Docker) · anthropic 2.3.0 · curl · Claude API official docs · 2026-12·Test scope ↓·6 steps

Claude API 404 not_found_error means the resource was not found. Check the endpoint path (a doubled /v1), resource IDs in the URL, and the model name.

output
{"type":"error","error":{"type":"not_found_error","message":"Not found"},"request_id":null}

A 404 not_found_error means the Claude API could not find the requested resource, and the official errors page names what to check: the endpoint path and any resource IDs in the request URL. The response above is what actually came back for a mistyped path, /v1/v1/messages; the Python SDK raises it as anthropic.NotFoundError. Even when the path and IDs are right, the docs say the Messages API on the Claude API returns the same 404 not_found_error for a retired model. If code that used to work suddenly returns a 404, start with [4].

[1] Print the URL the request really went to. The base address is https://api.anthropic.com and the Messages API is POST /v1/messages. Here is a request with no key and a wrong path (only the cf-ray value is masked):

console
$ curl -sS -i -X POST https://api.anthropic.com/v1/v1/messages -H "anthropic-version: 2023-06-01" -H "content-type: application/json" -d "{}"
output
HTTP/2 404date: Thu, 29 Oct 2026 21:26:49 GMTcontent-type: application/jsoncontent-length: 91x-should-retry: falseserver-timing: x-originResponse;dur=server: cloudflarecf-cache-status: DYNAMICx-robots-tag: nonecontent-security-policy: default-src 'none'; frame-ancestors 'none'cf-ray: ... {"type":"error","error":{"type":"not_found_error","message":"Not found"},"request_id":null}

https://api.anthropic.com/messages, without /v1, returned a 404 with no body at all, while the same command against the correct /v1/messages returned 401 x-api-key header is required, not 404, with a request-id header. So in this test a wrong path produced a 404 before the key was even checked, with no request-id header and request_id set to null in the body. If your 404 has an empty request_id, suspect the path first.

[2] Check whether your SDK base_url ends in /v1. The SDK appends /v1/messages to base_url itself. A test server recorded the path each setting produced:

console
$ python3 base_url_check.py
output
anthropic 2.3.0base_url=http://127.0.0.1:18504 -> ['/v1/messages'] NotFoundError 404 | requests=1base_url=http://127.0.0.1:18504/v1 -> ['/v1/v1/messages'] NotFoundError 404 | requests=1ANTHROPIC_BASE_URL=http://127.0.0.1:18504/v1 -> ['/v1/v1/messages'] NotFoundError 404

Even with no base_url in code, the ANTHROPIC_BASE_URL environment variable does the same. Ending the address with /v1 doubles the path, so remove just that /v1. If your proxy or gateway requires its own path prefix (for example /anthropic), keep the prefix and confirm in the gateway log that the real request path is that prefix plus a single /v1/messages. As requests=1 shows, the SDK does not retry a 404 (it retries connection errors, 408, 409, 429 and 500 and above).

[3] Check resource IDs in the URL. For calls with an ID in the path (GET /v1/models/{model_id}, batch and file lookups, and so on), a typo or an ID created elsewhere can cause the 404. Message Batches are scoped to a Claude Console workspace, and you see only batches created in the workspace your request runs in, so make sure you are not looking up a batch ID with a key from another workspace. The exact status code in that case is not stated in the docs.

[4] Check the model name. model goes in the request body, not the URL. The Model deprecations page says that requests to a retired model fail, and that the Messages API on the Claude API returns a **404 not_found_error**. Neither that page nor the errors page was found to say which status a model name that does not exist returns. Check the state of a model directly with the Models API. From the docs:

console
$ curl https://api.anthropic.com/v1/models/$MODEL_ID \    -H 'anthropic-version: 2026-10-21' \    -H "Authorization: Bearer $ANTHROPIC_API_KEY"

GET /v1/models/{model_id} takes a model ID or alias, returns its details, and resolves an alias to the model ID. If the response has lifecycle set to retired, the model can no longer be used. The GET /v1/models list shows only active and deprecated models by default; retired models appear only when you pass retired in the lifecycle query parameter.

Common slips when reading the name:

What you wrotePer the docs
anthropic.claude-sonnet-4-6, …-v1:0Amazon Bedrock format. On the Claude API it is claude-sonnet-4-6
claude-haiku-4-5@20251001Claude Models on Google Cloud (Google managed) format for pre-4.6 models
A date added, like claude-opus-5-5-20260921From the 4.6 generation on, IDs have no date (claude-opus-5-5)
claude-sonnet-4-20250514, claude-opus-4-20250514Retired June 15, 2026
claude-opus-4-1-20250805Retired August 5, 2026
claude-3-haiku-20240307Retired April 20, 2026
claude-3-7-sonnet-20250219, claude-3-5-haiku-20241022Retired February 19, 2026
claude-sonnet-4-5-20250929, claude-sonnet-4-5Retired November 30, 2026, including the undated name

The retirement dates were checked on 2026-12-01 and apply to the Claude API and the other Anthropic-operated platforms. Amazon Bedrock and the Google-managed Claude Models on Google Cloud have their own schedules. The steps for moving off Sonnet 4.5 are in Claude Sonnet 4.5 retired on Nov 30, 2026: how to migrate.

claude-opus-4-5-20251101 and the undated claude-opus-4-5 are deprecated, with retirement scheduled for January 22, 2027. Per the Models API docs, a deprecated model stays callable only for organizations with existing access and is closed to new adopters. If the scheduled date has passed but lifecycle is still deprecated, the retirement is overdue and has not happened yet. Judge by the lifecycle value in the GET /v1/models/{model_id} response above, not by the date.

[5] A bad beta header is a 400, not a 404. An invalid beta name, or a beta your organization cannot use, in anthropic-beta returns 400 invalid_request_error (Unexpected value(s) … for the anthropic-beta header) per the docs. Endpoints that need their own beta header, such as /v1/agents, /v1/sessions and /v1/environments, require a header like managed-agents-2026-04-01 on every raw HTTP request; the SDK's client.beta adds it for you. Which status you get when that header is missing is not in the docs.

[6] If the cause is still unclear, keep the request-id. Requests that reached the API with a valid path carry a request-id header and a request_id in the body. Send that value along with the request URL and model value when you contact support.

Other status codes have their own pages: Claude API 504 timeout_error for processing timeouts, 529 overloaded_error for overload, and 413 request_too_large for request size.

Check it with the HTTP status codes tool ↗ — calculated in your browser.

#claude#api#404#not_found_error#base_url