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

# Authentication

> Authenticate Nylon API requests with a bearer key.

## Base URL

All public API requests use:

```txt theme={null}
https://api.nylon.dev/v1
```

## Bearer authentication

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

```http theme={null}
Authorization: Bearer nylon_live_YOUR_API_KEY
```

API keys are associated with your Nylon user account and can access that account's connected profiles.

## Create a key

Create and manage keys from the [Nylon API page](https://app.nylon.dev/api). Use a descriptive name so you can identify the application or environment using each key.

<Note>
  Create separate keys for development, staging, and production. This lets you revoke one environment without interrupting the others.
</Note>

## Keep keys secure

* Send requests from your backend, not directly from browser code.
* Store keys in a secret manager or encrypted environment configuration.
* Never include keys in URLs, logs, source control, or client bundles.
* Revoke a key immediately if it may have been exposed.

## Authentication errors

The API returns `401 Unauthorized` when the bearer token is missing, malformed, revoked, or invalid.

```json theme={null}
{
  "error": {
    "code": "unauthorized",
    "message": "A valid Nylon API key is required."
  }
}
```
