> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tilebox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> To access the Tilebox API, you must authenticate your requests. This guide explains how authentication works, focusing on API keys used as bearer tokens.

## Creating an API key

To create an API key, log into the [Tilebox Console](https://console.tilebox.com). Navigate to [Settings -> API Keys](https://console.tilebox.com/settings/api-keys) and click the "Create API Key" button.

<Info>
  Keep your API keys secure. Deactivate any keys if you suspect they have been compromised.
</Info>

<Frame>
  <img src="https://mintcdn.com/tilebox/TYquvc9froFIydg1/assets/console/api-keys-light.png?fit=max&auto=format&n=TYquvc9froFIydg1&q=85&s=e29bee83bef620e01606f4943874a575" alt="Tilebox Console" className="dark:hidden" width="1536" height="970" data-path="assets/console/api-keys-light.png" />

  <img src="https://mintcdn.com/tilebox/TYquvc9froFIydg1/assets/console/api-keys-dark.png?fit=max&auto=format&n=TYquvc9froFIydg1&q=85&s=d7cb4d89aa0f8282cdf13f681b20b837" alt="Tilebox Console" className="hidden dark:block" width="1536" height="970" data-path="assets/console/api-keys-dark.png" />
</Frame>

## Set up environment variable

Set `TILEBOX_API_KEY` in your shell environment (optional but recommended). That way, the [Tilebox CLI](/agents-and-ai-tools/tilebox-cli) and SDK clients automatically pick it up.

The following commands persist the variable for future terminal sessions and also make it available in the current session.

<CodeGroup>
  ```bash Bash theme={"system"}
  echo 'export TILEBOX_API_KEY="<tbx-api-...>"' >> ~/.bashrc
  source ~/.bashrc
  ```

  ```zsh Zsh theme={"system"}
  echo 'export TILEBOX_API_KEY="<tbx-api-...>"' >> ~/.zshrc
  source ~/.zshrc
  ```

  ```fish Fish theme={"system"}
  set -Ux TILEBOX_API_KEY "<tbx-api-...>"
  ```

  ```powershell PowerShell theme={"system"}
  [Environment]::SetEnvironmentVariable("TILEBOX_API_KEY", "<tbx-api-...>", "User")
  $env:TILEBOX_API_KEY = "<tbx-api-...>"
  ```
</CodeGroup>

Open a new terminal after setting the variable to confirm your shell loads it automatically.

## Manual SDK authentication

In case you didn't configure your shell environment, you can also pass your API key as the `token` parameter when creating an instance of the SDK clients.

<CodeGroup>
  ```python Python theme={"system"}
  from tilebox.datasets import Client as DatasetsClient
  from tilebox.workflows import Client as WorkflowsClient

  datasets_client = DatasetsClient(token="<tbx-api-...>")
  workflows_client = WorkflowsClient(token="<tbx-api-...>")
  ```

  ```go Go theme={"system"}
  import (
  	"github.com/tilebox/tilebox-go/datasets/v1"
  	"github.com/tilebox/tilebox-go/workflows/v1"
  )

  datasetsClient := datasets.NewClient(datasets.WithAPIKey("<tbx-api-...>"))
  workflowsClient := workflows.NewClient(workflows.WithAPIKey("<tbx-api-...>"))
  ```
</CodeGroup>

<Tip>
  If you set your API key as an environment variable named `TILEBOX_API_KEY`, you can skip the token parameter when creating a client.
</Tip>
