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

# API Keys

> Create, list, and revoke project API keys from the CLI.

Project API keys let you authenticate CI pipelines and other headless environments. See [API Keys and Authentication](/reference/api-keys) for how keys work across the platform. These commands manage the same keys from the terminal.

<Note>
  API key management requires session login (`inf auth login`). A project API key cannot create, list, or revoke other keys.
</Note>

## `inf api-key create`

Create a project-scoped API key. The raw key value is shown once, at creation. Save it immediately, since it cannot be retrieved again.

<Metadata text="cli/api-key/create" />

```bash theme={"system"}
inf api-key create <name> --project <project-id>
```

### Arguments

| Argument | Required | Description                                           |
| -------- | -------- | ----------------------------------------------------- |
| `name`   | Yes      | Human-readable name for the key, e.g. `production-ci` |

### Options

| Option                 | Required | Description                                           | Default        |
| ---------------------- | -------- | ----------------------------------------------------- | -------------- |
| `--project <id>`       | Yes\*    | Project the key is scoped to                          | Active project |
| `--team <id>`          | No       | Team that owns the key                                | Active team    |
| `--permissions <list>` | No       | Comma-separated permissions: `read`, `write`, or both | `read,write`   |

\* Required unless `INF_PROJECT_ID` is set or an active project is already set (see [Projects](/cli/projects)).

<Note>
  Creating an API key may require a verified phone number on your account. If you see a verification error, add a phone number from the dashboard and try again.
</Note>

### Examples

<Metadata text="cli/api-key/create-examples" />

```bash theme={"system"}
# Read and write key for the active project
inf api-key create production-ci --project proj_789ghi012jkl

# Read-only key
inf api-key create readonly-metrics --project proj_789ghi012jkl --permissions read

# Key for a specific team
inf api-key create ci-key --project proj_789ghi012jkl --team team_abc123
```

## `inf api-key list`

List API keys for a team. The raw key value is never shown again after creation, only its ID, name, and scopes.

<Metadata text="cli/api-key/list" />

```bash theme={"system"}
inf api-key list
```

**Alias:** `inf api-key ls`

### Options

| Option        | Required | Description           | Default     |
| ------------- | -------- | --------------------- | ----------- |
| `--team <id>` | No       | Team to list keys for | Active team |

### Example

<Metadata text="cli/api-key/list-examples" />

```bash theme={"system"}
inf api-key list --team team_abc123
```

## `inf api-key revoke`

Revoke an API key so it can no longer authenticate requests. This cannot be undone.

<Metadata text="cli/api-key/revoke" />

```bash theme={"system"}
inf api-key revoke <id>
```

**Alias:** `inf api-key rm`

### Arguments

| Argument | Required | Description                                    |
| -------- | -------- | ---------------------------------------------- |
| `id`     | Yes      | API key ID to revoke (from `inf api-key list`) |

### Options

| Option        | Required | Description            | Default     |
| ------------- | -------- | ---------------------- | ----------- |
| `--team <id>` | No       | Team that owns the key | Active team |

### Example

<Metadata text="cli/api-key/revoke-examples" />

```bash theme={"system"}
inf api-key revoke key_abc123
```
