---
title: "alpacon token create"
description: "Create a personal API token with a name, expiry, and scopes. Choose interactive prompts or flags; use a service token to run commands or transfer files."
---

> Full documentation index: https://docs.alpacax.com/llms.txt

# alpacon token create

Create a personal API token with a name, expiry, and scopes.

## Usage

`alpacon token create [flags]`

## Key facts

- Omit `--scopes` to request the concrete scopes your roles allow.
- `--expiration-in-days 0` uses the workspace maximum token lifetime.
- Usage limits are enabled by default.
- New personal API tokens cannot hold command-execution or file-transfer scopes. Existing tokens with those scopes keep working without a work session.

## Flags

| Flag | Type | Description | Default |
| --- | --- | --- | --- |
| `--expiration-in-days` | `int` | Days until the token expires (0 = the workspace's maximum token lifetime). | `0` |
| `-h, --help` | `bool` | help for create | `false` |
| `-l, --limit` | `bool` | Set to true to apply usage limits. | `true` |
| `-n, --name` | `string` | A name to remember the token easily. | — |
| `--scopes` | `string` | Comma-separated list of scopes (e.g. "server:read,role_audit_log:read"). Omit to get the scopes your roles allow. | — |
| `--output` | `string` | Output format: table or json | `table` |

## Examples

Create a token interactively

```bash
alpacon token create
```

Create a token with a name and expiration

```bash
alpacon token create -n my-token --expiration-in-days 30
```

Create a token without limits

```bash
alpacon token create -n my-token -l=false
```

Create a token with specific scopes

```bash
alpacon token create --name ci-token --scopes "server:read"
```

## Scopes and expiry

Omitting `--scopes` gives the concrete scopes your roles allow that a personal token may carry. This also applies to Superusers; it does not grant `*`. Creation fails with `400 api_token_scopes_required` if no scope is available. Requesting `*`, `command:*`, `*:create`, or a scope excluded from personal tokens fails with `400 api_token_scope_not_mintable`.

`--expiration-in-days 0` uses **Maximum token lifetime** (1–366 days, default 366). This limit applies to personal and registration tokens. Check the scopes you can grant with [`alpacon token scopes`](/reference/cli/token/scopes/).

For automation that executes commands or transfers files, use a service token. The personal-token lifetime limit does not apply to service tokens.

Source: https://docs.alpacax.com/reference/cli/token/create/
