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

# CreateOpenAIWithBilling

[**@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) / createOpenAIWithBilling

# Function: createOpenAIWithBilling()

> **createOpenAIWithBilling**(`modelId`): `LanguageModel`

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

Returns an OpenAI language model wrapped with Narev pricing and Polar billing.

## Parameters

### modelId

`string`

The OpenAI model ID (e.g. `"gpt-4o"`).

## Returns

`LanguageModel`


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