# DALL-E 2&3

* **Image Generation API:**

  This API allows you to generate images from textual descriptions using the Dall-e 2&3 model.
* **Try it out**

  Get your API key at the following site: <https://airight.io/api-key>
* **How to use**
  * Please call the following endpoint with a `POST` request: <https://developers.airight.io/nft-market-backend-service/sdk/models/dall-e>
  * The headers of the request must include an API key in the `x-api-key` field. The body of the request must be `multipart/form-data`, and the `accept` header should be set `application/json`
* **Parameters:**
  * *<mark style="color:blue;">**callback**</mark>* <mark style="color:red;">string</mark> Required

    An api url that we can call by POST method to return the result after the image is generated.
  * *<mark style="color:blue;">**modelId**</mark>* <mark style="color:red;">integer</mark> Required Its value is *`70`*

    The Model ID is what we use to set default values for optional parameters.
  * *<mark style="color:blue;">**prompt**</mark>* *<mark style="color:red;">string</mark>* Required

    A textual description of the desired image. More specific and detailed prompts yield better results.
  * *<mark style="color:blue;">**model**</mark>* *<mark style="color:red;">string</mark> Optional Defaults to `dall-e-2`*

    The model to use for image generation. Must be one of **`dall-e-2`***,* **`dall-e-3`**
  * *<mark style="color:blue;">**quality**</mark>* <mark style="color:red;">string</mark> Optional Defaults to *`standard`*

    The quality of the image that will be generated. **`hd`** creates images with finer details and greater consistency across the image. This param is only supported for **`dall-e-3`**.
  * *<mark style="color:blue;">**style**</mark>* *<mark style="color:red;">string</mark> Optional Defaults to* `vivid`

    The style of the generated images. Must be one of **`vivid`** or **`natural`**. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for **`dall-e-3`**.
  * *<mark style="color:blue;">**size**</mark>* *<mark style="color:red;">string</mark> Optional Defaults to `1024x1024`*

    The size of the generated images. Must be one of **`256x256`**, **`512x512`**, or **`1024x1024`** for **`dall-e-2`**. Must be one of **`1024x1024`**, **`1792x1024`**, or **`1024x1792`** for **`dall-e-3`** models.
* **Response:**

  The API returns the job ID which you can get the result by calling the api [https://developers.airight.io/nft-market-backend-service/sdk/art/{id}](https://developers.airight.io/nft-market-backend-service/sdk/art/%7Bid%7D) if we are unable to call the callback url to send you the response.
