Tencent Cloud TokenHub and TokenPlan Provider Setup

Set up the Tencent Cloud provider plugin to reach Hunyuan chat models through TokenHub and TokenPlan endpoints. This guide covers provider ids, API keys, and onboarding flags for hy4-preview and hy3.

Read this when

  • You want to use Tencent hy4-preview with OpenClaw
  • You need the TokenHub or TokenPlan API key setup

Install the official Tencent Cloud provider plugin to reach Tencent Hunyuan chat models (hy4-preview, hy3) through two endpoints, TokenHub (tencent-tokenhub) and TokenPlan (tencent-tokenplan), over an OpenAI-compatible API.

PropertyValue
Provider idstencent-tokenhub, tencent-tokenplan
Package@openclaw/tencent-provider
TokenHub auth env varTOKENHUB_API_KEY
TokenPlan auth env varTOKENPLAN_API_KEY
TokenHub onboarding flag--auth-choice tokenhub-api-key
TokenPlan onboarding flag--auth-choice tokenplan-api-key
TokenHub direct CLI flag--tokenhub-api-key <key>
TokenPlan direct CLI flag--tokenplan-api-key <key>
APIOpenAI-compatible (openai-completions)
TokenHub base URLhttps://tokenhub.tencentmaas.com/v1
TokenHub global base URLhttps://tokenhub-intl.tencentmaas.com/v1 (override)
TokenPlan base URLhttps://api.lkeap.cloud.tencent.com/plan/v3
Default modeltencent-tokenhub/hy4-preview

Quick start

Create a Tencent API key

Generate an API key for Tencent Cloud TokenHub and TokenPlan. Should you give the key a restricted access scope, add hy4 preview to the permitted models, along with hy3 and hy3 preview if you intend to use those on TokenHub.

Run onboarding

openclaw onboard --auth-choice tokenhub-api-key
openclaw onboard --non-interactive --accept-risk --skip-health \
  --auth-choice tokenhub-api-key \
  --tokenhub-api-key "$TOKENHUB_API_KEY"
openclaw onboard --auth-choice tokenplan-api-key
openclaw onboard --non-interactive --accept-risk --skip-health \
  --auth-choice tokenplan-api-key \
  --tokenplan-api-key "$TOKENPLAN_API_KEY"
export TOKENHUB_API_KEY=...
export TOKENPLAN_API_KEY=...

Verify the model

openclaw models list --provider tencent-tokenhub
openclaw models list --provider tencent-tokenplan

Your model entries survive onboarding, and the generated catalog rows are left to discovery. When models.mode: "replace" is used, onboarding also writes the built-in catalog, since that mode does not run discovery.

Non-interactive setup

# TokenHub
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice tokenhub-api-key \
  --tokenhub-api-key "$TOKENHUB_API_KEY" \
  --skip-health \
  --accept-risk

# TokenPlan
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice tokenplan-api-key \
  --tokenplan-api-key "$TOKENPLAN_API_KEY" \
  --skip-health \
  --accept-risk

Note

--accept-risk must be supplied together with --non-interactive. Because --mode defaults to local, these runs match the direct flag commands listed above. Execute them on the Gateway host: onboarding from a remote client (--mode remote) only configures the local client connection and leaves provider credentials unset on the server.

Built-in catalog

Model refNameInputContextMax outputNotes
tencent-tokenhub/hy4-previewhy4 preview (TokenHub)text1,024,00064,000reasoning-enabled; default
tencent-tokenhub/hy3hy3 (TokenHub)text256,000128,000reasoning-enabled; previous GA
tencent-tokenhub/hy3-previewhy3 preview (TokenHub)text256,000128,000deprecated; use hy4-preview
tencent-tokenplan/hy4-previewhy4 preview (TokenPlan)text1,024,00064,000reasoning-enabled; default
tencent-tokenplan/hy3hy3 (TokenPlan)text256,000128,000reasoning-enabled; previous GA

hy4-preview is Tencent Hunyuan's large MoE language model, built for reasoning, long-context instruction following, code, and agent workflows. Tencent's OpenAI-compatible samples pass hy4-preview as the model id, and they support standard chat-completions tool calling as well as reasoning_effort.

Existing TokenHub configurations

A fresh onboarding picks hy4-preview on both endpoints. TokenHub configurations that already exist follow their own migration policy: if a TokenHub model allowlist is set, openclaw doctor --fix swaps a deprecated tencent-tokenhub/hy3-preview primary for tencent-tokenhub/hy3 rather than Hy4. This covers both string and object primary settings, and it keeps fallbacks, custom aliases, and unrelated settings intact. Primaries set explicitly to hy3 or hy4-preview are left as they are.

The catalog still recommends hy4-preview for hy3-preview, yet that is not where the Doctor migration sends you. Choosing Hy4 is a deliberate step: check its different pricing and confirm model access for the endpoint you selected.

Advanced configuration

Endpoint override

The built-in catalog in OpenClaw points at Tencent Cloud's https://tokenhub.tencentmaas.com/v1 endpoint. Override it only when your TokenHub account or region needs a different one:

openclaw config set models.providers.tencent-tokenhub.baseUrl "https://your-endpoint/v1"

Environment availability for the daemon

When the Gateway is deployed as a managed service (launchd, systemd, Docker), both TOKENHUB_API_KEY and TOKENPLAN_API_KEY have to be readable by that process. Provide them in ~/.openclaw/.env or through env.shellEnv, so the launchd, systemd, or Docker exec environments can pick them up.

Warning

Variables exported only inside an interactive shell will not be seen by managed gateway processes. For availability that persists, use the env file or the config setting.

807 words · updated Oct 26, 2026