Skip to content

ccswitch refresh

ccswitch refresh <name> [--token <token>]

Replaces a bedrock-key profile’s bearer token and re-derives its expiry, without recreating the profile. Reads the new token from --token or the AWS_BEARER_TOKEN_BEDROCK environment variable.

Use this when a short-lived Bedrock token has expired or is about to expire.

refresh only applies to bedrock-key. To replace an api-key or custom profile’s credential, re-run ccswitch add --force with the same profile name.

Option Description
--token <token> The new bearer token (otherwise reads $AWS_BEARER_TOKEN_BEDROCK)
Terminal window
# Re-export a fresh token, then refresh
export AWS_BEARER_TOKEN_BEDROCK=bedrock-api-key-...
ccswitch refresh bedrock-prod
# Or pass it directly
ccswitch refresh bedrock-prod --token bedrock-api-key-...

This site uses GoatCounterfor page counts — no cookies, no personal data, no tracking across sites.