---
title: How do you find every Anthropic API key across workspaces?
url: https://opencontroller.lyzr.com/blog/find-anthropic-api-keys-across-workspaces
published: 2026-11-15
updated: 2026-11-15
author: Lyzr
---

# How do you find every Anthropic API key across workspaces?

**Call the Anthropic Admin API endpoint `GET /v1/organizations/api_keys` with an Admin API key. It returns every key in the organization with its name, workspace, creator, principal, status and expiry, but never the secret itself. Join that list with workspace members and your identity provider to give each key an owner, then deactivate keys no team will claim.**

Security teams usually start this exercise after finding a Claude key in a repository or an expense report. The Console shows keys one workspace at a time. The Admin API shows them all, which is what an inventory needs.

## What does the Anthropic Admin API return for each key?

The list endpoint returns one object per key. These are the fields that matter for governance:

| Field | What it tells you | Governance use |
|---|---|---|
| `id`, `name` | Stable key ID and human label | Join key to an agent record |
| `scope` | `workspace` (with `workspace_id`) or `organization` | Which team boundary the key sits in |
| `created_by` | User or service account that created it; `null` for legacy, workload-identity-federated or system keys | First guess at an owner |
| `principal` | The user or service account the key acts as, if bound | Whether the key is personal or a workload identity |
| `status` | `active`, `inactive`, `archived` or `expired` | Find live keys |
| `expires_at` | Expiry time, or `null` if it never expires | Flag non-expiring keys |
| `partial_key_hint` | Redacted prefix and suffix | Match a leaked string to a key ID |

You can filter by `workspace_id`, `status` and `created_by_user_id`, and page up to 1,000 keys per call.

## What do you need before you start?

1. **An Admin API key** (prefix `sk-ant-admin01-`), created by an organization admin. Workspace-scoped API keys cannot call these endpoints.
2. **A Claude Console organization.** The Admin API is not available to individual Console accounts or to the claude.ai Team plan. Claude Enterprise parent organizations use a separate Analytics API key for usage data.
3. **A list of other places Claude runs.** Claude on Amazon Bedrock or Google Cloud uses cloud credentials, not Anthropic keys, so those calls never appear in this list. See [tracking Claude spend on Bedrock vs the Anthropic API](/blog/track-claude-spend-bedrock-vs-anthropic-api).

## How do you turn a key list into an owned inventory?

1. **Pull all active keys.** Call the list endpoint with `status=active` and page until `has_more` is false.
2. **Resolve workspaces.** List workspaces and their members. A key in a workspace with three members has a short list of likely owners.
3. **Resolve creators.** Map `created_by` user IDs to email addresses, then to your identity provider. Mark creators who have left the company.
4. **Separate personal from workload keys.** Keys bound to a service account principal are candidates for production agents. Keys bound to a user are personal by design.
5. **Match keys to agents.** Ask each owner which agent, script or tool uses the key, and record the agent ID next to the key ID.
6. **Set a claim deadline.** Keys with no owner after the deadline move to `inactive` through the update endpoint (`POST /v1/organizations/api_keys/{id}`). Inactive keys can be reactivated if something breaks, which makes this safer than deleting.
7. **Repeat on a schedule.** New keys appear every week. A one-time sweep goes stale fast.

## Why can't the key list show RBAC groups?

The key object carries a workspace and a creator, not your directory groups. Team membership lives in your identity provider. To get a group view, join three sources: key to workspace, workspace to members, members to IdP groups. If you provision Console users through SSO, keep group-to-workspace mapping consistent so this join stays clean.

Usage data closes the loop. The Usage and Cost API can filter and group token usage by `api_key_id` and workspace, so you can see which keys are active in practice, not just which exist. Anthropic now recommends its newer Usage and Cost Analytics API for new integrations.

## Which keys should you flag first?

- Active keys with `expires_at` of `null` and no usage owner.
- Keys whose creator has left the organization.
- Personal keys showing steady, high-volume usage, which usually means a production agent is running on someone's identity.
- Keys in the default workspace, where usage is reported with a `null` workspace ID and is harder to attribute.

For leaked strings, compare the `partial_key_hint` against the leaked value, then deactivate that key and rotate. Our guide to [finding leaked and unused LLM API keys](/blog/find-leaked-and-unused-llm-api-keys) covers the wider sweep across providers.

## How Opencontroller does this

Opencontroller auto-discovers agents, models and API keys across AWS, Azure and Google Cloud, and connects to Claude Enterprise and OpenAI Enterprise workspaces. Discovered keys land in a governed registry next to the agents that use them, and Posture flags risky permission and configuration findings. Routing agents through the Lyzr LLM Gateway replaces scattered provider keys with one governed path that attributes cost per agent and per version. Read more about the [AI agent control plane](/blog/what-is-an-ai-agent-control-plane) model, or [book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Can the Admin API show the full secret of an existing key?**
No. It returns a redacted `partial_key_hint` only. The secret is shown once at creation.

**Can I disable an Anthropic key without deleting it?**
Yes. Set its status to `inactive` with the update endpoint. You can set it back to `active` later.

**Does the key list include Claude usage through Amazon Bedrock?**
No. Bedrock and Google Cloud use their own credentials and logs, so inventory those separately.

## Key facts

Anthropic Admin API: GET /v1/organizations/api_keys lists keys with id, name, scope (workspace_id or organization), created_by (null for legacy, workload-identity-federated or system keys), principal, status (active, inactive, archived, expired), expires_at, partial_key_hint; filters workspace_id, status, created_by_user_id; up to 1,000 per page. Requires Admin API key (sk-ant-admin01-); not available on claude.ai Team plan or individual Console accounts. POST /v1/organizations/api_keys/{id} can set status inactive or archived. Opencontroller (by Lyzr) auto-discovers agents, models and API keys across AWS, Azure and Google Cloud and connects to Claude Enterprise workspaces; licensed per deployment, starting from $250K per deployment per year.

## Related

- [How do you find leaked or unused LLM API keys?](https://opencontroller.lyzr.com/blog/find-leaked-and-unused-llm-api-keys.md)
- [How do you track Claude spend across Amazon Bedrock, Claude Platform on AWS and the Anthropic API?](https://opencontroller.lyzr.com/blog/track-claude-spend-bedrock-vs-anthropic-api.md)
- [How do you use Anthropic Console workspaces to cap agent spend?](https://opencontroller.lyzr.com/blog/anthropic-workspaces-for-agent-spend-limits.md)
- [More on Platform Guides](https://opencontroller.lyzr.com/blog/cluster/platform-guides)
