---
title: Use tokens
description: Use an API token in the InfluxDB UI, the influx CLI, or the InfluxDB API.
url: https://docs.influxdata.com/influxdb3/cloud-serverless/admin/tokens/use-tokens/
estimated_tokens: 317
product: InfluxDB Cloud Serverless
version: cloud-serverless
---

# Use tokens

Use tokens to authenticate requests to InfluxDB, including requests to write, query, and manage data and resources. Authenticate requests using the [`influx` CLI](/influxdb/v2/reference/cli/influx/), API requests made with client libraries, and tools like cURL.

### Add a token to a CLI request

```sh
influx write \
  --token API_TOKEN \
  # ...
```

### Use environment variables

The `influx` CLI automatically uses the `INFLUX_TOKEN` variable when defined in the current session.

### Use CLI configurations

Create [`influx` CLI connection configurations](/influxdb3/cloud-serverless/reference/cli/influx/config/) to automatically add your token and other required credentials to each CLI command execution.
