# Authentication

The Synth API uses API key authentication. All requests must include your API key in the `Authorization` header.

## Getting an API Key

{% stepper %}
{% step %}

### Login

Go to your [Synth Dashboard](https://dashboard.synthdata.co/)
{% endstep %}

{% step %}

### Choose a plan

Sign up for the Professional or Enterprise plan
{% endstep %}

{% step %}

### Generate key

Generate a new API Key
{% endstep %}
{% endstepper %}

## Using Your API Key

Include your API key in the `Authorization` header:

```
Authorization: Apikey YOUR_API_KEY
```

### Example

{% code title="curl" %}

```bash
curl "https://api.synthdata.co/insights/volatility?asset=BTC" \
  -H "Authorization: Apikey YOUR_API_KEY"
```

{% endcode %}

## Security

{% hint style="warning" %}

* Never commit keys to version control
* Use environment variables
* Rotate keys regularly
  {% endhint %}

{% code title="python" %}

```python
import os

api_key = os.environ.get("SYNTH_API_KEY")
headers = {"Authorization": f"Apikey {api_key}"}
```

{% endcode %}


---

# 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.synthdata.co/getting-started/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.
