> For the complete documentation index, see [llms.txt](https://docs.uify.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uify.io/integrations/openai.md).

# OpenAI

With our new OpenAI integration, we allow you to unleash the power of AI in your day-to-day processed to auto-generate content, responses, tag data or extract structured data from text.

## Connecting to your MySQL Database

To connect your MySQL database, follow the steps below:

1. Go to **Data Management** and click on "**New source**" to create a new data source.&#x20;
2. Select **OpenAI** from the list of available data sources.
3. Name your data source connection and provide the connection details:

<table><thead><tr><th width="201">Setting</th><th>Description</th></tr></thead><tbody><tr><td><strong>API key</strong></td><td>Your unique API key to link your OpenAI account to your Uify apps. Your API key can be found <a href="https://platform.openai.com/account/api-keys">here</a>.</td></tr><tr><td><strong>Organization ID</strong></td><td>If your company has an account of their own, you can provide the org id to count requests towards the organization API quota instead of your account's quota.</td></tr></tbody></table>

4. Click on "**Test connection"** to ensure that your connection works reliably and save your data source connection with "**Connect**".

Note: You can configure the data source for two different environments, Staging and Production. You can find more information about it [here](broken://pages/FM88Izx8RDNtGtuF6cvH).&#x20;

## Action modes

Like any other integration, you can use the OpenAI integration by creating an OpenAI action in your  editor.

We support several modes from a highly customizable manual mode which allows you to specify all aspects of the model inference to use-case specific modes like the "Text to structured data" mode that only asks you for the most important inputs to handle the task out of the box. There is one subpage for each mode.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.uify.io/integrations/openai.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
