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

# Installation

> Install the Hexel Python SDK.

## Install

```bash theme={"dark"}
pip install hexel
```

Requires **Python 3.10+**. The SDK depends on `httpx` and `websockets`.

Optional extras:

```bash theme={"dark"}
pip install "hexel[app]"    # agent runtime app (Starlette/Uvicorn)
pip install "hexel[otel]"   # OpenTelemetry instrumentation
```

## Verify

```python theme={"dark"}
from hexel import Hexel

client = Hexel(api_key="YOUR_API_KEY")
print(client.compute.sandbox.list())
```

## Configuration

The `Hexel` client accepts these options:

<ParamField path="api_key" type="string">API key. Or set `HEXEL_API_KEY`.</ParamField>
<ParamField path="client_id" type="string">OAuth client ID (with `client_secret`). Or set `HEXEL_CLIENT_ID`.</ParamField>
<ParamField path="client_secret" type="string">OAuth client secret. Or set `HEXEL_CLIENT_SECRET`.</ParamField>
<ParamField path="workspace_id" type="string">Default workspace for tool operations.</ParamField>
<ParamField path="timeout" type="float" default="30.0">Per-request timeout in seconds.</ParamField>
<ParamField path="base_url" type="string" default="https://api.hexelstudio.com">API gateway base URL (orchestration, tools, registry).</ParamField>
<ParamField path="compute_url" type="string" default="https://api.hexelstudio.com">Compute API base URL (sandboxes, instances, registry).</ParamField>
<ParamField path="sts_url" type="string" default="https://sts.hexelstudio.com">Token service URL.</ParamField>

```python theme={"dark"}
from hexel import Hexel

client = Hexel(api_key="YOUR_API_KEY", timeout=60.0)
```

## Authentication

Provide credentials directly or via environment variables:

```python theme={"dark"}
# API key
client = Hexel(api_key="YOUR_API_KEY")

# OAuth client credentials
client = Hexel(client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET")
```

```bash theme={"dark"}
export HEXEL_API_KEY="YOUR_API_KEY"
# or
export HEXEL_CLIENT_ID="YOUR_CLIENT_ID"
export HEXEL_CLIENT_SECRET="YOUR_CLIENT_SECRET"
```

The SDK exchanges credentials with the STS for a short-lived token (15 min) and refreshes it automatically.

## Next steps

Continue to the [Quickstart](/docs/sdks/python/quickstart).
