# Connect with an API key

> For scripts, automations and your own agents.

Some tools can’t open a sign-in window: scripts, automation platforms, your own agents, or a Claude organization that uses request headers. For those, send an API key with each request instead.

### Create a key for the AI

Under **Developers**, [create an API key](https://morzepay.com/docs/api/keys) with only the permissions the AI needs, for example:

- `invoices:read` and `invoices:write` for invoices and receipts

- `checkout:read` and `checkout:write` for payment links

- `transactions:read` to look up payments and receipts

- `wallets:read` to list wallets

A test key (`mp_test_…`) uses your test data, and a live key uses live data.

### Send it with each request

Request

```http
POST https://morzepay.com/mcp
Authorization: Bearer mp_live_3f9a1c0b2e7d_9b1c...
```

In tools that read an MCP config file:

mcp.json

```json
{
  "mcpServers": {
    "morzepay": {
      "url": "https://morzepay.com/mcp",
      "headers": {
        "Authorization": "Bearer mp_test_..."
      }
    }
  }
}
```

Keep the key secret: anyone who has it can use those permissions. Don’t paste it into a chat, and don’t commit config files that contain it.
