Available languages: [Python](https://databento.com/docs/api-live/client-control-messages/authentication-request.python.md) · [C++](https://databento.com/docs/api-live/client-control-messages/authentication-request.cpp.md) · [Rust](https://databento.com/docs/api-live/client-control-messages/authentication-request.rust.md) · [Raw](https://databento.com/docs/api-live/client-control-messages/authentication-request.raw.md)

Source: https://databento.com/docs/api-live/client-control-messages/authentication-request


### Authentication request

Authenticates the session against the gateway and sets the dataset for the session.

#### Example message
```text
auth=6c476f2214fa0509607a968b7d62e3a3b605ee740f9c6d70f1bd3a34a9213f61-mNUM6|dataset=GLBX.MDP3|encoding=dbn|ts_out=0\n
```

#### Example response
```text
success=1|session_id=135567\n
```

#### Fields

| Field | Required | Type | Description |
| `auth` | required | string | The authentication response. Generated based on the client API key and the `cram` challenge sent by the gateway. See [authentication](https://databento.com/docs/api-live/basics/authentication.md) for a detailed walkthrough of the process. |
| `dataset` | required | string | The [dataset](https://databento.com/docs/api-live/basics/datasets.md) code (string identifier). Must be one of the values from [metadata.list_datasets](https://databento.com/docs/api-historical/metadata/metadata-list-datasets.md). |
| `encoding` | optional | string | The [encoding](https://databento.com/docs/api-live/basics/encodings.md) to be used for the data sent by the gateway. Defaults to `dbn`. |
| `compression` | optional | string | The [compression](https://databento.com/docs/api-live/basics/compression.md) to be used for the data sent by the gateway. Defaults to `none`. |
| `ts_out ` | optional | int8_t | If set to `1`, the gateway will prepend the timestamp at which the message was processed to every data record. Defaults to `0`. |
| `pretty_px` | optional | int8_t | If set to `1`, the gateway will format fixed-precision fields as a decimal string. Only applicable for JSON encoding. Defaults to `0`. |
| `pretty_ts` | optional | int8_t | If set to `1`, the gateway will format timestamp fields as ISO 8601 strings. Only applicable for JSON encoding. Defaults to `0`. |
| `heartbeat_interval_s` | optional | uint32_t | Overrides the interval in seconds at which the gateway will send [heartbeat records](https://databento.com/docs/api-live/basics/system-messages.md). Defaults to the gateway's default interval. Must be between 5 and 1800 seconds. |
| `slow_reader_behavior` | optional | string | The [slow reader behavior](https://databento.com/docs/api-live/basics/slow-reader-behavior.md) to be used for the session. Defaults to `skip`. |
|  |
