Workspaces provide a way to organize your API usage within an organization. Use workspaces to separate different projects, environments, or teams while maintaining centralized billing and administration.
Every organization has a Default Workspace that cannot be renamed, archived, or deleted. When you create additional workspaces, you can assign API keys, members, and resource limits to each one.
Key characteristics:
wrkspc_ prefix (for example, wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ)wrkspc_ ID like any other workspace (returned in the anthropic-workspace-id response header and accepted by Get Workspace), but it doesn't appear in List Workspaces results, and API keys, usage reports, and cost reports show null for its workspace_idWhen a member of your organization first signs in to Claude Code with their Claude Console account, Anthropic automatically creates a Claude Code workspace in the organization and adds that member to it. Every subsequent member who signs in to Claude Code is added the same way.
The Claude Code workspace keeps Claude Code traffic separate from your other API workloads:
Members can have different roles in each workspace, allowing fine-grained access control.
| Role | Permissions |
|---|---|
| Workspace User | Use Playground only |
| Workspace Limited Developer | Create and manage API keys, use the API. Cannot access session tracing views or download files. |
| Workspace Developer | Create and manage API keys, use the API |
| Workspace Admin | Full control over workspace settings and members |
| Workspace Billing | View workspace billing information (inherited from organization billing role) |
Create and manage workspaces in the Claude Console.
Open workspace settings
In the Claude Console, go to Settings > Workspaces.
Create a workspace
Click Create workspace.
Configure the workspace
Enter a workspace name and select a color for visual identification.
Create the workspace
Click Create to finalize.
To modify a workspace's name or color:
To remove a member, click the trash icon next to their name.
Each workspace's settings split these across two tabs:
To archive a workspace, click the ellipsis menu (...) and select Archive. Archiving:
Programmatically manage workspaces using the Admin API.
# Create a workspace
curl -X POST "https://api.anthropic.com/v1/organizations/workspaces" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
-d '{"name": "Production"}'
# List workspaces
curl "https://api.anthropic.com/v1/organizations/workspaces?limit=10&include_archived=false" \
-H "anthropic-version: 2023-06-01" \
-H "x-api-key: $ANTHROPIC_ADMIN_KEY"
# Archive a workspace
curl -X POST "https://api.anthropic.com/v1/organizations/workspaces/{workspace_id}/archive" \
-H "anthropic-version: 2023-06-01" \
-H "x-api-key: $ANTHROPIC_ADMIN_KEY"For complete parameter details and response schemas, see the Workspaces API reference.
Add, update, or remove members from a workspace:
# Add a member to a workspace
curl -X POST "https://api.anthropic.com/v1/organizations/workspaces/{workspace_id}/members" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
-d '{
"user_id": "user_xxx",
"workspace_role": "workspace_developer"
}'
# Update a member's role
curl -X POST "https://api.anthropic.com/v1/organizations/workspaces/{workspace_id}/members/{user_id}" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
-d '{"workspace_role": "workspace_admin"}'
# Remove a member from a workspace
curl -X DELETE "https://api.anthropic.com/v1/organizations/workspaces/{workspace_id}/members/{user_id}" \
-H "anthropic-version: 2023-06-01" \
-H "x-api-key: $ANTHROPIC_ADMIN_KEY"For complete parameter details, see the Workspace Members API reference.
API keys are scoped to a specific workspace. When you create an API key in a workspace, it can only access resources within that workspace.
Resources scoped to workspaces include:
Some resources cannot be managed with a workspace API key:
workspace:manage_tunnels OAuth token obtained through Workload Identity Federation, not a workspace API key. Tunnels are created in a workspace, and the Console MCP tunnels list and the Managed Agent server picker show tunnels in the current workspace only; the cap of 10 active tunnels applies organization-wide. Tunnel management requires a role with tunnel management permissions; organization developers can view but not change them.To look up your organization's workspace IDs, call the List Workspaces endpoint or find them in the Claude Console.
Claude API responses include an anthropic-workspace-id header alongside the request-id and anthropic-organization-id response headers. Its value is the wrkspc_-prefixed ID of the workspace that the request's API key or access token resolved to, including when that workspace is the Default Workspace. For example, a successful response includes headers like these:
HTTP/1.1 200 OK
request-id: req_018EeWyXxfu5pfWkrYcMdjWG
anthropic-organization-id: 0d0e7a3b-52f1-4c7e-9a51-3f6f2f7c1b9e
anthropic-workspace-id: wrkspc_01JwQvzr7rXLA5AGx3HKfFUJThe header is absent when the credential doesn't resolve to a workspace (for example, on Admin API requests) or when the request fails before authentication completes, such as a 401 error.
The following examples send a Messages API request and print the workspace ID from the response headers:
client = anthropic.Anthropic()
response = client.messages.with_raw_response.create(
model="claude-opus-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello, Claude"}],
)
workspace_id = response.headers.get("anthropic-workspace-id")
print(f"Workspace ID: {workspace_id}")Workspace ID: wrkspc_01JwQvzr7rXLA5AGx3HKfFUJThe same accessors read the header from other Claude API endpoints too, including the Claude Managed Agents APIs. For example, read anthropic-workspace-id from the response that creates a session to record which workspace the session belongs to.
With the workspace ID from a response, you can:
workspace_id field in Usage and Cost API reports and on Admin API objects such as API keys (both report null for the Default Workspace)"name": "Default", even though List Workspaces omits itYou can set custom spend and rate limits for each workspace to protect against overuse and ensure fair resource distribution.
You can set workspace limits lower than (but not higher than) your organization's limits:
For detailed information on rate limits and how they work, see Rate limits. You can also read your current organization and workspace rate limits programmatically with the Rate Limits API.
Track usage and costs by workspace using the Usage and Cost API:
curl "https://api.anthropic.com/v1/organizations/usage_report/messages?\
starting_at=2025-01-01T00:00:00Z&\
ending_at=2025-01-08T00:00:00Z&\
workspace_ids[]=wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ&\
group_by[]=workspace_id&\
bucket_width=1d" \
-H "anthropic-version: 2023-06-01" \
-H "x-api-key: $ANTHROPIC_ADMIN_KEY"Usage and costs attributed to the Default Workspace have a null value for workspace_id.
Create separate workspaces for development, staging, and production: