Skip to main content
err:unkey:authentication:credential_rejected
The refresh token for a CLI session was not accepted. You get HTTP 401.
Example response

Likely causes

  • The refresh token was already exchanged for a new one, and the 10 second retry window has passed. Reusing it after that, or reusing any older refresh token from the same session, revokes the session.
  • The CLI session expired or was revoked from the dashboard. A session expires after 7 days without a refresh, and 30 days after login even when it is used every day.
  • The token was copied incompletely, or it belongs to a different API.

How to fix

  1. Run unkey login and approve the new code.
  2. A retry of the refresh token you just exchanged still works for 10 seconds and does not revoke the session. After that, log in again.
  3. Confirm UNKEY_API_URL points at the API that issued the session.
Last modified on October 26, 2026