# 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](/files/Il1z4bPxEKsLcu0xfZgc)

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](/storage-connectors/api-reference.md), [Image editing](/image-editing-api/api-reference.md) 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.claid.ai/authentication.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
