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

# OpenAI

## Overview

<CardGroup cols={3}>
  <Card title="Pre-built tooling" icon="screwdriver-wrench" href="#pre-built-tooling" />

  <Card title="Pre-built integrations" icon="square-check" href="#pre-built-integrations" />

  <Card title="Access requirements" icon="triangle-exclamation" href="#access-requirements" />

  <Card title="Setup guide" icon="rocket" href="#setup-guide" />

  <Card title="Useful links" icon="circle-info" href="#useful-links" />

  <Card title="API gotchas" icon="biohazard" href="#api-gotchas" />
</CardGroup>

## Pre-built tooling

<AccordionGroup>
  <Accordion title="✅ Authorization">
    | Tools                             | Status |
    | --------------------------------- | ------ |
    | Pre-built authorization (API Key) | ✅      |
    | Pre-built authorization UI        | ✅      |
    | Custom authorization UI           | ✅      |
    | End-user authorization guide      | ✅      |
    | Expired credentials detection     | ✅      |
  </Accordion>

  <Accordion title="✅ Read & write data">
    | Tools                                     | Status                         |
    | ----------------------------------------- | ------------------------------ |
    | Pre-built integrations                    | ✅                              |
    | API unification                           | ✅                              |
    | 2-way sync                                | ✅                              |
    | Webhooks from Nango on data modifications | ✅                              |
    | Real-time webhooks from 3rd-party API     | 🚫 (time to contribute: \<48h) |
    | Proxy requests                            | ✅                              |
  </Accordion>

  <Accordion title="✅ Observability & data quality">
    | Tools                   | Status |
    | ----------------------- | ------ |
    | HTTP request logging    | ✅      |
    | End-to-end type safety  | ✅      |
    | Data runtime validation | ✅      |
    | OpenTelemetry export    | ✅      |
    | Slack alerts on errors  | ✅      |
    | Integration status API  | ✅      |
  </Accordion>

  <Accordion title="✅ Customization">
    | Tools                              | Status                         |
    | ---------------------------------- | ------------------------------ |
    | Create or customize use-cases      | ✅                              |
    | Pre-configured pagination          | 🚫 (time to contribute: \<48h) |
    | Pre-configured rate-limit handling | 🚫 (time to contribute: \<48h) |
    | Per-customer configurations        | ✅                              |
  </Accordion>
</AccordionGroup>

### Others

| Function name              | Description                                                                                                             | Type                                           | Source code                                                                                                                     |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `add-vector-store-file`    | Attach a file to a vector store for indexing                                                                            | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/add-vector-store-file.ts)    |
| `cancel-fine-tuning-job`   | Cancel an OpenAI fine-tuning job.                                                                                       | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/cancel-fine-tuning-job.ts)   |
| `create-batch`             | Create a batch in OpenAI                                                                                                | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/create-batch.ts)             |
| `create-chat-completion`   | Create a Chat Completions API response for compatibility workflows                                                      | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/create-chat-completion.ts)   |
| `create-embedding`         | Create embeddings for text inputs.                                                                                      | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/create-embedding.ts)         |
| `create-file`              | Upload a file to OpenAI. Must be implemented as a proxy script, not an action, due to multipart/form-data requirements. | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/create-file.ts)              |
| `create-image`             | Generate an image from a prompt.                                                                                        | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/create-image.ts)             |
| `create-moderation`        | Classify whether text or images violate OpenAI usage policies                                                           | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/create-moderation.ts)        |
| `create-response`          | Create a model response with text, image, file, or tool inputs                                                          | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/create-response.ts)          |
| `create-speech`            | Generate speech audio from text.                                                                                        | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/create-speech.ts)            |
| `create-transcription`     | Transcribe audio to text. Use proxy script openai/proxy/transcribe-audio.ts for actual file uploads.                    | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/create-transcription.ts)     |
| `create-vector-store`      | Create a vector store in OpenAI                                                                                         | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/create-vector-store.ts)      |
| `delete-response`          | Delete a stored OpenAI response                                                                                         | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/delete-response.ts)          |
| `delete-vector-store-file` | Remove a file from a vector store (does not delete the underlying file object)                                          | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/delete-vector-store-file.ts) |
| `delete-vector-store`      | Delete a vector store from OpenAI                                                                                       | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/delete-vector-store.ts)      |
| `get-batch`                | Retrieve a single batch from OpenAI                                                                                     | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/get-batch.ts)                |
| `get-file`                 | Retrieve a single file metadata from OpenAI                                                                             | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/get-file.ts)                 |
| `get-model`                | Retrieve a single model from OpenAI.                                                                                    | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/get-model.ts)                |
| `get-response`             | Retrieve a stored OpenAI response by ID.                                                                                | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/get-response.ts)             |
| `get-vector-store-file`    | Retrieve a single file attached to a vector store.                                                                      | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/get-vector-store-file.ts)    |
| `get-vector-store`         | Retrieve a single vector store from OpenAI                                                                              | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/get-vector-store.ts)         |
| `list-batches`             | List batches from OpenAI                                                                                                | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/list-batches.ts)             |
| `list-files`               | List files from OpenAI                                                                                                  | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/list-files.ts)               |
| `list-fine-tuning-jobs`    | List fine-tuning jobs from OpenAI                                                                                       | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/list-fine-tuning-jobs.ts)    |
| `list-models`              | List all models available to the authenticated organization                                                             | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/list-models.ts)              |
| `list-vector-store-files`  | List files attached to a vector store                                                                                   | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/list-vector-store-files.ts)  |
| `list-vector-stores`       | List vector stores from OpenAI.                                                                                         | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/list-vector-stores.ts)       |
| `search-vector-store`      | Search a vector store for semantically matching content chunks                                                          | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/search-vector-store.ts)      |
| `update-vector-store`      | Update a vector store in OpenAI                                                                                         | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/actions/update-vector-store.ts)      |
| `batches`                  | Sync batches from OpenAI                                                                                                | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/syncs/batches.ts)                    |
| `files`                    | Sync files from OpenAI.                                                                                                 | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/syncs/files.ts)                      |
| `fine-tuning-jobs`         | Sync fine-tuning jobs from OpenAI                                                                                       | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/syncs/fine-tuning-jobs.ts)           |
| `models`                   | Sync models from OpenAI.                                                                                                | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/syncs/models.ts)                     |
| `vector-stores`            | Sync vector stores from OpenAI                                                                                          | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/openai/syncs/vector-stores.ts)              |

