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

# algolia apikeys create

> Create a new API key.

```txt Usage theme={"system"}
algolia apikeys create [flags]
```

## Examples

Create a new API key targeting the index "MOVIES", with the "search" and "browse" ACL and a description:

```sh icon=square-terminal theme={"system"}
algolia apikeys create --indices MOVIES --acl search,browse --description "Search & Browse API Key"
```

Create a new API key targeting the indices "MOVIES" and "SERIES", with the "[https://example.com](https://example.com)" referer, with a validity of 1 hour and a description:

```sh icon=square-terminal theme={"system"}
algolia apikeys create -i MOVIES,SERIES --acl search -r "https://example.com" --u 1h -d "Search-only API Key for MOVIES & SERIES"
```

## Flags

<ParamField body="--acl">
  API key's ACL.

  `search`: can perform search operations.
  `browse`: can retrieve all index data with the browse endpoint.
  `addObject`: can add or update records in the index.
  `deleteObject`: can delete an existing record.
  `listIndexes`: can get a list of all indices.
  `deleteIndex`: can delete an index.
  `settings`: can read all index settings.
  `editSettings`: can update all index settings.
  `analytics`: can retrieve data with the Analytics API.
  `recommendation`: can interact with the Recommendation API.
  `usage`: can retrieve data with the Usage API.
  `logs`: can query the logs.
  `seeUnretrievableAttributes`: can retrieve unretrievableAttributes for all operations that return records.
</ParamField>

<ParamField body="-d, --description">
  Describe an API key to help you identify its uses.
</ParamField>

<ParamField body="-i, --indices">
  Index names or patterns that this API key can access. By default, an API key can access all indices in the same application.

  You can use leading and trailing wildcard characters (`*`).
  For example, `dev_*` matches all indices starting with `dev_`. `*_dev` matches all indices ending with `_dev`. `*_products_*` matches all indices containing `products`.
</ParamField>

<ParamField body="-r, --referers">
  Specify the list of referrers that can perform an operation.
  You can use the wildcard character (`*`) to match subdomains or entire websites.
</ParamField>

<ParamField body="-u, --validity">
  Duration (in seconds) after which the API key expires. By default (a value of 0), API keys don't expire.
</ParamField>
