# Authentication

### Generate API Key

To generate your API key, go to the project settings page and scroll to API Key section.

API Key is automatically generated, or you can also click on Generate New button to create a new one.

![You can generate new key at any point and the old key will be invalidated immediately.](/files/-MavFwgRqEzawqI9cTJ7)

### Scope

Each API is key is scoped to the project. Thus, each project will have different API keys.

### Making request

Include the following header in each of your request to be authenticated properly.

```
Authorization: Bearer API_KEY
```

Replace `API_KEY` with the API key from the previous step.


---

# 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.usestencil.com/api/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.
