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

# Get Credentials

> Step-by-step instructions for obtaining a Cloudflare API token for the Corsair Cloudflare plugin.

This guide walks you through obtaining credentials for the Cloudflare plugin.

## Authentication Method

The Cloudflare plugin uses API key authentication (Cloudflare **API tokens** sent as `Authorization: Bearer`).

* **[`api_key`](/concepts/api-key)** (default) — Cloudflare API token

## API Token

### Step 1: Create a token

1. Sign in to the [Cloudflare dashboard](https://dash.cloudflare.com).
2. Go to **My Profile** → **API Tokens** → **Create Token**.
3. Use a template or **Create Custom Token** with permissions for what you need (for example **Zone Read**, **DNS Read**, **Workers Scripts Read** on your account/zones).
4. Copy the token immediately — it is shown only once.

**Storing credentials:**

```bash theme={null}
pnpm corsair setup --plugin=cloudflare api_key=your-cloudflare-api-token
```

Or pass the token in plugin options:

```ts corsair.ts theme={null}
cloudflare({
	key: process.env.CLOUDFLARE_API_TOKEN,
})
```

Verify:

```bash theme={null}
pnpm corsair auth --plugin=cloudflare --credentials
```

## Required Credentials Summary

| Credential | Required for                        | Where to find                       |
| ---------- | ----------------------------------- | ----------------------------------- |
| API token  | [`api_key`](/concepts/api-key) auth | Dashboard → My Profile → API Tokens |

For general information about how Corsair handles authentication, see [Authentication](/concepts/auth).
