# Create an API key

> Create a key for your server or your AI agent, with only the permissions it needs. The secret is shown once.

Estimated time: 2 minutes.

## Before you start

- A Galon account with at least one project.

## Watch it (18 s, no sound)

Video (MP4, no sound): [create-an-api-key.mp4](/cloud/docs/guides/media/create-an-api-key.mp4) · subtitles: [create-an-api-key.en.vtt](/cloud/docs/guides/media/create-an-api-key.en.vtt)

Silent walkthrough: open API keys, click New key, name the key, choose Send emails, then Create key.

## 1. Open API keys

In the console, choose your project in the top left, then **API keys** in the left menu. The list shows each key's prefix, scopes, last use and expiry, never the secret.

![Galon Cloud console, API keys page of a test project: a table with three keys (name, masked prefix, scopes such as mail:send, created, last used, expires) and a New key button at the top right.](/cloud/docs/guides/media/create-an-api-key-1-list.webp)

*The API keys page. Prefixes are masked in this capture.*

## 2. Choose what the key can do

Click **New key**. Give it a name that says where it runs (for example `support-bot`), then pick **Send emails** (`mail:send`) for a server that only sends, or **Full access** (`full_access`) for one that also manages domains and suppressions. Set an expiry if the key is temporary.

![The New key panel: a Name field, three choices (Send emails with mail:send, Full access with full_access, Custom permissions), an Expiry menu set to No expiry, and the Cancel and Create key buttons.](/cloud/docs/guides/media/create-an-api-key-2-form.webp)

*Least privilege: a sending key cannot touch domains.*

## 3. Copy the secret once

Click **Create key**. The secret (`gln_live_…` or `gln_test_…`, after your project's environment) is shown once: store it in your secret manager or your server's environment. Galon keeps only a hash and cannot show it again.

**Your server's environment**

```bash
export GALON_API_BASE="https://api.galon.ai/v1"
export GALON_API_KEY="gln_..."      # from the console, shown once: never commit it
```

## 4. Replace or revoke

**Replace** issues a new secret and stops the old one at once: deploy the new one right away. **Revoke** stops a key for good. Both are in the key's row.

## Next

- [Send your first email with the API](/cloud/docs/guides/send-your-first-email)
- [Connect your AI coding agent (MCP)](/cloud/docs/guides/connect-your-ai-coding-agent)
- [API reference](/cloud/docs/api)
- [All guides](/cloud/docs/guides)
