> ## Documentation Index
> Fetch the complete documentation index at: https://llm-tools.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAI

To use the OpenAI LLM models, you need a API key from OpenAI.
You can alternatively use Azure OpenAI to run most of the OpenAI LLMs. Read the [Azure OpenAI](/components/llms/azure-openai) section to learn more about this.

To get started, obtain an API Key from OpenAI. You can do this by visiting their [API Portal](https://platform.openai.com/api-keys).
Once you obtain a key, set it in an environment variable, like so -

```bash theme={null}
OPENAI_API_KEY="<Your key>"
```

## Install OpenAI addon

```bash theme={null}
npm install @llm-tools/embedjs-openai
```

## Usage

```ts theme={null}
import { RAGApplicationBuilder } from '@llm-tools/embedjs';
import { OpenAi } from '@llm-tools/embedjs-openai';

const app = await new RAGApplicationBuilder()
.setModel(new OpenAi({ model: "text-davinci-003" }))
```
