---
title: "How the SDK reads environment variables | Grafana Labs"
description: "The five variables the SDK reads, which value fills each one, and what basic mode means."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# How the SDK reads environment variables

The token is shown only once. Store it securely, for example, in an **environment variable**, a named value you set in your application’s process, or in a secret manager.

## The five variables

Set these environment variables in your application’s process. The SDK reads these environment variables when you create the **client**, the Agent Observability SDK object in your application code, so you can construct the client with no arguments instead of passing each value in code.

| Variable                   | Value                                  | Where it comes from                 |
|----------------------------|----------------------------------------|-------------------------------------|
| `AGENTO11Y_ENDPOINT`       | The Agent Observability API URL        | **API URL** on the setup screen     |
| `AGENTO11Y_PROTOCOL`       | `http`                                 | Use `http` for Grafana Cloud.       |
| `AGENTO11Y_AUTH_MODE`      | `basic`                                | Use `basic` for Grafana Cloud.      |
| `AGENTO11Y_AUTH_TENANT_ID` | Your Grafana Cloud instance ID         | **Instance ID** on the setup screen |
| `AGENTO11Y_AUTH_TOKEN`     | Your Grafana Cloud Access Policy Token | **Add token** on the access policy  |

## Where each value comes from

Two values from the setup screen, one from the access policy, and the two documented values `http` and `basic` fill the five variables.

[![API URL and Instance ID from the setup screen, the Grafana Cloud Access Policy Token from the access policy, and the documented values http and basic, each filling one of the five AGENTO11Y_ environment variables](https://grafana.com/docs/learning-hub/intro-to-agent-observability/04-authenticate-the-sdk/16-how-the-sdk-reads-environment-variables/three-values-five-variables.svg)](https://grafana.com/docs/learning-hub/intro-to-agent-observability/04-authenticate-the-sdk/16-how-the-sdk-reads-environment-variables/three-values-five-variables.svg "API URL and Instance ID from the setup screen, the Grafana Cloud Access Policy Token from the access policy, and the documented values http and basic, each filling one of the five AGENTO11Y_ environment variables")

For traces and metrics, the OpenTelemetry SDK reads two more environment variables, `OTEL_EXPORTER_OTLP_ENDPOINT` and `OTEL_EXPORTER_OTLP_HEADERS`. You set them when you add traces and metrics, after your first generation is in **Conversations**.

## What `basic` means

`basic` is the authentication mode documented for Grafana Cloud, and the Grafana Cloud Access Policy Token in `basicPassword` carries the `sigil:write` scope.
