# 401: the key is missing or invalid

## The error

`401 Unauthenticated: Your API key is missing or invalid.`

## Checklist

1. Is `PINECONE_API_KEY` set in this process? Print its presence (never its value). Empty env is the most common cause in CI and containers.
2. Is the value current? If the key was rotated in the console, every deployment still holding the old value 401s at once.
3. Was it revoked? Check the console's key list. Revoked keys fail closed with no grace period.
4. Are you sending it at all? Direct REST calls need the `Api-Key` header; SDK clients set it from the constructor or env.

## Fix

Set a valid key in the environment and reconstruct the client. Do not retry with backoff: 401 never resolves on its own, and hammering it just burns logs.

## Trap

Catching 401 in a generic retry loop. The error-handling guide is explicit: do not retry client errors (4xx except 429). A retry loop on 401 is a busy loop that pages nobody.