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

# NarevApiError

[**@ai-billing/narev**](https://www.narev.ai/docs/ai-billing/reference/narev/typedoc/index.md)

***

[@ai-billing/narev](https://www.narev.ai/docs/ai-billing/reference/narev/typedoc/index.md) / NarevApiError

# Class: NarevApiError

Defined in: [packages/narev/src/narev-client.ts:47](https://github.com/narevai/ai-billing/blob/main/packages/narev/src/narev-client.ts#L47)

Error thrown when the Narev API returns a non-2xx response.

## Extends

* `Error`

## Constructors

### Constructor

> **new NarevApiError**(`message`, `status`, `body?`): `NarevApiError`

Defined in: [packages/narev/src/narev-client.ts:48](https://github.com/narevai/ai-billing/blob/main/packages/narev/src/narev-client.ts#L48)

#### Parameters

##### message

`string`

##### status

`number`

HTTP status code returned by the API.

##### body?

`unknown`

Raw response body, if parsing succeeded.

#### Returns

`NarevApiError`

#### Overrides

`Error.constructor`

## Properties

### status

> **status**: `number`

Defined in: [packages/narev/src/narev-client.ts:51](https://github.com/narevai/ai-billing/blob/main/packages/narev/src/narev-client.ts#L51)

HTTP status code returned by the API.

***

### body?

> `optional` **body?**: `unknown`

Defined in: [packages/narev/src/narev-client.ts:53](https://github.com/narevai/ai-billing/blob/main/packages/narev/src/narev-client.ts#L53)

Raw response body, if parsing succeeded.

***

### cause?

> `optional` **cause?**: `unknown`

Defined in: node\_modules/.pnpm/typescript\@5.9.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:26

#### Inherited from

`Error.cause`

***

### name

> **name**: `string`

Defined in: node\_modules/.pnpm/typescript\@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1076

#### Inherited from

`Error.name`

***

### message

> **message**: `string`

Defined in: node\_modules/.pnpm/typescript\@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1077

#### Inherited from

`Error.message`

***

### stack?

> `optional` **stack?**: `string`

Defined in: node\_modules/.pnpm/typescript\@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1078

#### Inherited from

`Error.stack`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.