Skip to main content
If your API requests are failing with the HTTP status code 401 Unauthorized, it means the x-api-key header is either missing entirely or doesn’t match a valid API key on your account.

Sample Responses

Missing API key:
Invalid API key:

How to Resolve

  1. Check the header name and casing. The key must be sent in a header literally named x-api-key — not Authorization, api-key, or as a query parameter.
  2. Confirm the key itself is correct. Copy it fresh from your Dashboard rather than reusing a value from an old .env file or notes — a single missing character will trigger this error.
  3. Check for accidental whitespace or quotes. A trailing newline or wrapping quotes copied from a config file can silently break the header value.
  4. Make sure the key belongs to the right workspace. If you’re a member of multiple Teams & Workspaces, confirm you’re using a key generated in the workspace you intend to bill against.
API keys are generated automatically when you create your Geekflare account and shown on your Dashboard. There is currently no key rotation or multiple-key support — each account has a single active key.

Need Help?

If you’ve confirmed your key is correct and still see this error, contact support.