> For the complete documentation index, see [llms.txt](https://imagine-art-ai-documentation.gitbook.io/dall-e-app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://imagine-art-ai-documentation.gitbook.io/dall-e-app/api-key.md).

# API Key

The app uses Open AI's API to generate images using Dall-E

### Get api key from Open AI

After you create an account in open ai, go to <https://platform.openai.com/overview> and click on **View API Keys.** Now create a new secret key and copy it.

<figure><img src="https://3686217603-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxsUAni25oGcVp41NhQbX%2Fuploads%2F7QP4VrzCSUv19MhI3pP4%2Fimage.png?alt=media&amp;token=87b1ec99-c372-491a-8cc2-ce5ca0f4cf37" alt=""><figcaption></figcaption></figure>

### Secure your api key

to prevent your api key from getting leaked, we will paste it in firebase so that no one can get it.

firest step go to your firebase dashboard -> firestore

create new collection named **api.** inside that collection, create new document called **key,** then add new field in that document, call it **key** and give it a value like this:

Bearer (Your api key)

<figure><img src="https://3686217603-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxsUAni25oGcVp41NhQbX%2Fuploads%2F6BFOI3cRYkcAfhoAp8m6%2Fimage.png?alt=media&amp;token=f50f7699-db2f-4782-9c9a-b4b710f5f007" alt=""><figcaption></figcaption></figure>
