This error occurs when your request includes authentication credentials, but they are not formatted correctly. The Unkey API expects API keys to be provided in a specific format in the Authorization header.Common causes include:
Missing the “Bearer” prefix before your API key
Including extra spaces or characters
Using incorrect casing (e.g., “bearer” instead of “Bearer”)
Providing a malformed or truncated API key
Here’s an example of a request with incorrectly formatted credentials:
Copy
Ask AI
# Missing the "Bearer" prefixcurl -X POST https://api.unkey.com/v1/keys.listKeys \ -H "Content-Type: application/json" \ -H "Authorization: unkey_YOUR_API_KEY"