| title | Authentication |
|---|---|
| description | To access the Tilebox API, you must authenticate your requests. This guide explains how authentication works, focusing on API keys used as bearer tokens. |
| icon | key |
To create an API key, log into the Tilebox Console. Navigate to Settings -> API Keys and click the "Create API Key" button.
Keep your API keys secure. Deactivate any keys if you suspect they have been compromised.Set TILEBOX_API_KEY in your shell environment (optional but recommended). That way, the 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.
```bash Bash echo 'export TILEBOX_API_KEY=""' >> ~/.bashrc source ~/.bashrc ``` ```zsh Zsh echo 'export TILEBOX_API_KEY=""' >> ~/.zshrc source ~/.zshrc ``` ```fish Fish set -Ux TILEBOX_API_KEY "" ``` ```powershell PowerShell [Environment]::SetEnvironmentVariable("TILEBOX_API_KEY", "", "User") $env:TILEBOX_API_KEY = "" ```Open a new terminal after setting the variable to confirm your shell loads it automatically.
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.
datasets_client = DatasetsClient(token="<tbx-api-...>") workflows_client = WorkflowsClient(token="<tbx-api-...>")
```go Go
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-...>"))

