Skip to main content
err:frontline:client:invalid_key
The API you called runs on Unkey, and it checks API keys. You sent a key, but it isn’t valid for this API. You get 401 Unauthorized, and the message is the same whatever the reason.
Example response
Browsers get the same error as an HTML page.

If you’re calling an API hosted on Unkey

Check that you’re sending the whole key, with no extra whitespace or quotes, and that it’s the key for this API rather than another service. If the key used to work, the API owner may have disabled, expired, rolled, or deleted it. Only they can tell you which, so contact them with the request ID.

If you own this API

The gateway returns this code for any key that isn’t valid for this API, unless another code fits better (missing permissions, rate limited, or out of credits). Common causes:
  • The key doesn’t exist or was deleted.
  • The key is disabled or expired.
  • The key is from a keyspace your key-auth policy doesn’t list.
  • The workspace that owns the key is disabled.

How to fix

  1. Look the key up in the dashboard or with keys.getKey. Check that it’s enabled, not expired, and in a keyspace the policy accepts.
  2. If callers hold keys from a keyspace you added recently, add that keyspace to the policy and create a new deployment. Policy changes only apply to deployments created after the change.
  3. If the key looks fine, check whether the workspace that owns it is disabled.
Last modified on October 30, 2026