# Authentication

The Claid API uses API keys via **Bearer Auth** for API authentication with the following format: `Authorization: Bearer {YOUR_API_KEY}`.

To get your API key, [sign in to your Claid account](https://claid.ai/account/overview) and click ***Create API key*** button from the ***Overview*** or ***API keys*** pages.

![Create API key from the Claid dashboard](https://1549088094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrPciCr3QshdCGkhkBgKD%2Fuploads%2Ft7uRnxTcsAGIPhWS6VjK%2FScreen%20Recording%202022-05-09%20at%2015.43.31.gif?alt=media\&token=9145ce8b-9dd1-4013-81c2-b0ae55cf6c78)

Once API key is generated, you can either copy it or download it as a txt file.

{% hint style="info" %}
Make sure to save the API key in a safe place, as it has certain privileges and is only visible on the Claid dashboard once, at the time of creation.
{% endhint %}

### API key usage

Authentication to the API is performed via [Bearer Authentication](https://swagger.io/docs/specification/authentication/bearer-authentication/):

{% tabs %}
{% tab title="HTTP" %}

```http
GET {API_ENDPOINT} HTTP/1.1
Host: api.claid.ai
Authorization: Bearer {YOUR_API_KEY}
```

{% endtab %}

{% tab title="cURL" %}

```shell
curl -X GET --location "https://{API_ENDPOINT}" --http1.1 \
    -H "Host: api.claid.ai" \
    -H "Authorization: Bearer {YOUR_API_KEY}"
```

{% endtab %}
{% endtabs %}

### Permission scopes

Each API key can have permissions to perform [Storage](https://docs.claid.ai/storage-connectors/api-reference), [Image editing](https://docs.claid.ai/image-editing-api/api-reference) or both types of operations with **Admin** permission scope.

Scopes can be assigned to API key from the [Claid dashboard](https://claid.ai/account/api) at the creation time or later, via ***API keys*** → ***Edit key*** page.

{% hint style="info" %}
It’s always better to create API keys with minimal permissions scopes necessary for your use case.
{% endhint %}
