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

# Anthropic Admin

> Connect Serval to Anthropic's Admin API to manage your Anthropic organization's users, workspaces, and API keys, and to monitor Claude usage and spend.

## About Anthropic Admin

The Anthropic Admin integration connects Serval to Anthropic's Admin API so workflows can manage your Anthropic organization: invite and remove users, change organization roles, create and archive workspaces, manage workspace members, audit and disable API keys, and pull usage and cost reports for the Messages API and Claude Code. It is built for Claude-seat admins handling provisioning, off-boarding, key hygiene, and spend monitoring. It covers only the Admin API - calling Claude for message generation is not part of this integration, and regular `sk-ant-api03-` keys will not work.

**Authentication:** Admin API key - a single Anthropic Admin API key (starts with `sk-ant-admin01-`) pasted into the connect form. Serval stores it securely and attaches it to every request automatically; workflow code never sees the key.

**Data sync:** On demand only. There is no background sync and Serval keeps no copy of your Anthropic data - everything is fetched live from Anthropic at the moment a workflow runs.

## What the Anthropic Admin integration enables

| Capability                | Description                                                                                                                                                                                                                                                                                                                                   |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| User management           | 7 ready-to-install workflows: List Anthropic Users (pages through all organization users, with an optional exact-email filter), Get Anthropic User by Email, Invite Anthropic User, Update Anthropic User Role, Remove Anthropic User, List Anthropic Invites, and Revoke Anthropic Invite.                                                   |
| Workspace management      | 5 workflows: List Anthropic Workspaces (archived workspaces excluded unless requested), Create Anthropic Workspace, Archive Anthropic Workspace, Add User to Anthropic Workspace, and Remove User from Anthropic Workspace.                                                                                                                   |
| API key management        | 2 workflows: List Anthropic API Keys (optional status and workspace filters) and Disable Anthropic API Key (sets the key inactive, immediately revoking access).                                                                                                                                                                              |
| Usage and cost reporting  | 5 workflows: Get Anthropic Messages Usage (totals plus day-by-day buckets), Get Anthropic Claude Code Usage (per-actor sessions, commits, PRs, lines changed, and tokens for a single day), Get Anthropic Cost Report, Summarize Anthropic Usage (Last N Days), and Check Anthropic Spend Limit (compares spend against a budget you supply). |
| Custom Admin API requests | Custom workflows can reach the full modeled Admin API surface - users, invites, workspaces and members, API keys, and usage and cost reports - with authentication handled automatically.                                                                                                                                                     |

Anything in the integration's modeled surface of the [Anthropic Admin API](https://docs.claude.com/en/api/administration-api) can be accessed through Serval.

## Get your credentials

