Skip to main content
err:unkey:authentication:malformed
The API found an Authorization header but couldn’t read a credential from it. The header must be Bearer, one space, and the token. You get HTTP 400.
Example response

Likely causes

  • The Bearer prefix is missing, or you used a different scheme such as Basic.
  • The token after the prefix is empty.
  • Whitespace, a newline, or quotes got in when the key was copied, or a client library added its own scheme.
  • A dashboard session token has expired or doesn’t validate. The message is Invalid bearer token.

How to fix

  1. Send the header as Authorization: Bearer unkey_xxx, with one space and no quotes.
  2. Check for stray whitespace or a newline, and for a client library that adds its own scheme.
  3. If you’re using a dashboard session token, sign in again.
Last modified on October 6, 2026