> ## 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.

# FetchStripeUsage

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

***

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

# Function: fetchStripeUsage()

> **fetchStripeUsage**(`_request`): `Promise`\<[`StripeUsageData`](https://www.narev.ai/docs/ai-billing/reference/nextjs/typedoc/server/interfaces/StripeUsageData)>

Defined in: [packages/nextjs/src/stripe/fetchStripeUsage.ts:9](https://github.com/narevai/ai-billing/blob/main/packages/nextjs/src/stripe/fetchStripeUsage.ts#L9)

Fetches usage data for a given customer. (Mocked implementation)

## Parameters

### \_request

User identifier — either `{ userId }` or `{ stripeCustomerId }`.

#### stripeCustomerId?

`string`

#### userId?

`string`

## Returns

`Promise`\<[`StripeUsageData`](https://www.narev.ai/docs/ai-billing/reference/nextjs/typedoc/server/interfaces/StripeUsageData)>


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