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

# OpenAI integration

{% hint style="info" %}
If you’re new to integrations in Rewst, read through our introductory integration documentation [here](https://docs.rewst.help/documentation/integrations).
{% endhint %}

## What does the OpenAI integration do?

Our OpenAI integration enables the automation of AI-powered tasks. By leveraging the OpenAI API, Rewst.io can tap into advanced natural language processing (NLP) models and AI capabilities provided by OpenAI. This integration allows Rewst.io to offer intelligent text analysis, generation, and understanding, enabling users to interact with the application in more intuitive and efficient ways.

## Set up the OpenAI integration

### Set up steps in OpenAI

1. Log in to OpenAI.
2. Navigate to the API Keys page.
3. Create a new secret key for Rewst to use.

### Set up steps in Rewst

1. Navigate to **Marketplace > Integrations** in the left side menu of your Rewst platform.
2. Search for `OpenAI` in the integrations page.\ <br>

   <div align="left"><figure><img src="https://1835401289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAQQ1EHVcEsGKBPVHmiav%2Fuploads%2FsZi3WdjPVPuU0DCDoPtK%2FScreenshot%202026-02-09%20at%2010.22.06%E2%80%AFAM.png?alt=media&amp;token=6eaaa8df-1b44-4333-8d17-c048a34bd342" alt="" width="166"><figcaption></figcaption></figure></div>
3. Click on the integration tile to launch the configuration setup page.
4. Enter the API key copied from OpenAI into the relevant field.
5. If you are using the integration in conjunction with Azure, see our separate documentation for those steps to find the **Azure API Version** field value [here](/documentation/integrations/integration-guides/openai/azure-openai-integration-setup.md). If you aren't using Azure with OpenAI, leave the **Use Azure OpenAI** set to **False**.
6. Optionally, if you belong to multiple organizations, you can specify the **OpenAI Organization ID** to use.
7. Click **Save Configuration**.

{% hint style="success" %}
Got an idea for a new Integration? Rewst is constantly adding new integrations to our integrations page. Submit your idea or upvote existing ideas here in our [Canny feedback collector](https://rewst.canny.io/integrations).
{% endhint %}

## Actions and endpoints

{% hint style="info" %}
For more on how actions work in Rewst, check out our [introductory actions documentation here](https://docs.rewst.help/documentation/workflows/actions-in-rewst).
{% endhint %}

OpenAI's own API documentation can be found [here](https://platform.openai.com/docs/api-reference/introduction).

| Category             | Action                 | Description                                                                                                             |
| -------------------- | ---------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| **Chat Completions** | Create Chat Completion | Given a chat conversation, the model will return a chat completion response.                                            |
| **Completions**      | Create Completion      | Creates a completion for the provided prompt and parameters                                                             |
| **Edits**            | Create Edit            | Creates a new edit for the provided input, instruction, and parameters.                                                 |
| **Generic Request**  | OpenAI API Request     | Generic action for making authenticated requests against the OpenAI API                                                 |
| **Images**           | Create Image           | Creates an image given a prompt (Beta).                                                                                 |
| **Models**           | List Models            | Lists the currently available models, and provides basic information about each one such as the owner and availability. |
| **Models**           | Get Model              | Retrieves a model instance, providing basic information about the model such as the owner and permissioning.            |
| **Moderations**      | Create Moderation      | Given a input text, outputs if the model classifies it as violating OpenAI's content policy.                            |


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rewst.help/documentation/integrations/integration-guides/openai/openai-integration-setup.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
