# Authentication

> Docs index for AI agents: [https://mailvalid.io/llms.txt](https://mailvalid.io/llms.txt). Every docs page is also available as Markdown: add `.md` to its URL.

Every MailValid API request needs an API key. Send it in the `X-API-Key` header.

## Get your API key

1. **Create an account.** Sign up at [mailvalid.io/register](https://mailvalid.io/register). You get 100 free credits.
2. **Generate an API key.** Go to [Dashboard → API Keys](https://mailvalid.io/dashboard/api-keys) and click "Create New Key".
3. **Add the header to your requests.** Include `X-API-Key: mv_live_your_key_here` in every API request.

Live keys start with `mv_live_`. Keep them server-side and never ship them in browser or mobile code.

## Example request

```bash
curl -X POST https://mailvalid.io/api/v1/verify/single \
  -H "X-API-Key: mv_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"email": "test@example.com"}'
```

## Bearer tokens

The [MCP server](https://mailvalid.io/docs/mcp) also accepts the key as `Authorization: Bearer mv_live_...`.

## Keys for AI agents

An agent can self-register for an API key and hand the account to a human to claim. The flow is described in [auth.md](https://mailvalid.io/auth.md).

## Errors

A missing, invalid or revoked key returns `401 Unauthorized`. See [Errors](https://mailvalid.io/docs/errors).