This integration requires an Anthropic Admin API key, which starts with `sk-ant-admin01-` and is a different credential from the regular `sk-ant-api03-` keys used to call Claude. Only Anthropic organization Admins can create one, in the Anthropic Console. See the [Anthropic Admin API reference](https://docs.claude.com/en/api/administration-api) for background.

<Steps>
  <Step title="Sign in to the Anthropic Console">
    Sign in at [console.anthropic.com](https://console.anthropic.com/) with an organization Admin account.
  </Step>

  <Step title="Open the Admin Keys page">
    Open Settings, then Admin Keys - or go straight to the [Admin Keys page](https://console.anthropic.com/settings/admin-keys).
  </Step>

  <Step title="Create an admin key">
    Click Create Admin Key and give it a descriptive name, for example Serval Production.
  </Step>

  <Step title="Copy the key immediately">
    The key starts with `sk-ant-admin01-` and is shown only once. Copy it right away and store it in your secret manager.
  </Step>
</Steps>

<Warning>
  The key is displayed a single time, at creation. If you navigate away without copying it, you will need to create a new one.
</Warning>

<Note>
  If you cannot see the Admin Keys page, you are not an organization Admin - ask an org Admin to create the key.
</Note>

## Connect in Serval

<Steps>
  <Step title="Open the Anthropic Admin integration">
    In Serval, open the **Anthropic Admin** integration and start a new connection.
  </Step>

  <Step title="Paste your admin key">
    Paste the full key into the **Admin API Key** field. It is a password field, so the value is hidden as you type. The helper text under the field reads: "Your Anthropic Admin API key (starts with sk-ant-admin01-). Generate one from the Anthropic Console under Settings → Admin Keys."
  </Step>

  <Step title="Submit the form">
    Click **Submit**. The form does not validate the key's format, so a wrong or empty key only surfaces after you submit - you may see "Failed to install integration", or the health check described below will fail.
  </Step>
</Steps>

<Warning>
  When you reopen the connection settings later, the saved key is shown masked - bullet characters plus its last 4 characters - and it cannot be typed over directly. Only save the settings when you are rotating the key. To rotate, select the pencil icon (or **Replace** button) next to the masked value, paste the complete new `sk-ant-admin01-` key, and save in the same edit. Never save while the key field is empty, and if you opened the settings without meaning to change the key, close them without saving.
</Warning>

## Verifying the connection

After you connect, Serval runs the **List Anthropic Organization Users** health check. It uses your stored admin key to list one user in your organization, confirming Serval can reach the Admin API on your behalf.

* On success you will see: "Successfully connected to the Anthropic Admin API"
* On failure you will see: "Unable to list Anthropic organization users. Please verify your admin API key is valid."

The most common cause of failure is pasting a regular `sk-ant-api03-` key instead of an admin key - create an admin key from the [Admin Keys page](https://console.anthropic.com/settings/admin-keys) and update the connection.

<Tip>
  If the health check is green but a workflow that makes changes (inviting users, archiving workspaces, disabling keys) appears stuck rather than failed, check your pending Serval approvals. Every mutating workflow in this integration defaults to installer approval and waits for sign-off before it runs; read-only workflows run without approval.
</Tip>

## Gotchas and troubleshooting

<AccordionGroup>
  <Accordion title="Admin key, not a regular API key">
    The Admin API requires a key starting with `sk-ant-admin01-`, created under Settings, then Admin Keys, in the Anthropic Console by an org Admin. Regular `sk-ant-api03-` inference keys will not work, and admin keys are only valid for Anthropic's organization-management endpoints. The health check fails immediately with a regular key.
  </Accordion>

  <Accordion title="Rotating the key: paste the complete new key before saving">
    On the edit screen the saved key appears masked - bullets plus its last 4 characters - and cannot be typed over directly. To rotate it, select the pencil icon (or **Replace** button) next to the masked value; this clears the field so you can paste the complete new `sk-ant-admin01-` key. Paste the full key and save in one step - do not save while the field is empty. If you change your mind mid-edit, use **Cancel** or close the settings without saving.
  </Accordion>

  <Accordion title="Cannot promote a user to admin via the API">
    Update Anthropic User Role supports the organization roles user, developer, billing, claude\_code\_user, and managed. Anthropic's Admin API does not allow promoting a user to admin - do that in the Anthropic Console.
  </Accordion>

  <Accordion title="Archiving a workspace is irreversible from the API">
    Archive Anthropic Workspace cannot be undone through the API, and archiving revokes the workspace's associated API keys. The shipped workflow defaults to installer approval for this reason.
  </Accordion>

  <Accordion title="Spend limit checks need a budget input">
    Anthropic's Admin API does not expose your configured spend limits. The Check Anthropic Spend Limit workflow takes the budget as a workflow input and compares month-to-date (or custom-period) cost against it, returning ok, approaching, or exceeded along with percent used, remaining budget, and a per-day breakdown.
  </Accordion>

  <Accordion title="Admin keys are highest-privilege credentials">
    An admin key can remove users, archive workspaces, and disable other API keys across your whole organization. Treat it as the most sensitive credential in your stack and rotate it regularly. Mutating workflows ship with installer approval as the default approval procedure; read-only workflows ship with no approval.
  </Accordion>

  <Accordion title="Inference is out of scope">
    Only the Admin API surface (organization, workspace, and API key management, plus usage and cost reporting) is covered. Calling Claude for message generation is handled elsewhere, not through this integration.
  </Accordion>

  <Accordion title="Claude Code usage report covers a single day">
    Get Anthropic Claude Code Usage fetches one UTC day at a time (YYYY-MM-DD). For ranges, use Get Anthropic Messages Usage, Get Anthropic Cost Report, or the Summarize Anthropic Usage (Last N Days) workflow.
  </Accordion>

  <Accordion title="The anthropic-version header is pinned">
    Every request Serval sends to Anthropic automatically carries the pinned API version `2023-06-01` alongside your key, and the key is only ever sent to `api.anthropic.com`. Workflow authors never set authentication headers themselves. See [Anthropic API versioning](https://docs.claude.com/en/api/versioning) for what the version controls.
  </Accordion>
</AccordionGroup>

***

Need help? Contact **[support@serval.com](mailto:support@serval.com)** for assistance with your Anthropic Admin integration.
