> ## Documentation Index
> Fetch the complete documentation index at: https://docs.moderationapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AI app builders

> Add Moderation API to an app built with Lovable, v0, Bolt or Replit: where to put the API key, and a prompt to copy.

App builders write the code for you, so you add moderation with a prompt. You do two things yourself: store the API key as a secret, and paste the prompt.

## 1. Store the API key as a secret

Copy your project's API key from the [dashboard](https://dash.moderationapi.com). Store it as a secret named `MODAPI_SECRET_KEY`. Do not paste the key into the chat.

| Builder | Where to add the secret |
| - | - |
| Lovable | **Cloud → Secrets**. The key is available to Edge Functions only. |
| v0 | The **Vars** panel. Do not add the `NEXT_PUBLIC_` prefix. |
| Bolt | The **Secrets** section in the database settings. The key is available to server functions. |
| Replit | The **Secrets** tool. When you publish, add the key to the deployment secrets too. |

## 2. Paste the prompt

```text theme={"theme":"nord"}
Add content moderation with Moderation API to every place where users create
content (posts, comments, messages, profiles).

- Call it from server code only (an API route, server action, edge or server
  function), never from the browser. Read the key from the MODAPI_SECRET_KEY
  secret. Never put the key in client code.
- Send each piece of content before you save it:
  POST https://api.moderationapi.com/v1/moderate
  Authorization: Bearer <MODAPI_SECRET_KEY>
  Body: {"content": {"type": "text", "text": "<the text>"}, "authorId": "<user id>"}
- Read recommendation.action from the response:
  - "allow": save and publish.
  - "review": save it but do not publish it yet. A moderator decides.
  - "reject": do not save it. Show the user a short, neutral message.
  Treat any other value as "review".
- If the request fails, save and publish the content, so users are not blocked.

Docs: https://docs.moderationapi.com/llms.txt
```

## 3. Test it

Post a message that should be rejected, such as a scam or a threat, and check that your app blocks it. The request appears in the [dashboard](https://dash.moderationapi.com).

To act on decisions that moderators make later in the review queue, add [webhooks](https://docs.moderationapi.com/actions/webhooks.md).
