Sonny Labs Docs
Error codes

auth.token.invalid

A credential was supplied but failed signature, format, or expiry validation.

auth.token.invalid is returned at HTTP 401.

When this fires

The bearer token's signature could not be verified, its issuer / audience claims did not match, or its exp is in the past. Distinct from auth.unauthenticated (no credential at all) and from auth.api_key.expired (API key whose expires_at has passed).

What to do

Mint a fresh access token from your identity provider, or rotate the API key from the dashboard if you suspect it was tampered with. Branch on this code to trigger a re-auth UX rather than retrying with the same credential.

See also

  • SDK reference — the Python and TypeScript SDKs raise typed exceptions for codes in this namespace.
  • Error code index — every code the runtime can return.

On this page