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

# API tokens

> Create API tokens in the console for the console API and the PerfGrid MCP server, choose their permissions, and revoke them.

**API tokens** let scripts and AI assistants work with one billing account, with your permissions. A token works with the console API at `https://console.perfgrid.com/api/v1` and the PerfGrid MCP server at `https://console.perfgrid.com/mcp`.

To create tokens you need the **Manage API tokens** permission (owners, administrators and technical members have it), and [two-factor authentication](https://perfgrid.com/docs/console/security/two-factor-authentication.md) or a [passkey](https://perfgrid.com/docs/console/security/passkeys.md) on your login. Until then, **New token** is greyed out. Your tokens need it too: while your login has neither, every call with them is refused, and they work again once you turn 2FA back on.

> [!NOTE]
>
> This is not the Grid Hosting panel API at hosting-panel.net, which has its own tokens. See [Grid Hosting API tokens](https://perfgrid.com/docs/grid-hosting/profile/api-tokens.md).

## Create a token

**1. Open API tokens**

In the sidebar, open **More** and click **API tokens**. Confirm your password if the console asks.

**2. Start a new token**

Click **New token**.

![API tokens page with the New token button and three tokens, each with its permissions and expiry](https://mintcdn.com/perfgrid/rir3QY8n0k7qdkOi/images/console/api/api-tokens-list.png?fit=max\&auto=format\&n=rir3QY8n0k7qdkOi\&q=85\&s=8eb7cd1de84c01daa6b6982ea8a210ed)

**3. Fill in the dialog**

Give the token a **Name** that says what uses it and tick its **Permissions**. Choose when it **Expires** and, if you like, the **Allowed addresses** it may be used from: IP addresses or ranges, one per line or separated by commas or spaces, or empty for any address. Click **Create token**.

![New API token dialog with Name, Permissions, Expires and Allowed addresses](https://mintcdn.com/perfgrid/rir3QY8n0k7qdkOi/images/console/api/api-tokens-new.png?fit=max\&auto=format\&n=rir3QY8n0k7qdkOi\&q=85\&s=089d7947ecd26de6a8c39d5baca82db4)

**4. Copy the token**

Copy the token, which starts with `pgapi_`, store it somewhere safe and click **Done**.

![Token created dialog showing the new token with a copy button](https://mintcdn.com/perfgrid/rir3QY8n0k7qdkOi/images/console/api/api-tokens-created.png?fit=max\&auto=format\&n=rir3QY8n0k7qdkOi\&q=85\&s=0e23280246e4113b1472de95db95f19b)

> [!WARNING]
>
> The token is shown only once. Treat it like a password: if it leaks, revoke it and create a new one.

## What a token can do

A token can only do what you can do yourself, and only what you ticked. If your own permissions are reduced, or you leave the billing account, the token loses them too. Each permission works on its own: **Pay invoices** doesn't let a token list invoices without **View invoices**.

What each permission gives access to is listed under [Abilities](https://perfgrid.com/docs/api-reference/console/introduction.md#abilities) in the API reference. Members, payment methods, API tokens, the affiliate programme, ordering new services and closing tickets stay in the console.

## Revoke a token

Click **Revoke** next to the token and confirm. Anything that uses it stops working at once. Members with **Manage users** see and can revoke every token of the billing account; others see their own.

You can't change a token's permissions or expiry afterwards: create a new one and revoke the old one. We email you 7 days before a token expires.

## Use the API

Send the token in the `Authorization` header:

```bash theme={null}
curl https://console.perfgrid.com/api/v1/me \
  -H "Authorization: Bearer pgapi_..."
```

Each token may make 120 requests a minute, of which 30 may change something. Every endpoint is in the [API reference](https://perfgrid.com/docs/api-reference/console/introduction.md).

## Connect an AI assistant (MCP)

Add `https://console.perfgrid.com/mcp` to your MCP client and send the token in the `Authorization` header. In Claude Code:

```bash theme={null}
claude mcp add --transport http perfgrid https://console.perfgrid.com/mcp \
  --header "Authorization: Bearer pgapi_..."
```

The assistant only sees the tools the token's permissions allow: reading invoices, credit, services, usage, domains and tickets, and opening and replying to tickets. The server asks the assistant to confirm a ticket's text with you before it sends it. Paying, cancelling, upgrades and domain changes aren't available through MCP. The server doesn't support logging in with OAuth, so use a client that lets you set the header.

## Related articles

* [Console API reference](https://perfgrid.com/docs/api-reference/console/introduction.md)
* [Two-factor authentication](https://perfgrid.com/docs/console/security/two-factor-authentication.md)
* [Users and permissions](https://perfgrid.com/docs/console/team/members-and-permissions.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.