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

# Create and List API Keys

> Generate new API keys with optional scopes and list existing keys. The raw key is returned only once during creation.

Manage API keys for programmatic access. Create a new key with a name and optional scopes, then list all existing keys to review their metadata. The full key value is visible only in the create response.

## Create API Key

### Endpoint

```http theme={null}
POST /v1/api-keys
```

## Authentication

Pass one of `Authorization: Bearer <api-key>` or `Authorization: ApiKey <key>`.

## Request Body

<ParamField body="name" type="string" required>
  Human-readable name for the key.
</ParamField>

<ParamField body="scopes" type="array">
  Optional array of permission scopes.
</ParamField>

### Response

<ResponseField name="id" type="string">
  Unique key identifier.
</ResponseField>

<ResponseField name="name" type="string">
  Key name.
</ResponseField>

<ResponseField name="key" type="string">
  The raw API key. Shown only once.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://agent.example.com/v1/api-keys \
    -H "Authorization: Bearer <api-key>" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "production-worker",
      "scopes": ["agent:read", "agent:write"]
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "key_01E",
    "name": "production-worker",
    "key": "aria_live_abc123xyz"
  }
  ```
</ResponseExample>

## List API Keys

### Endpoint

```http theme={null}
GET /v1/api-keys
```

### Response

<ResponseField name="items" type="array">
  Array of key metadata objects.
</ResponseField>

<ResponseField name="items[].id" type="string">
  Key identifier.
</ResponseField>

<ResponseField name="items[].name" type="string">
  Key name.
</ResponseField>

<ResponseField name="items[].prefix" type="string">
  Visible prefix of the key.
</ResponseField>

<ResponseField name="items[].created_at" type="string">
  ISO 8601 creation timestamp.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl https://agent.example.com/v1/api-keys \
    -H "Authorization: Bearer <api-key>"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "items": [
      {
        "id": "key_01E",
        "name": "production-worker",
        "prefix": "aria_li",
        "created_at": "2024-06-01T12:00:00Z"
      }
    ]
  }
  ```
</ResponseExample>


## Related topics

- [Create, rotate, and revoke your API keys](/guides/manage-api-keys.md)
- [Create ROUTER API Key API](/api-reference/router/keys/create.md)
- [POST /v1/apikeys — Create PIN API Key](/api-reference/pin/apikeys/create.md)
- [List ROUTER API Keys API](/api-reference/router/keys/list.md)
- [GET /v1/apikeys: List PIN API Keys](/api-reference/pin/apikeys/list.md)
