# The API key has ended

The key_expired error: why it happens and how to fix it.

Code: `key_expired`. Status: `401`.

## Why it happens

This key had an end date and it has passed.

## How to fix it

Make a new key in Settings, then API and MCP.

## What the answer looks like

```json title="Example answer"
{
  "error": {
    "code": "key_expired",
    "message": "A short message about this call.",
    "docs": "https://usetotems.com/docs/errors/key_expired"
  },
  "request_id": "req_..."
}
```

The answer can also have `field` and `help`. See [all error codes](/docs/api/errors).
