Claude API 403 permission_error: causes and fixes
Claude API 403 permission_error: the key authenticated but may not use that resource. Check workspace, key type and scopes, and organization access.
{"type":"error","error":{"type":"permission_error","message":"..."},"request_id":"req_..."}A 403 permission_error means, per the Claude API errors page, that your API key does not have permission to use the specified resource, and the page points you to your organization's access and workspace settings in the Claude Console. The block above is the JSON shape from the errors page; message varies. This page did not produce a 403 itself (that needs a real key that lacks a permission), so it collects only the causes the official docs give for a 403.
[1] Tell 401 from 403 first. A 401 authentication_error is a problem with the key itself (malformed, revoked or expired); a 403 means the key was recognized but is not allowed to do this. With no key, or a made-up key, you get a 401, not a 403 (no billing; request-id and the like are masked):
$ curl -sS -i -X POST https://api.anthropic.com/v1/messages -H "x-api-key: invalid-example-key" -H "anthropic-version: 2023-06-01" -H "content-type: application/json" -d "{}"HTTP/1.1 401 UnauthorizedContent-Type: application/jsonContent-Length: 130request-id: ...x-should-retry: falseServer: cloudflareCF-RAY: ... {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"},"request_id":"req_..."}If the body's error.type is authentication_error, replace the key. Continue only for permission_error. A billing problem is a separate 402 billing_error, and a wrong path or model name is covered in 404 not_found_error.
[2] See which workspace the request lands in. Per the Workspaces page, Claude API responses carry an anthropic-workspace-id header whose value is the wrkspc_ ID of the workspace the request's key or token resolved to. It is absent when the request fails before authentication completes, such as a 401. If your key already succeeds on any call, read the header from that response:
$ curl -sS -i https://api.anthropic.com/v1/models -H "x-api-key: $ANTHROPIC_API_KEY" -H "anthropic-version: 2023-06-01"Match the wrkspc_… value against the ID column on the Console's Workspaces page and confirm it is the workspace you meant. Whether the header is also present on a 403 is not stated in the docs, and was not confirmed. If the response has a request-id, keep it for [6].
[3] Check the key's scope. These are the rules from the authentication page:
| Key | Workspace |
|---|---|
| A key created for one workspace | Works only in that workspace; the workspace ID can be omitted from requests |
| A key not tied to a workspace | You must send the anthropic-workspace-id header on every request, and the key's user (or service account) must have access to that workspace |
If the key's user or service account is not a member of the workspace you name in the header, or you use a single-workspace key against another workspace, a permission problem is plausible. The docs do not say whether the status code in that case is 403. The header form, as in the docs:
$ curl https://api.anthropic.com/v1/models -H "x-api-key: $ANTHROPIC_API_KEY" -H "anthropic-version: 2023-06-01" -H "anthropic-workspace-id: wrkspc_..."[4] Check the role. In the Workspaces page's role table, the roles that can use the API and create keys are Workspace Developer and Workspace Limited Developer; Workspace User is "Use playground only". A personal key acts as its creator with that person's roles and permissions, and a service account key works within what the service account can access (the Default Workspace plus any it was added to). To change a role, the Console is the place, and an organization admin does it.
[5] If the token came from Workload Identity Federation, check oauth_scope. The WIF troubleshooting table lists "token exchange succeeds but a Claude API request returns 403", with the cause "the minted token's scope does not grant access to that endpoint". The scopes:
| Scope | Grants (per the docs) |
|---|---|
workspace:developer | All non-administrative endpoints in the workspace (Messages, Models, Managed Agents, Files, Skills) |
workspace:inference | Inference endpoints only (Messages, Models, OpenAI-compatible chat) |
org:admin | The Admin API (members, invites, workspaces, API keys and the rest). An OAuth org:admin token can create or modify only rules scoped to workspace:developer or workspace:inference, and cannot update an issuer that backs a rule with any other scope |
For example, a workspace:inference token calling Files or Skills is out of scope. The docs say a request outside the token's scope returns HTTP 403 and that finer-grained read/write scopes do not exist. When you change a rule's oauth_scope, it must be a scope the service account's organization_role allows.
[6] An Admin API key returns 403 when it exceeds its scopes. A Claude Enterprise admin key can use only the scopes chosen when it was created, and a call beyond them returns 403 Forbidden with a message listing the scopes the key has and the scopes the endpoint needs. Scopes cannot be added later; create a new key ("Scopes are fixed at creation").
[7] If it is still unclear, keep the request-id header, the request URL, the key type (personal, service account or workspace key) and the workspace ID, and send them when you contact support. A 403 also appears on other platforms with its own causes: on Microsoft Foundry the docs point to Azure RBAC roles (Foundry User or Cognitive Services User), and on Google Cloud to IAM permissions of the claude.googleapis.com service. If you call through those, use the platform's own page.
Check it with the HTTP status codes tool ↗ — calculated in your browser.