# create api-key

Learn how to create an API key.

This command creates an [API key](/explanation/application/api-keys) for your application. You can specify the name, permissions, and environment for the key.

## Usage

This command has the following syntax:

```sh
croct create api-key <options>
```

## Example

Create an API key interactively:

```sh
croct create api-key
```

Create a named API key for the production environment with specific permissions and copy it to the clipboard:

```sh
croct create api-key --name "My API Key" --env prod --permissions resource_read_access,token_issue --copy
```

## Options

Besides the [global options](../global-options), this command accepts the following options:

- `--name`: `string` (optional)

  The name of the API key.

- `--permissions`: `string` (optional)

  A comma-separated list of permissions to grant to the API key.

  | Permission             | Description                                         |
  | ---------------------- | --------------------------------------------------- |
  | `resource_read_access` | Allows reading resources such as content and slots. |
  | `token_issue`          | Allows issuing authentication tokens.               |
  | `data_export`          | Allows exporting analytics and event data.          |

- `--env`: `string` (optional)

  The environment of the API key.

  The accepted values are `prod` and `dev`.

- `--copy, -c`: `boolean` (optional)

  Copy the API key to the clipboard.

## Explore

- [Init](/reference/cli/commands/init): Learn how to initialize and configure your project.
- [Configuration](/reference/cli/configuration): See the full configuration file format reference.
