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

# API keys

> Create an API key in the console, choose its scope and expiry, and revoke it.

An API key lets a script, the [command line](https://docs.infinitecompute.ai/api/cli.md) or [Terraform](https://docs.infinitecompute.ai/api/terraform.md) act for you in one project. It has your rights in that project, never more.

## Create a key

![API keys page listing keys with their access, creator, last use, expiry and status](https://mintcdn.com/infinitecompute/ZfaVXu9meKhYJC2I/images/console/api-keys.png?fit=max\&auto=format\&n=ZfaVXu9meKhYJC2I\&q=85\&s=2d2e3c507be59d3f0bb77f457b6af09a)

1. In the console, switch to the project the key is for.
2. Open the menu at the bottom of the sidebar and choose **API keys**.
3. Choose **Create API key**, and give it:
   * a **name**, so you recognise it later (for example `ci-pipeline`);
   * its **access**: **Read only** or **Read and write**;
   * an **expiry**, up to one year. The default is 90 days.
4. Copy the key. It starts with `ic_ck_`.

> [!WARNING]
>
> The key is shown **once**. Store it in a password manager or your CI's secret store, never in code or a repository. If you lose it, revoke it and create a new one.

## Scopes

| Scope | Can |
| - | - |
| **Read only** | List and read servers, volumes, backups, SSH keys, server types, images and usage. |
| **Read and write** | Everything above, plus launch, stop, park, resume and delete servers, open SSH access, and manage volumes and SSH keys. |

Keys can't manage keys, team members or billing; those stay in the console.

## Who sees which keys

You see the keys you created. A project owner sees every key in the project, and can revoke any of them.

The list shows each key's name, the start of the key (`ic_ck_` and its id), its scope, who created it, when it was last used and when it expires. The rest of the key is never shown again.

## Revoke a key

On the **API keys** page, press and hold the revoke button next to the key (**Hold to revoke**). It stops working at once, everywhere. Revoking can't be undone; create a new key instead.

A key also stops working when it expires, and when its creator leaves the project.

## Keys and two-factor sign-in

API keys don't ask for a code. If you've turned on [two-factor sign-in](https://docs.infinitecompute.ai/guides/log-in-and-projects.md#two-factor-sign-in) for the console, your keys keep working as before. A key acts for you without a code, so keep it as safe as your password, and revoke it as soon as you no longer need it.

## Use a key

Send it as a bearer token:

```bash theme={null}
export INFINITECOMPUTE_API_KEY=ic_ck_...
curl -H "Authorization: Bearer $INFINITECOMPUTE_API_KEY" \
  https://<your-console-address>/api/public/v1/me
```

Your console address is in your welcome email. See the [API overview](https://docs.infinitecompute.ai/api/overview.md) for errors, retries and limits.

> [!TIP]
>
> Use one key per tool or pipeline, with the narrowest scope it needs. Then you can revoke one without breaking the others.


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