# Create and replace API keys

Create one key per agent, copy it while it is visible, and replace or revoke it safely if access needs to change.

Source: https://muse4ai.lovable.app/docs/api-keys · Updated 2026-11-02

## Before you start

- Choose a clear name for the agent that will use the key.
- Treat a key like a password. Do not put it in screenshots, public messages, or URLs.

## 1. Create a named key

Open Settings › API & agent and create a key. Name it after the agent. Choose Create and cancel for generation, or Status only for monitoring.

## 2. Copy it once

Copy the full key before closing the dialog; you cannot reveal it again. Paste it only into the intended agent’s protected configuration.

```http
Authorization: Bearer msk_YOUR_KEY
```

## 3. Replace and revoke safely

To rotate a key, create a replacement, update the agent, test access, then revoke the old key. If a key was exposed, revoke it immediately. Revoking a key stops future authenticated access with it.

## Check it worked

Each agent has a separately named key with the access it needs, and obsolete keys are revoked.

## If it doesn't work

### I closed the dialog without copying.

Revoke that key and create another. The app does not reveal the original key again.

### Status works but generation fails.

Check the key’s scope. A Status only key cannot create or cancel jobs.
