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

# API Keys

API keys are created and managed in the [dashboard](https://blocks.team/signup). They are used to authenticate requests from the Blocks CLI and are scoped to a workspace.

Install the CLI:

<CodeGroup>
  ```bash bash theme={null}
  pip install blocks-sdk
  ```
</CodeGroup>

Configure an API key when initializing:

<CodeGroup>
  ```bash bash theme={null}
  blocks init --key <api-key>
  ```
</CodeGroup>

Manually configure an API key:

<CodeGroup>
  ```bash bash theme={null}
  blocks configure --key <api-key>
  ```
</CodeGroup>

Or simply `blocks configure` for an interactive experience.

## Expiry

API keys can be assigned a TTL (time-to-live), or never expire unless manually deleted. Expired keys will automatically be deleted. You can manually delete or rename an existing API key at any time, however you cannot modify an existing API key's TTL. An API key must be valid to register or update an agent from the CLI. Once an agent is registered, API key validity does not affect an agent's execution.
