TypeClawTypeClaw
Reference

Environment variables

Every TYPECLAW_* env var the runtime reads

Host stage

VariableRead byDefaultEffect
TYPECLAW_HOMEhostd, CLI~/.typeclawOverride the host daemon state directory; primarily for tests
TYPECLAW_LOG_LEVELCLIinfodebug / info / warn / error
TYPECLAW_DEBUGCLIunsetAnything truthy enables verbose tracing

Container stage (set by typeclaw start)

VariableSet on docker runEffect
TYPECLAW_CONTAINER_NAMEalwaysThe container's name; container code uses it to identify itself to hostd
TYPECLAW_HOSTD_URLwhen hostd HTTP control is enabledhttp://host.docker.internal:<port> — used by the agent's restart tool
TYPECLAW_HOSTD_TOKENper-container, generated at startBearer token for the HTTP control surface; per-container restart RPC
TYPECLAW_HOSTD_BROKER_TOKENper-container, generated at startAuth token for the portbroker WebSocket connection
TYPECLAW_NETWORK_BLOCK_INTERNALwhen network.blockInternal: true1 — entrypoint shim installs the iptables egress filter
TYPECLAW_SANDBOX_SYMLINKSwhen sandbox.symlinks is non-emptybase64-encoded JSON of the sandbox.symlinks array; the entrypoint shim decodes it and creates each from -> /agent/<to> symlink at the real container $HOME for unsandboxed bash
DISPLAYwhen docker.file.xvfb is enabled:99 — points at the in-container Xvfb server

Provider credentials

Set in the host stage; injected into the container via --env-file .env.

These env vars override a stored API-key credential in secrets.json (env-wins). The exception is dual-auth providers (anthropic, xai): a stored OAuth credential takes precedence over the env var, since OAuth is stateful and refreshed on disk. See /concepts/secrets-policy for the full resolution order.

VariableProviderNotes
FIREWORKS_API_KEYfireworks
OPENAI_API_KEYopenai
ANTHROPIC_API_KEYanthropicOAuth credential on disk wins over this env var (dual-auth provider).
ZAI_API_KEYzaiZ.AI pay-as-you-go.
ZAI_CODING_API_KEYzai-codingZ.AI GLM Coding Plan — separate billing surface from zai.
XAI_API_KEYxaixAI (Grok). OAuth credential on disk wins over this env var (dual-auth provider).
MINIMAX_API_KEYminimaxAccepts either a pay-as-you-go API key or a Token Plan Subscription Key (sk-cp-…) — same slot.
DEEPSEEK_API_KEYdeepseekDeepSeek pay-as-you-go.
(others)Each known provider has a canonical env var; see /reference/secrets-json

Custom env-var names are supported via the Secret's env field — { "key": { "env": "MY_OPENAI" } }. See /concepts/secrets-policy for resolution order.

Provider endpoint overrides

Set in the host stage; injected into the container via --env-file .env.

VariableProviderDefaultEffect
ANTHROPIC_BASE_URLanthropichttps://api.anthropic.comPoint the Anthropic provider at an Anthropic-compatible endpoint.
OPENAI_BASE_URLopenaihttps://api.openai.com/v1Point the OpenAI provider at an OpenAI-compatible endpoint.

ANTHROPIC_BASE_URL routes the anthropic provider through a proxy that speaks the native Anthropic Messages protocol (/v1/messages, x-api-key or OAuth Bearer) — e.g. LiteLLM, Cloudflare AI Gateway, or a corporate gateway. It is a base-URL swap only; it does not enable raw AWS Bedrock, which requires SigV4 signing and a different request path.

OPENAI_BASE_URL does the same for the openai provider, routing it through an OpenAI-compatible endpoint (LiteLLM, Azure-style gateways, corporate proxies). It targets the api-key openai provider only — the OAuth-only openai-codex ChatGPT backend is unaffected.

Both follow the same rules: trailing slashes are stripped; a non-http(s) value fails the agent at boot. The same endpoint is used by typeclaw init's API-key validation probe.

Channel credentials (env-wins)

VariableAdapterField
SLACK_BOT_TOKENslack-botbotToken
SLACK_APP_TOKENslack-botappToken
DISCORD_BOT_TOKENdiscord-bottoken
TELEGRAM_BOT_TOKENtelegram-bottoken
GITHUB_TOKENgithubPAT path

KakaoTalk does not have an env-wins path — credentials live exclusively in secrets.json#channels.kakaotalk because the renewal cron needs the structured per-account record.

Container-side standard variables

VariableSet byEffect
TZpassed through from host or typeclaw.json#docker.runArgs.appendcron schedule timezone if no per-job override
HOMEcontainer default/root
SHELLcontainer default/bin/bash if installed, else /bin/sh

On this page