Authentication
err:unkey:authentication:missing
Authentication credentials were not provided in the request
Example
What Happened?
This error occurs when you make a request to the Unkey API without including your API key in the Authorization header. The Unkey API requires authentication for most endpoints to verify your identity and permissions.
Here’s an example of a request that would trigger this error:
Authentication is required to:
- Verify your identity
- Ensure you have permission to perform the requested operation
- Track usage and apply appropriate rate limits
- Maintain security and audit trails
How To Fix
To fix this error, you need to include your Unkey API key in the Authorization header of your request:
- Get your Unkey API key: Obtain your API key from the Unkey dashboard
- Add the Authorization header: Include your Unkey API key with the format
Bearer unkey_YOUR_API_KEY
Here’s the corrected request:
When properly authenticated, you’ll receive a successful response like this:
Common Mistakes
- Missing the
Bearer
prefix: Unkey requires the formatBearer unkey_YOUR_API_KEY
with a space after “Bearer” - Headers lost in proxies: Some proxy servers or API gateways might strip custom headers
- Expired or revoked keys: Using keys that are no longer valid
- Wrong environment: Using development keys in production or vice versa
Related Errors
- err:unkey:authentication:malformed - When the API key is provided but formatted incorrectly
- err:unkey:authentication:key_not_found - When the provided API key doesn’t exist