# Authenticate


<Container>
  WebSocket URL:
**<CopyToClipboard>wss://streams.fast.onetrading.com</CopyToClipboard>**

</Container>

All private channels require client authentication before subscription. Clients should first send an `AUTHENTICATE` message containing the API token, after which they can subscribe to any private channel. If the supplied API token is valid, it will be used to authorize subscriptions and requests for all private channels within this WebSocket connection.

An API token can be generated in the [One Trading UI](https://fast.exchange.onetrading.com/).


:::warning[]
You must ensure the API token you generate has the `Trade` permission, otherwise you will receive an `AUTH_ERROR`.
:::

## Authentication Request


```json
{
  "type": "AUTHENTICATE",
  "api_token": "eyJ..."
}
```

<DataSchema id="406381" />

## Authentication Response

### Success

```json
{
  "type": "AUTHENTICATED"
}
```

<DataSchema id="406385" />

### Error

```json
{
  "error": "AUTHENTICATION_FAILED"
}
```

<DataSchema id="406386" />