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 members, service accounts, API keys, 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_id, as do all-workspaces API keys (an API key's scope field tells them apart; for a key bound to the Default Workspace it carries the real ID)When 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.
The following SDK and CLI examples construct the default client, which reads the Admin API key from the ANTHROPIC_API_KEY environment variable; the SDKs expose these endpoints under client.beta.organization.workspaces. SDK list methods fetch further pages on demand, so limit sets the page size; the PHP, Ruby, and curl examples return one page.
Create a workspace:
client = anthropic.Anthropic()
workspace = client.beta.organization.workspaces.create(name="Production")
print(f"id: {workspace.id}")
print(f"name: {workspace.name}")List workspaces:
client = anthropic.Anthropic()
workspaces = client.beta.organization.workspaces.list(limit=10, include_archived=False)
for workspace in workspaces:
print(f"{workspace.id}: {workspace.name}")Archive a workspace:
client = anthropic.Anthropic()
workspace = client.beta.organization.workspaces.archive(
"wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
)
print(f"id: {workspace.id}")
print(f"archived_at: {workspace.archived_at}")For complete parameter details and response schemas, see the Workspaces API reference.
Add a member to a workspace:
client = anthropic.Anthropic()
member = client.beta.organization.workspaces.members.add(
"wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
user_id="user_01XyDMpzjS89pFZXqSFUBDr6",
workspace_role="workspace_developer",
)
print(f"user_id: {member.user_id}")
print(f"workspace_role: {member.workspace_role}")Update a member's role:
client = anthropic.Anthropic()
member = client.beta.organization.workspaces.members.update(
"user_01XyDMpzjS89pFZXqSFUBDr6",
workspace_id="wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
workspace_role="workspace_admin",
)
print(f"user_id: {member.user_id}")
print(f"workspace_role: {member.workspace_role}")Remove a member from a workspace:
client = anthropic.Anthropic()
removed_member = client.beta.organization.workspaces.members.remove(
"user_01XyDMpzjS89pFZXqSFUBDr6",
workspace_id="wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
)
print(f"user_id: {removed_member.user_id}")For complete parameter details, see the Workspace Members API reference.
Every request runs in exactly one workspace and can only access resources within that workspace. Which workspace depends on the key type:
anthropic-workspace-id header. Accounts must have access to the workspace to use it.Resources scoped to workspaces include:
Some resources are managed differently:
workspace:manage_tunnels OAuth token obtained through Workload Identity Federation, not an 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.org:admin OAuth token, or a personal or service account key that isn't scoped to a specific workspace.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, as API keys also do for all-workspaces keys; an API key's scope field tells the two apart and, for a key bound to one workspace, carries that workspace's real ID)"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:
| Workspace | Purpose |
|---|---|
| Development | Testing and experimentation with lower rate limits |
| Staging | Pre-production testing with production-like limits |
| Production | Live traffic with full rate limits and monitoring |
Assign workspaces to different teams for cost allocation and access control:
Create workspaces for specific projects or products to track usage and costs separately.
Plan your workspace structure
Consider how you'll organize workspaces before creating them. Think about billing, access control, and usage tracking needs.
Use meaningful names
Name workspaces clearly to indicate their purpose (for example, "Production - Customer Chatbot" or "Dev - Internal Tools").
Set appropriate limits
Configure spend and rate limits to prevent unexpected costs and ensure fair resource distribution.
Audit access regularly
Review workspace membership periodically to ensure only appropriate users have access.
Monitor usage
Use the Usage and Cost API to track workspace-level consumption.
Was this page helpful?