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: Bearerfollowed 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
| Code | Meaning | Fix |
|---|---|---|
unauthenticated | No key was sent | Add the Authorization header |
invalid_api_key | The key isn’t recognised or isn’t active | Check for copy mistakes, or create a new key |
revoked_api_key | Someone revoked the key | Create a new key |
expired_api_key | The key passed its expiry date | Create a new key |
invalid_token | A Syntic Code sign-in token failed or expired | Sign in to Syntic Code again |
403 errors: the key is valid but not allowed
| Code | Meaning | Fix |
|---|---|---|
public_key_rejected | You sent a pk_live_ public key | Use a private sk_live_ key |
origin_not_allowed | The key has an allowed-origins list and the request’s origin is missing or not on it | Call from an allowed site, or use a key without an origin list for server calls |
org_membership_required | The person who created the key is no longer an active member of the organization | Create a new key under a current member |
account_disabled | The account that owns the key is disabled | Contact your organization’s admin |
org_unavailable | The key’s organization isn’t available | Contact support@syntic.ai |
plan_required | The organization is on the Free plan, or its billing isn’t active | Upgrade, or update the payment method |
insufficient_scope | The credential isn’t allowed to run model requests | Use 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:
402 quota_exhausted: see Fix a 402 error.429 rate_limited: see Fix a 429 error.
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.
Related
Was this page helpful?