# API Authentication

All API requests require a Bearer token in the `Authorization` header.

## Bearer Token

```
Authorization: Bearer YOUR_API_KEY
```

## Example

```python
import requests

response = requests.get(
    "https://api.pvnode.com/v1/forecast",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    params={"latitude": 47.848, "longitude": 12.062, "slope": 30, "orientation": 180}
)
```

## Getting Your API Key

1. Sign up at [pvnode.com](https://pvnode.com/auth/register)
2. Go to your [API Keys page](https://pvnode.com/settings/api-keys)
3. Create a new key and copy it

:::caution
Keep your API key secret. Don't commit it to version control or share it publicly. Use environment variables instead:

```python
import os
api_key = os.environ["PVNODE_API_KEY"]
```
:::