# OpenAI

Use the OpenAI node to automate work in OpenAI, and integrate OpenAI with other applications. Mosaic Workflows has built-in support for a wide range of OpenAI features, including creating images and assistants, as well as chatting with models.

On this page, you'll find a list of operations the OpenAI node supports and links to more resources.

Credentials
Refer to [OpenAI credentials](/guides/automated-workflows/integrations/builtin/credentials/openai) for guidance on setting up authentication.

## Operations

* Assistant
  * Create
  * Delete
  * List
  * Message
  * Update
* Text
  * Message a Model
  * Classify Text for Violations
* Image
  * Analyze
  * Generate
* Audio
  * Generate
  * Transcribe
  * Translate
* File
  * Delete
  * List
  * Upload


## Related resources

Refer to [OpenAI's assistants documentation](https://platform.openai.com/docs/assistants/how-it-works/objects) for more information about how assistants work.

For help dealing with rate limits, refer to [Handling rate limits](/guides/automated-workflows/integrations/builtin/rate-limits).

## What to do if your operation isn't supported

If this node doesn't support the operation you want to do, you can use the [HTTP Request node](/guides/automated-workflows/integrations/builtin/core-nodes/ts-wf-nodes-base.httprequest) to call the service's API.

You can use the credential you created for this service in the HTTP Request node:

1. In the HTTP Request node, select **Authentication** > **Predefined Credential Type**.
2. Select the service you want to connect to.
3. Select your credential.


## Using tools with OpenAI assistants

Some operations allow you to connect tools. [Tools](https://docs.ts-wf.io/advanced-ai/examples/understand-tools/) act like addons that your AI can use to access extra context or resources.

Select the **Tools** connector to browse the available tools and add them.

Once you add a tool connection, the OpenAI node becomes a root node, allowing it to form a cluster node with the tools sub-nodes. See [Node types](/guides/automated-workflows/integrations/builtin/node-types/#cluster-nodes) for more information on cluster nodes and root nodes.

### Operations that support tool connectors

* Assistant
  * Message Assistant
* Text
  * Message Model


## Using memory with OpenAI assistants

For the  **Message Assistant** operation, you can connect a memory sub-node to preserve and retrieve chat history. The assistant uses this to maintain context across multiple messages. The connected memory sub-node is the source of truth for the assistant's memory.

To do this, Mosaic Workflows uses OpenAI's [threads](https://platform.openai.com/docs/assistants/how-it-works/managing-threads-and-messages). Mosaic Workflows creates a new thread on each time the node executes, and pre-populates it with messages from the memory sub-node. After the run finishes, Mosaic Workflows updates the memory sub-node with the new messages, and deletes the thread from OpenAI.