> ## Documentation Index
> Fetch the complete documentation index at: https://docs-test.rye.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Authorization

> Authenticate requests to the Rye API using your API key in the Authorization header.

All requests to the Rye API must include an `Authorization` header containing your API key. This key authenticates your requests and allows you to access all available endpoints.

**Important:** Keep your API key private. Anyone with access to it can make requests on your behalf. If you suspect your key has been compromised, [contact us immediately](support@rye.com) to generate a new one.

## Using Your API Key

Include your API key in the `Authorization` header of every request:

```
Authorization: Basic YOUR_API_KEY
```

## Environment-Specific Keys

Each API environment has a unique key:

* **Staging API key:** Works only in the staging environment.
* **Production API key:** Works only in the production environment.

Make sure you are using the correct key for the environment you are targeting. Staging keys will not work in production and vice versa.

## Retrieving Your API Key

1. Log in to the Rye console.
2. Navigate to the [Account page](https://staging.console.rye.com/account) -> API Key Headers section.
3. View and copy your API key.

<img src="https://mintcdn.com/rye-35/j7SfJ8CcimgGEE8U/api-headers-console.png?fit=max&auto=format&n=j7SfJ8CcimgGEE8U&q=85&s=03c39e0b788065643cfe4592310109e9" alt="" width="2450" height="762" data-path="api-headers-console.png" />

## Best Practices

* Never embed your API key in client-side code or publicly-accessible repositories.
* Use environment variables or a secure key management system to store and access your API keys in your applications.
