When it fires
TheX-API-Key header is present but does not match the expected kash_(live|test)_<32 alphanumeric> shape.
Why it happens
- Leading or trailing whitespace, for example a trailing newline from a copy-paste.
- The wrong environment variable was substituted, such as a session token or a bare UUID instead of a Kash API key.
- A logging or proxy layer truncated the header value.
How to fix
- The format is
kash_<env>_<32 alphanumeric>: base62 (A-Z,a-z,0-9), with no dashes or underscores after the prefix. The<env>segment isliveortest. livekeys work against production (https://api.kash.bot/v1);testkeys work against staging (https://api-staging.kash.bot/v1). Don’t mix them.- If the key comes from an environment variable, check the substitution:
echo $KASH_API_KEY | head -c 16should printkash_live_…orkash_test_….
Related codes
API_KEY_MISSING— no header at allAPI_KEY_INVALID— well formed but unknown