# `AI_APICallError: 401 invalid_api_key — Incorrect or revoked Tokentide API key`

**Where it appears:** Terminal or Vercel runtime logs

**What it means:** Tokentide rejected `TOKENTIDE_API_KEY` because the key is incomplete, revoked, or missing its `tt_live_` prefix.

## Likely causes

- The key pasted into `.env.local` or Vercel was cut off or includes extra quotes/spaces.
- The key was revoked on tokentide.app/app/keys and the environment still holds the old one.

## Message for your agent

```text
AI calls return `401 invalid_api_key`. Ensure our AI helper falls back to the Vercel AI Gateway and logs an alert on 401, and run the read-only Tokentide check after I update my key in `.env.local` and Vercel.
```

**Prevention:** Save new `tt_live_` keys in your password manager when created, and test with the read-only `tokentide.py check` script.

---
Source: [Agentic Makers](https://agenticmakers.app/en/help/errors/tokentide-401-invalid-api-key) · License: CC BY 4.0
