> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opal.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Anthropic Setup

> Connect your Anthropic organization to Opal and sync Claude agents into Agent Inventory.

> [!NOTE]
>
> Syncing agents from Anthropic is part of [Agent Inventory](/docs/agent-inventory), which is currently in limited beta. Contact Opal support to enable it for your organization.

To discover Claude agents, Opal needs an Anthropic connection with at least one API key. Anthropic sells two products, Claude Console and Claude Enterprise. They are separate Anthropic organizations with separate keys, and each key gives Opal access to different data. This page explains which keys to create, what Opal uses each one for, and how to sync agents once the connection exists.

## Requirements

Before you begin, you must:

* Be an Opal Admin
* Be able to create an Admin key in your Claude Console organization, a Claude Enterprise API key (only your organization's Primary Owner can create one), or both

## Choose your keys

You need at least one of the first two keys. The third is optional.

| Key | Where you create it | What Opal uses it for |
| - | - | - |
| **Admin Key** | Claude Console, under **Settings** > **Admin keys** | Syncing your Anthropic users, workspaces, and workspace access, and granting or revoking workspace membership. Also lists your organization's API keys so you can import them as agents. |
| **Enterprise API Key** | claude.ai, under **Organization settings** > **API**, created by your organization's Primary Owner | Connector usage and the usage-based agent discovery in Agent Inventory (the `read:analytics` scope), plus which MCP integrations were connected, by whom, and API key lifecycle (the `read:compliance_activities` scope). |
| **Org Admin Token** (optional) | Generated by an Anthropic admin, for example with `ant auth login --profile admin --scope org:admin` | Needed to govern Anthropic service accounts. Anthropic's service-account endpoint doesn't accept an Admin Key, so Opal uses this token to list service accounts and show real names for them. The token expires periodically, and you have to paste a new one when it does. |

Anthropic fixes a key's scopes when the key is created. One Enterprise API key can carry both scopes, or your organization can hold two keys with one scope each. If you have two, add the second one after you create the connection. See [Add or change a key later](#add-or-change-a-key-later).

### What each combination gives you

| You provide | What works |
| - | - |
| Admin Key only | User, workspace, and workspace access sync, plus the **API keys & accounts** tab when you sync agents. The **Active users** tab is unavailable until you add an Enterprise API Key. |
| Enterprise API Key only | Usage-based agent discovery on the **Active users** tab. Opal can't sync Anthropic users or workspaces, and the **API keys & accounts** tab is empty, because both need an Admin Key. |
| Both | Everything above. |

## Connect your Anthropic organization

1. In Anthropic, create the keys you chose in the previous section. Save each key when Anthropic displays it.
2. In Opal, go to **Inventory** > **+App** and select **Anthropic**.
3. Fill in the form:
   * **App name** and **Description**
   * **App admin**, the person who owns the connection in Opal
   * **Admin Key**
   * **Enterprise API Key**
   * **Org Admin Token** (optional)
   * **Visibility**, which controls who can see the connection in Opal
4. Save the connection.

Opal tests each key you enter. If Anthropic rejects one, Opal shows **Anthropic Admin API key is invalid** or **Claude Enterprise Analytics API key is invalid**. Replace the key and try again.

For the full connection walkthrough, see [Anthropic Platform](/integrations/anthropic).

## Sync agents from Anthropic

1. Go to **Inventory** > **Agents** and select **Sync from connectors**.
2. Choose your Anthropic connection.
3. Pick a tab:
   * **Active users** lists people Opal found in your Anthropic usage data. Opal loads this history in the background, and how far back it reaches depends on how far back Anthropic's usage history goes for your organization. If a person already owns an agent, syncing reuses and renames that agent instead of creating a duplicate. This tab needs an Enterprise API Key.
   * **API keys & accounts** lists your organization's API keys and service accounts. This tab needs an Admin Key. Listing service accounts also needs an Org Admin Token.
4. Select the candidates to import, then confirm.

If you have read-only access, a full admin has to complete the import.

After an import, the agents appear in [Agent Inventory](/docs/agent-inventory) with the source **Anthropic**.

## Add or change a key later

* **Admin Key and Org Admin Token:** Edit them on the connection's setup page.
* **Enterprise API Key:** Use the **Anthropic API keys** panel. It appears in the sync window when the **Active users** tab can't load because a key is missing or lacks a scope, and on the **Claude integrations** page. Paste the key into **Add another key**. Opal tests it against both scopes when you save it and uses it for whichever scope it has.

## Troubleshooting

| What you see | What it means | What to do |
| - | - | - |
| **No Anthropic API key stored** | The connection has no key. | Add an Admin Key, an Enterprise API Key, or both. |
| **Usage-based sync is unavailable for this connection** on the **Active users** tab | The connection has no Enterprise API Key. | Paste one into the key panel shown below the message. |
| **Missing required scopes** | The Enterprise API Key doesn't have the `read:analytics` scope. | Ask your Primary Owner to create a key with that scope, then add it. |
| **No Console admin key** on the **API keys & accounts** tab | Opal reads API keys and service accounts from Claude Console, so it needs an Admin Key. | Add an Admin Key on the connection's setup page. |
| Service accounts are missing or have no real names | The Org Admin Token is missing or has expired. | Generate a new token and paste it on the connection's setup page. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.