Prerequisites
- A running Agent Vault instance.
- Claude Code logged in on a machine where you have access to
~/.claude/.credentials.json. - An agent token from Agent Vault with proxy role on a vault.
1. Get the tokens
On the machine where Claude Code is already logged in, view the credentials file:accessToken and refreshToken values from this file.
2. Create the OAuth credential
In the Agent Vault dashboard, go to your vault’s Credentials tab and click Add credential.- Switch to OAuth then Paste tokens
- Fill in:
| Field | Value |
|---|---|
| Credential Key | ANTHROPIC |
| Token URL | https://console.anthropic.com/v1/oauth/token |
| Client ID | 9d1c250a-e61b-44d9-88ed-5944d1962f5e |
| Auth Method | None |
| Access Token | (paste accessToken from step 1) |
| Refresh Token | (paste refreshToken from step 1) |
9d1c250a-e61b-44d9-88ed-5944d1962f5e is Anthropic’s public OAuth client ID used by Claude Code. It is a public client (no client secret), which is why Auth Method is set to None.
- Click Add. The refresh token is validated immediately against Anthropic’s token endpoint. If validation fails, check that the Client ID and Token URL are correct.
3. Create the services
Claude Code communicates with three Anthropic hosts. All three need a service pointing to the sameANTHROPIC credential.
In the Services tab, add:
| Name | Host | Auth Type | Token Key |
|---|---|---|---|
anthropic-api | api.anthropic.com | Bearer | ANTHROPIC |
claude-platform | platform.claude.com | Bearer | ANTHROPIC |
claude-mcp | mcp-proxy.anthropic.com | Bearer | ANTHROPIC |
api.anthropic.comhandles the main API (chat, models, settings).platform.claude.comhandles OAuth validation and token refresh.mcp-proxy.anthropic.comhandles cloud MCP connectors (Slack, Gmail, Linear, etc.).
Using a proposal instead
Using a proposal instead
If you already have another agent connected to Agent Vault (e.g., using a different LLM provider or an API key), that agent can propose all three services and the OAuth credential in a single proposal:You approve the proposal and paste your tokens on the approval page.
4. Set up the agent machine
On the machine where the agent will run, create a placeholder credentials file so Claude Code skips the login screen:scopes, subscriptionType, and rateLimitTier values to match your source machine’s ~/.claude/.credentials.json.
You also need the .claude.json onboarding file from the source machine. Copy it to ~/.claude.json on the agent machine. This file contains hasCompletedOnboarding: true and cached config that Claude Code needs to skip the initial setup flow.
5. Run Claude Code
api.anthropic.com, platform.claude.com, and mcp-proxy.anthropic.com, replaces __PLACEHOLDER__ with the real token from Agent Vault, and forwards to the upstream.
How refresh works
When the access token nears expiry (within 5 minutes), the proxy automatically refreshes it by calling Anthropic’s token endpoint with the stored refresh token. The new access token and expiry are stored. Agents never see a token expiry or need to re-authenticate. If the refresh token itself is revoked (e.g., you deauthorize the app on Anthropic’s side), proxied requests return502 oauth_refresh_failed. Re-upload fresh tokens from a new claude login session.
Verify
Confirm the placeholder is still on the agent machine:status: 200 and matched_service: anthropic-api.
