> For the complete documentation index, see [llms.txt](https://imagine-art-ai-documentation.gitbook.io/ai-art-creator/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/ai-art-creator/get-api-key.md).

# Get API key

In order to generate art from text we need an AI model called Stable Diffusion.

## Get the token from replicate

Please go to this website: <https://replicate.com/stability-ai/stable-diffusion>, and click on **Run With Api.** It will ask you to login with **Github**, so just do it.

After you create an account using **Github**, please head to your account page and copy the TOKEN given to you from here <https://replicate.com/stability-ai/stable-diffusion>

<figure><img src="https://4214970270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FScUfnw1ATD07xR1Ofew2%2Fuploads%2FdzDtdSp1jzfKAtHGyzEs%2FScreen%20Shot%202022-10-08%20at%2015.34.29.png?alt=media&amp;token=f84d3442-843f-478f-8cd8-871913597210" alt=""><figcaption></figcaption></figure>

## Secure you 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:

Token (Your api key)

<figure><img src="https://4214970270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FScUfnw1ATD07xR1Ofew2%2Fuploads%2F1C91VEPGTpizO3Ijq2gz%2FScreen%20Shot%202022-11-19%20at%2015.38.48.png?alt=media&amp;token=b2253a05-4a1b-4bae-b037-9ed748fcfcc3" alt=""><figcaption></figcaption></figure>
