---
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: 178
publisher: InfluxData
canonical: https://docs.influxdata.com/influxdb3/cloud-serverless/admin/tokens/use-tokens/
date: '2025-01-13T07:21:11-07:00'
lastmod: '2025-01-13T07:21:11-07:00'
---

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.
