---
sidebar_label: 'OpenAI'
---


import {PlatformSelector} from '@site/src/components/PlatformSelector/PlatformSelector';
import {PlatformSection} from '@site/src/components/PlatformSection/PlatformSection';

import ReactJs from './_005-open-ai/#react.mdx';
import JavaScript from './_005-open-ai/#js.mdx';

import InstallationJavaScript from './_005-open-ai/#js/installation.mdx';
import InstallationReactJs from './_005-open-ai/#react/installation.mdx';

import UsageJavaScript from './_005-open-ai/#js/usage.mdx';
import UsageReactJs from './_005-open-ai/#react/usage.mdx';

import ConfigJavaScript from './_005-open-ai/#js/config.mdx';
import ConfigReactJs from './_005-open-ai/#react/config.mdx';

import ConfigApiKeyJavaScript from './_005-open-ai/#js/config/apiKey.mdx';
import ConfigApiKeyReactJs from './_005-open-ai/#react/config/apiKey.mdx';

import ConfigModelJavaScript from './_005-open-ai/#js/config/model.mdx';
import ConfigModelReactJs from './_005-open-ai/#react/config/model.mdx';

import ConfigDataTransferModeJavaScript from './_005-open-ai/#js/config/dataTransferMode.mdx';
import ConfigDataTransferModeReactJs from './_005-open-ai/#react/config/dataTransferMode.mdx';

import ConfigSystemMessageJavaScript from './_005-open-ai/#js/config/systemMessage.mdx';
import ConfigSystemMessageReactJs from './_005-open-ai/#react/config/systemMessage.mdx';

# OpenAI

Connect to the OpenAI API directly from the browser, using an API key.

<PlatformSection reactJs={ReactJs} javascript={JavaScript}/>

---

## Installation

<PlatformSelector reactJs={InstallationReactJs} javascript={InstallationJavaScript}/>

---

## Usage

<PlatformSelector reactJs={UsageReactJs} javascript={UsageJavaScript}/>

---

## Configuration

<PlatformSelector reactJs={ConfigReactJs} javascript={ConfigJavaScript}/>

---

> ### API Key

<PlatformSelector reactJs={ConfigApiKeyReactJs} javascript={ConfigApiKeyJavaScript}/>

---

> ### Model

<PlatformSelector reactJs={ConfigModelReactJs} javascript={ConfigModelJavaScript}/>

---

> ### Data Transfer Mode

<PlatformSelector reactJs={ConfigDataTransferModeReactJs} javascript={ConfigDataTransferModeJavaScript}/>

---

> ### System Message

<PlatformSelector reactJs={ConfigSystemMessageReactJs} javascript={ConfigSystemMessageJavaScript}/>
