Mode: operator-assisted Last validated: 2026-04-24 UTC Validation method: read-only-docs Average duration: 4m Required role: ops
Applies to: ANTHROPIC_API_KEY (and any per-environment / per-workspace keys, e.g., ANTHROPIC_API_KEY_AGENTS, ANTHROPIC_API_KEY_DEV). Used by Raxx agent infrastructure, Claude Code SDK integrations, and any backend that calls api.anthropic.com.
https://platform.claude.com/ via SSO (operator)# Confirm current key works against the Messages API
curl -sS https://api.anthropic.com/v1/messages \
-H "x-api-key: $CURRENT_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
--data '{"model":"claude-haiku-4-5","max_tokens":10,"messages":[{"role":"user","content":"ping"}]}' \
| jq '.id'
# Expect: a message ID. Use a small/cheap model for the validation call.
Anthropic does not expose a programmatic rotation API. Console-only.
https://platform.claude.com/settings/keys.raxx-prod-rotation-2026-04-24).NEW_KEY="..."
curl -sS https://api.anthropic.com/v1/messages \
-H "x-api-key: $NEW_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
--data '{"model":"claude-haiku-4-5","max_tokens":10,"messages":[{"role":"user","content":"ping"}]}' \
| jq '.id'
# Expect: a message ID.
infisical secrets set ANTHROPIC_API_KEY="$NEW_KEY" \
--projectId="$INFISICAL_PROJECT_ID" --env=prod
| Consumer | How |
|---|---|
| Raptor (raxx-api-prod) | heroku config:set ANTHROPIC_API_KEY="$NEW_KEY" -a raxx-api-prod |
| Agent runtime / Claude Code SDK invocations | per its app's config-var path |
| GitHub Actions (if any agent jobs run in CI) | gh secret set ANTHROPIC_API_KEY -b "$NEW_KEY" |
| Operator local zshrc | DM via Slack D0AJ7K184TV |
# Hit a Raptor endpoint that calls Anthropic on the backend
curl -sS https://api.raxx.app/api/agents/health | jq '.anthropic'
# Expect: {"ok": true, ...}
heroku logs --tail -a raxx-api-prod | grep -iE 'anthropic|claude'
# Expect: no 401/403 from api.anthropic.com after dyno restart.
For agent jobs, run a small end-to-end agent invocation and confirm it completes.
https://platform.claude.com/settings/keys).Verify:
curl -sS -o /dev/null -w "%{http_code}\n" https://api.anthropic.com/v1/messages \
-H "x-api-key: $OLD_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
--data '{"model":"claude-haiku-4-5","max_tokens":10,"messages":[{"role":"user","content":"ping"}]}'
# Expect: 401
Anthropic notes: "When you revoke a key, it stops working immediately."
action: secret.rotate.completed
actor: <admin_id>
context: {
"secret_name": "ANTHROPIC_API_KEY",
"method": "operator-assisted-console",
"workspace": "<name or default>"
}
Until step 7, both old and new keys are valid. To roll back:
After step 7 (revoke), the old key is dead and unrecoverable. Generate a brand-new key.
x-api-key): https://platform.claude.com/docs/en/api/getting-startedx-api-key header, not Authorization: Bearer .... Different from most SaaS APIs.https://platform.claude.com/settings/limits).claude-haiku-4-5) and max_tokens: 10.