> For the complete documentation index, see [llms.txt](https://docs.getmesa.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.getmesa.com/connect/dall-e-2.md).

# Dall-E 2

## Connection <a href="#connect" id="connect"></a>

When you're setting up your first workflow with Dall-E 2, you'll need to create an OpenAI API Key.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2Fh85jIEENrjHx5AiM73nw%2Fimage.png?alt=media&amp;token=1c4cd77f-088f-4ece-a17d-8f03197b4d6c" alt="Screenshot of the Dall-E 2 step in the MESA workflow builder. Spotlight the API Key connection field."><figcaption></figcaption></figure>

To create an API Key, go to this url: <https://platform.openai.com/account/api-keys>. Once there, click on the Create new secret key button.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2FYBlBt553rn8c4l6gd7yH%2FDW-dall-e-create-key.png?alt=media&amp;token=fb4a6bdb-2393-424f-86d4-0fd4dfcdd820" alt="Screenshot of the OpenAI API keys page. Spotlight the Create new secret key button."><figcaption></figcaption></figure>

Then, click on the copy button in the API key generated modal. Paste the copied values into MESA's Dall-E 2 Account Connections API Key field.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2Fr6IAPnPjCSg0o62mevwV%2Fdall-e-copy-key.png?alt=media&amp;token=285fbb4b-1f2f-4efc-aeda-9249d9f6e228" alt="Screenshot of the OpenAI generated API key modal. Spotlight the copy button."><figcaption></figcaption></figure>

Lastly, click on Add connection and then you are all set! MESA is now connected with Dall-E 2.

## Configure <a href="#configuring" id="configuring"></a>

#### Generated image expires after 1 hour <a href="#expiration" id="expiration"></a>

When using MESA's Dall-E 2 Generate Image action, you will need to keep in mind that all generated images will expire after one hour. Therefore, it is highly recommended to create workflows that use the generated image immediately after an automation runs. You should not store these images in a third party service because they will no longer work.

#### Best Usage <a href="#usage" id="usage"></a>

For the Prompt field, you will want to write a very detailed prompt. The more detailed the prompt is, the more likely you are going to get the result that you want.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2F9exYZHEy0O6WNOyzb0nS%2Fimage.png?alt=media&amp;token=1b1be643-f573-49e8-8ce1-d9632cafa9d0" alt="Screenshot of the Dall-E 2 Generate Image action in the MESA workflow builder. Spotlight the Prompt field."><figcaption></figcaption></figure>

#### Following OpenAI's Usage Policies <a href="#policy" id="policy"></a>

Please ensure that you follow OpenAI's Usage Policies when using MESA's Dall-E 2 integration: <https://openai.com/policies/usage-policies>

#### ShopPad's Recommendation <a href="#recommendation" id="recommendation"></a>

We recommend using OpenAI's [Dall-E website](https://labs.openai.com/) first when conducting a manual run with MESA's Generate Image action. This lets you test the prompt that you enter into the action.

## Technical Notes <a href="#data-security" id="data-security"></a>

### How Dall-E 2 Uses Your Data <a href="#data-security" id="data-security"></a>

The Dall-E 2 app makes API calls to OpenAI. Only the variables explicitly configured in the MESA builder will be shared with OpenAI. MESA does not store any of this information beyond your data retention date. OpenAI does not use data submitted to and generated by their API to train OpenAI models or improve OpenAI's service offering.

To opt out of any data sharing with AI models, simply do not use the Dall-E 2 step in any of your workflows.

[Learn more](https://help.openai.com/en/articles/5722486-how-your-data-is-used-to-improve-model-performance) about how and when OpenAI uses use to train their models. Read [MESA's Data Processing Agreement](https://www.getmesa.com/dpa).


---

# 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.getmesa.com/connect/dall-e-2.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.
