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

# Environment variables

> Configuration for Python apps, the agentservice CLI, demos, and local Docker stacks

For **hosted Sudoiq**, you typically only need an API key from [Settings](https://sudoiq.com/settings) and the default base URL. Self-hosted variables apply when you run your own API stack (see [Docker](/backend/docker)).

## Python client (suggested names)

| Variable             | Required | Default                        | Notes                                                       |
| -------------------- | -------- | ------------------------------ | ----------------------------------------------------------- |
| `AGENTSAPI_API_KEY`  | Yes\*    | —                              | API key (`sk_...`) for `AgentServiceAPIClient.set_api_key`. |
| `AGENTSAPI_BASE_URL` | No       | `https://sudoiq.com` (typical) | Execution API origin; override for self-host.               |

\*For server-side calls.

## agentservice CLI

| Variable               | Required | Default | Notes                                                                                               |
| ---------------------- | -------- | ------- | --------------------------------------------------------------------------------------------------- |
| `AGENTSERVICE_API_KEY` | Yes\*    | —       | Same as key from [Sudoiq settings](https://sudoiq.com/settings); also set via `agentservice login`. |

Config file locations: **`~/.config/agentservice/config`** or **`~/.agentservice`** (`api_key=`, `host=`). See [CLI](/clients/cli).

## PDF demo (typical variables)

| Variable               | Required | Default              | Notes                                                   |
| ---------------------- | -------- | -------------------- | ------------------------------------------------------- |
| `SUDOIQ_KEY`           | Yes      | —                    | API key read by the demo factory.                       |
| `SUDOIQ_URL`           | No       | `https://sudoiq.com` | Base URL for the client.                                |
| `AGENT_ID`             | No       | —                    | Overrides agent id file from one-time upload.           |
| `SUDOIQ_DEMO_MAX_WAIT` | No       | `3600`               | Demo-specific upper bound while waiting for a chat run. |

Check the demo’s **`.env.example`** for the authoritative list.

## Self-hosted Docker

Compose stacks usually inject API keys, database URLs, Redis, and signing secrets via **`.env`** next to `docker-compose.yml`. Names are **repository-specific** — copy the template from your backend repo when you follow [Docker](/backend/docker).

## SDK timeouts

Interactive **streaming** runs use a default **response timeout** (wall-clock seconds) in the **`agentsapi`** package (`DEFAULT_INTERACTIVE_RUN_RESPONSE_TIMEOUT`, often one hour). Override per call with `response_timeout=` on `execute_agent` / `run_agent`, or pass `float("inf")` where supported.

See [Timeouts and errors](/agents/timeouts-and-errors).
