My API key isn’t working

When the API rejects a key, the response has an HTTP status and an error code that names the reason. Find the code in the tables below and apply the fix.

First checks

  • The header is exactly Authorization: Bearer followed by your key, with no quotes, line breaks or extra spaces.
  • You copied the whole key. Keys are long; a missing last character makes the key invalid.
  • You’re sending the request to https://app.syntic.ai/v1/chat/completions.
  • No old key is set in your environment that overrides the one you meant to use.

401 errors: the key itself

CodeMeaningFix
unauthenticatedNo key was sentAdd the Authorization header
invalid_api_keyThe key isn’t recognised or isn’t activeCheck for copy mistakes, or create a new key
revoked_api_keySomeone revoked the keyCreate a new key
expired_api_keyThe key passed its expiry dateCreate a new key
invalid_tokenA Syntic Code sign-in token failed or expiredSign in to Syntic Code again

403 errors: the key is valid but not allowed

CodeMeaningFix
public_key_rejectedYou sent a pk_live_ public keyUse a private sk_live_ key
origin_not_allowedThe key has an allowed-origins list and the request’s origin is missing or not on itCall from an allowed site, or use a key without an origin list for server calls
org_membership_requiredThe person who created the key is no longer an active member of the organizationCreate a new key under a current member
account_disabledThe account that owns the key is disabledContact your organization’s admin
org_unavailableThe key’s organization isn’t availableContact support@syntic.ai
plan_requiredThe organization is on the Free plan, or its billing isn’t activeUpgrade, or update the payment method
insufficient_scopeThe credential isn’t allowed to run model requestsUse a private key

It worked yesterday

Keys made in the Console don’t expire on their own. If a key stops working without being revoked, the usual reasons are:

  • The person who created it left the organization or was removed.
  • The plan lapsed or a renewal payment failed. After a failed payment there is a short grace period of 3 days before API access stops.
  • A teammate revoked it. Check whether it’s still listed on the API Keys page.

It’s not a key problem

A 402 or 429 means the key is fine but you’ve hit a limit:

Still stuck?

Email support@syntic.ai with the request ID from the x-syntic-request-id response header, the time, the status and error code. Don’t include the key. See Request IDs.

Was this page helpful?