> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getmodus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AuthenticationError

> The API key is missing, invalid, or expired (HTTP 401).

Check that `MODUS_API_KEY` is set correctly, or pass `apiKey` explicitly.
Create a token at app.getmodus.com → Settings → API Tokens.

```typescript
class AuthenticationError extends ModusError
```

## Constructor

```typescript
AuthenticationError(message: string, options?: { statusCode: number; requestId: string; responseHeaders: Record<string, string>; body: string; code: string } | undefined): AuthenticationError
```

### Parameters

<ResponseField name={"message"} type={"string"} required />

<ResponseField name={"options"} type={"{ statusCode: number; requestId: string; responseHeaders: Record<string, string…"} />

### Returns

`AuthenticationError`

## Properties

<ResponseField name={"body"} type={"string"} />

<ResponseField name={"code"} type={"string"} />

<ResponseField name={"requestId"} type={"string"} />

<ResponseField name={"responseHeaders"} type={"Record<string, string>"} />

<ResponseField name={"statusCode"} type={"number"} />
