Configuration Dictionary

Environment variables, Worker secrets, and CONFIG_KV keys for the HOOX mesh.

This page

This document is the operator dictionary for environment variables, encrypted Worker secrets, and CONFIG_KV runtime keys. Prefer hoox onboard (or hoox init then hoox setup) over hand-editing files. Day-to-day changes: hoox config / hoox secrets.

Worker name is required on hoox secrets set <worker> <name>. The CLI prompts for the value.


1. Environment variables and secrets

Local build/deploy vars live in .env.local (copy from .env.example). Runtime credentials are Cloudflare® Worker secrets.

A. Core platform

VariableRequiredTypeDefaultDescription
CLOUDFLARE_API_TOKENYesstring—Cloudflare® API Token with Workers, D1, KV, R2, and Queues Edit.
CLOUDFLARE_ACCOUNT_IDYesstring—Your 32-character Cloudflare® account id (your_cloudflare_account_id).
SUBDOMAIN_PREFIXYesstring—Subdomain prefix under which public worker gateways deploy.
HOOX_API_URLNostring—Local API target URL (TUI / operator plane).
HOOX_API_TOKENNostring—Bearer for remote TUI (hoox tui --remote --token).
HOOX_REPONostring—Force monorepo root.
HOOX_HOMENostring~/.hooxConfig / data / global clone home.

B. Mesh keys (generated by hoox setup)

VariableRequiredScopeDescription
INTERNAL_KEY_BINDINGYesmeshInter-worker X-Internal-Auth-Key.
WALLET_EXECUTE_KEY_BINDINGDEX pathtrade-worker / web3-wallet-workerSame value as INTERNAL_KEY_BINDING after setup.
WEBHOOK_API_KEY_BINDINGYeshoox gatewayPublic webhook passkey. JSON field apiKey is compared against this secret — not a KV key.
OPERATOR_API_KEYOperator planehoox gatewayBearer for /v1/* and /wallet/*.

After rotation: hoox secrets sync --system (alias --required).

C. Exchange API credentials (trade-worker)

Canonical unified pair — venue is chosen by the signal / exchange:<name>:enabled, not by secret name:

VariableRequiredDescription
EXCHANGE_KEY_BINDINGNoLive API key (Binance / Bybit / MEXC).
EXCHANGE_SECRET_BINDINGNoLive HMAC secret.
EXCHANGE_TESTNET_KEY_BINDINGNoPreferred when "test": true (Binance / Bybit).
EXCHANGE_TESTNET_SECRET_BINDINGNoPreferred testnet secret.

Deprecated aliases still resolve if the unified pair is unset: BINANCE_KEY_BINDING / BINANCE_SECRET_BINDING / BINANCE_TESTNET_*, BYBIT_*, MEXC_*. Prefer EXCHANGE_*.

D. Telegram (telegram-worker)

VariableRequiredDescription
TG_BOT_TOKEN_BINDINGNoBotFather HTTP API token.
TG_CHAT_ID_BINDINGNoDefault numeric chat when alerts omit chatId.
AUTHORIZED_CHAT_IDSNoComma-separated allowlist. Inbound commands fail-closed when unset.
TELEGRAM_SECRET_TOKENNoX-Telegram-Bot-Api-Secret-Token on POST /webhook.
bash
hoox secrets set telegram-worker TG_BOT_TOKEN_BINDING
hoox secrets set telegram-worker TG_CHAT_ID_BINDING
hoox secrets set telegram-worker AUTHORIZED_CHAT_IDS

E. Multi-provider AI (agent-worker)

VariableRequiredDescription
OPENAI_API_KEYNoOpenAI access key.
ANTHROPIC_API_KEYNoAnthropic Claude access key.
GOOGLE_API_KEYNoGoogle Gemini access key.
AZURE_API_KEY / AZURE_ENDPOINTNoAzure OpenAI (optional fifth provider).

F. Web3 wallet (web3-wallet-worker)

VariableRequiredDescription
WALLET_MNEMONIC_SECRETEVM12/24-word seed.
WALLET_PK_SECRETEVMPrivate key (alternative to mnemonic).
SOLANA_PRIVATE_KEYSolanabase58 seed; hoox setup generates one if missing.
JUPITER_API_KEYSolana DEXJupiter portal. Not auto-generated.
RPC_URL_ARBITRUM / RPC_URL_SOLANANoPublic RPCs filled by setup if empty.

DEX spots (uniswap-ethereum, uniswap-arbitrum, jupiter-solana) do not use CEX keys. See DEX spot swaps.

G. Email ingress (email-worker)

email-worker does not poll IMAP. POST /webhook verifies Mailgun HMAC with MAILGUN_API_KEY. POST /email-signal uses the mesh internal key only. Cloudflare® Email Routing uses the worker email handler.

VariableRequiredDescription
MAILGUN_API_KEYMailgun pathSigning key for POST /webhook.
INTERNAL_KEY_BINDINGJSON pathMesh key for POST /email-signal.
EMAIL_HOST_BINDING / EMAIL_USER_BINDING / EMAIL_PASS_BINDINGNoReserved. The worker does not read them.
bash
hoox secrets set email-worker MAILGUN_API_KEY

2. Dynamic KV manifest settings

These runtime variables exist inside the CONFIG_KV namespace. Seed defaults with hoox config kv apply-manifest (reads each worker’s dashboard.jsonc).

KV KeyTypeDefaultOperational impact
trade:kill_switchbooleanfalseGlobal emergency halt. Gateway rejects /webhook when true.
global:kill_switchbooleanfalseGateway-side twin; OR’d with trade:kill_switch.
trade:max_daily_drawdown_percentnumber5.0Daily loss before agent-worker trips the kill switch.
trade:default_leveragenumber10Futures leverage when the signal omits leverage.
trade:max_position_sizenumber1000Max notional (USD) per trade.
webhook:queue_modestringqueue_failoverqueue_failover, queue_everywhere, or queue_disabled.
webhook:tradingview:ip_check_enabledbooleantrueDrop payloads whose CF-Connecting-IP is not on the TradingView® list.
webhook:tradingview:allowed_ipsstring(JSON array)Extra allowed IPs merged with built-in TradingView® ranges.
telegram:allowed_chat_idsstring[]Gateway notify chatId allowlist (JSON array).
email:coin_patternstring—Regex to extract assets from a plain-text email body.
email:action_patternstring—Regex to resolve actions in a plain-text email body.
email:quantity_multipliernumber1Multiplies quantity parsed from a plain-text email body.
exchange:binance:enabledstringunset = on"false" skips the venue. Same pattern for bybit, mexc, uniswap-ethereum, uniswap-arbitrum, jupiter-solana.

The webhook passkey is WEBHOOK_API_KEY_BINDING, not a KV key.

Opt-in tenant isolation is off by default. D1 rows carry tenant_id ('' when unscoped). Do not enable it unless you intend to attribute traffic by tenant.

Tip

Sync, inspect, or reset this manifest: hoox config kv apply-manifest, hoox config kv get <key>, hoox config kv set <key> <value>.

🔗 Next Steps