## Access requirements

| Pre-Requisites    | Status | Comment |
| ----------------- | ------ | ------- |
| Paid dev account  | ❓      |         |
| Paid test account | ❓      |         |
| Partnership       | ❓      |         |
| App review        | ❓      |         |
| Security audit    | ❓      |         |

## Setup guide

*No setup guide yet.*

<Tip>Need help getting started? Get help in the [community](https://nango.dev/slack).</Tip>

<Note>Contribute improvements to the setup guide by [editing this page](https://github.com/nangohq/nango/tree/master/docs/integrations/all/openai.mdx)</Note>

## Useful links

* [Generate an API key in your OpenAI account](https://platform.openai.com/api-keys)
* [OpenAI API docs](https://platform.openai.com/docs/api-reference/introduction)
* [OpenAI Authentication](https://platform.openai.com/docs/api-reference/authentication)
* [OpenAI rate limits](https://platform.openai.com/docs/guides/rate-limits)

<Note>Contribute useful links by [editing this page](https://github.com/nangohq/nango/tree/master/docs/integrations/all/openai.mdx)</Note>

## API gotchas

* OpenAI uses API\_KEY auth mode with `Authorization: Bearer API_KEY` in the request header to access different endpoints.
* Nango supports automatic retries based on the `x-ratelimit-reset-requests` header from OpenAI's API. This header indicates when the request limit will reset, allowing Nango to efficiently manage API calls. Unlike `x-ratelimit-reset-tokens`, which pertains to the total token usage,`x-ratelimit-reset-requests` specifically addresses the number of API requests.
* For users associated with multiple organizations or accessing their projects via a legacy user API key, optional headers can be included to specify the organization and project for the API request. Organization IDs can be found on your [Organization settings](https://platform.openai.com/account/organization) page, while project IDs can be found on your [General settings](https://platform.openai.com/settings) page.
* This can be done at the script level:

```js theme={null}
const config:ProxyConfiguration = {
    endpoint: '/v1/models',
    headers: {
        'OpenAI-Organization': $organizationId,
        'OpenAI-Project': $projectId
    }
};
```

<Note>Contribute API gotchas by [editing this page](https://github.com/nangohq/nango/tree/master/docs/integrations/all/openai.mdx)</Note>

## Going further

<Card title="Connect to Openai" icon="link" href="/integrations/all/openai/connect" horizontal>
  Guide to connect to Openai using Nango Connect.
</Card>
