> ## Documentation Index
> Fetch the complete documentation index at: https://magic-book.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAI

> Connect OpenAI for writing, pictures and the free safety check.

OpenAI covers three jobs in MagicBook:

* **Writing**: GPT models for planning, writing and editing text.
* **Pictures**: GPT Image models for pages, covers and character sheets.
* **Safety**: the moderation model that checks text and images for every audience. It is free to call.

## Get a key

Create a key at [platform.openai.com/api-keys](https://platform.openai.com/api-keys). Copy it when it is shown, because OpenAI does not show it again.

## Add it to MagicBook

**1. Open AI Providers**

Go to **AI → AI Providers** and find the **OpenAI** card.

**2. Save and test**

Press **Add key**, paste the key and press **Save and test**.

**3. Enable the models**

Enable the models you want on [Text models](https://magic-book.mintlify.site/admin/text-models.md) and [Image models](https://magic-book.mintlify.site/admin/image-models.md).

Save an OpenAI key even if you use other providers for writing. Without it, the safety check cannot run, and children's and teen books cannot be generated. See [Safety](https://magic-book.mintlify.site/admin/safety.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.