thcli / th) is a command-line access method provided by TokenHub, a large model service platform, for terminal developers and AI Agents.thcli <command> [subcommand] [--parameter]. You can add -h or --help at any level to view the complete parameter description.thcli and its short alias th. The examples in this document use thcli consistently. Replacing it with th produces exactly the same result, for example, th models list = thcli models list.npm i -g tencent-tokenhub-cli# (Optional) Inject TokenHub capabilities into a local Agent as a Skill with one click, enabling the Agent to invoke TokenHub's read-only capabilities through natural language.thcli +connect
thcli site use --name intl to switch to the international site (this setting takes effect permanently and only needs to be configured once. Accounts and keys are not shared between the China site and the international site).thcli-key) is automatically generated and saved locally for subsequent inference calls, eliminating the need for manual configuration.thcli auth login
--browser no and paste the credential string from the webpage back into the terminal as prompted.thcli auth login --browser no
thcli auth set --secret-id <SecretId> --secret-key <SecretKey>
thcli auth status
Please read the following document to help me install TokenHub CLI: https://tokenhub-cli.tencentmaas.com/tokenhub-cli-skills/install.md
Capability | Capability Description | Core Command | Agent Natural Language Description (Example) |
Sign-in and Credentials | Log in to a Tencent Cloud account (OAuth; after login, a data plane API Key named thcli-Key is automatically generated and saved for inference calls) or manually enter the credentials.Attention: First, run thcli site use --name intl to switch to the international site. | thcli auth login / set | Check the account, site, and credential validity period I am currently logged in with. |
| View the source and validity period of the current credential. | thcli auth status | |
| Log out. | thcli auth logout | |
API Key Management | View the Key list, details, and plaintext. | thcli key list / get / reveal | List all API keys under my account, including their names and access scopes. Check how much of the quota for this Key has been used. |
| Create a Key (with configurable accessible models, services, and Token quota); modify remarks and IP address allowlist. | thcli key create / update / quota | |
| Enable, disable, and delete; adjust quota limits. | thcli key enable / disable / delete | |
Multiple Accounts and Multiple Sites | View / create / switch the default Profile (identity isolation for multiple accounts on the same site). | thcli profile list / current / use / create | Check which Profile and site I am currently using. |
| View / switch the default site (cn domestic site / intl international site). | thcli site list / current / use | |
Capability | Capability Description | Core Command | Agent Natural Language Description (Example) |
Model list and details | View all models available on the platform, including language, vision, multimodal, speech, and vector models. You can filter by type, vendor, and Tag. View the specifications and billing information of a single model, such as its context window, maximum output, and rate limits. | thcli models list thcli models search thcli models get | What models are available, and what are their capabilities and vendors? What are the context window and maximum output length of deepseek-v3? |
Price comparison | Compare the input, output, and cache unit prices of multiple models horizontally. | thcli models compare thcli models pricing | Compare the prices of deepseek-v3 and glm-5v-turbo for me. |
Capability | Capability Description | Core Command | Agent Natural Language Description (Example) |
Dialogue | Initiate inference calls to language models, supporting multi-turn conversations, image/document multimodal input, internet search, deep thinking, and streaming output. | thcli +chat --model <Model Id> "Hello" Note: +chat is billed by token and prioritizes the model's free quota. When the free quota is exhausted, you must enable pay-as-you-go billing through endpoint postpaid on to continue making calls. | Use the deepseek-v4-flash model to check the error in this screenshot and explain it. Prove the Pythagorean theorem and derive it step by step for me. |
Capability | Capability Description | Core Command | Agent Natural Language Description (Example) |
Image generation | Text-to-image, image-to-image, multi-turn session editing, image sets, transparent backgrounds, and layer splitting. Covers the Hunyuan Hy, WAND-Vega, Vidu, Kling, and other model series. | thcli +gen <API ID (API path)> --model <Model ID> --prompt "<image description>" [--images <reference image>] Example: Text-to-image: thcli +gen wand/hunyuan-image/v35-generation --model hy-image-v3.5-preview --messages '[{"role":"user","content":[{"type":"text","text":"An orange cat lying on the windowsill"}]}]' --size 1024x1024 --output ./outImage-to-image: thcli +gen wand/hunyuan-image/v35-generation --model hy-image-v3.5-preview --messages '[{"role":"user","content":[{"type":"text","text":"Change to watercolor style"},{"type":"image_url","image_url":{"url":"./ref.png"}}]}]' --output ./outNote: +gen is billed by token and prioritizes the model's free quota. If the model does not include a free quota or the free quota is exhausted, you must enable pay-as-you-go billing through endpoint postpaid on to continue making calls. | Use hy-image-v3.5-preview to generate a cyberpunk-style city night scene and save it to ./out. Use hy-image-v3 to reference this image and generate a watercolor-style version. |
Video generation | Text-to-video, image-to-video, first-and-last-frame video generation, reference-based video generation, and motion control. Covers the Hunyuan Hy, Kling, Vidu, PixVerse, MiniMax, WAND-Vega, and other model series. | thcli +gen <API ID (API path)> --model <Model ID> --prompt "<video description>" [--image <first frame image>] [--no-wait] Example: Text-to-video: thcli +gen wand/hunyuan-video/generation --model hy-video-v1.5 --prompt "Seaside sunset" --aspect-ratio 16:9 --output ./outImage-to-video: thcli +gen wand/hunyuan-video/generation --model hy-video-v1.5 --image ./cat.jpg --prompt "The cat turns its head" --no-waitNote: +gen is billed by token and prioritizes the model's free quota. If the model does not include a free quota or the free quota is exhausted, you must enable pay-as-you-go billing through endpoint postpaid on to continue making calls. | Use hy-video-v1.5 to generate a 16:9 seaside sunset video. Use hy-video-v1.5 to generate a video of a cat turning its head, with this image as the first frame. |
3D and world models | Text-to-3D and image-to-3D model generation. Generate 360° panoramas and scenes of 3D worlds. | thcli +gen <API ID (API path)> --model <Model ID> --prompt "<scene or object description>" [--<reference image field> <reference image>] Example: 360° panorama: thcli +gen wand/hunyuan-image/world2-panorama --model hy-world2-panorama --prompt "A Jiangnan ancient town in the early morning" --output ./outNote: +gen is billed by token and prioritizes the model's free quota. If the model does not include a free quota or the free quota is exhausted, you must enable pay-as-you-go billing through endpoint postpaid on to continue making calls. | Use hy-world2-panorama to generate a 360° panorama of a Jiangnan ancient town in the early morning. |
Speech generation and recognition | TTS, voice cloning, and voice design. ASR (outputting text and subtitles), AI dubbing, and music generation. | ASR: thcli +gen <API ID (API path)> --model <model ID> --data <local audio> or --input-url <audio URL> TTS: thcli +gen <API ID (API path)> --model <model ID> --text "<text>" --voice-setting '<voice configuration>'. Example: ASR: thcli +gen wand/asrproxy/sync_transcribe --model hy-asr-3.0-preview --data ./speech.wav --output ./outTTS: thcli +gen wand/minimax-tts/sync_tts --model minimax-speech-2.8-hd --text "Hello" --voice-setting '{"voice_id":"male-qn-qingse"}' --output ./outNote: +gen is billed by token and prioritizes the model's free quota. If the model does not include a free quota or the free quota is exhausted, you must enable pay-as-you-go billing through endpoint postpaid on to continue making calls. | Use hy-asr-3.0-preview to recognize the content of this recording and output SRT subtitles. Use minimax-speech-2.8-hd to synthesize this copy into speech, with voice ID xxx. |
Generation APIs and task management | View all generation APIs, their invocation methods (synchronous/asynchronous), and the complete parameters of each API. Query the status of asynchronous tasks and download results; list tasks submitted from this machine. | View generation API parameters: thcli +gen apis [API ID (API path)]. Query asynchronous tasks: thcli +gen status <API ID (API path)> <task ID> [--wait] [--output <directory>]. List local generation tasks: thcli +gen tasks. Example: View Hunyuan image generation model API parameters: thcli +gen apis wand/hunyuan-image/v35-generationQuery and download task results: thcli +gen status wand/hunyuan-video/generation <task ID> --wait --output ./outNote: The above query commands do not incur any fees. | What Hunyuan image generation models are available in TokenHub, and which ones are synchronous? Is the hy-video-v1.5 video task I just submitted complete? If so, download it to ./out. |
Capability | Capability Description | Core Command | Agent Natural Language Description (Example) |
Service query | View the service (endpoint) list and details, including running status, billing method, rate limit threshold, and free quota usage. | thcli endpoint list thcli endpoint get | "What services do I have, and what are their respective states" What is the current rate limit for this service? |
Deploy / Modify / Delete | Create a custom service (set the billing method and RPM / TPM rate limits). Modify the configuration; delete it. Enable/disable pay-as-you-go billing for a service. | thcli deploy thcli endpoint update / delete thcli endpoint postpaid on / off Note: The endpoint postpaid on and deploy operations will incur charges, and a second confirmation is required by default. | None Attention: Deploying, modifying, and deleting access points are write operations and currently cannot be triggered directly by natural language. |
Type | Capability | Capability Description | Core Command | Agent Natural Language Description (Example) |
Enterprise plan | Query packages | View details, available model scopes, and usage details of held Enterprise Token Plan packages. | thcli plan list thcli plan info / models / detail | What enterprise plans do I have, and how much quota is left in each? Which models are available under this plan? I want to view the usage details of this plan. |
| Purchase / Renew / Upgrade | Purchase Enterprise plans (Pro/Lite), renew, and upgrade plan quotas. | thcli plan buy thcli plan renew / upgrade Note: plan buy/renew/upgrade will incur charges and require a second confirmation by default. | None Attention: Purchasing, renewing, and upgrading are write operations that incur charges and currently cannot be triggered directly by natural language. |
| Package-specific Key | View, create, modify, reset, and delete dedicated API keys for Enterprise plans (independent from platform keys, with separately calculated quotas). | thcli plan key list / get thcli plan key create / update / rotate / delete | Which dedicated keys are available under this plan? |
Personal Edition plan | Query packages | View details, available model scopes, and usage details of held Personal Edition Token Plan packages. | thcli plan personal list thcli plan personal info / models / usage --series <common / hy> | What Personal Edition plans do I have, and how much quota is left in each? Which models are available under this plan? I want to view the usage details of this plan. |
| Personal Edition shared Key | View / generate / display plaintext / reset / delete Personal Edition shared keys (shared between General and Hy, with separately calculated quotas). | thcli plan personal key show / create / reveal / rotate / delete | What is the status of my Personal Edition shared Key? Generate a Personal Edition shared Key. |
Capability | Capability Description | Core Command | Agent Natural Language Description (Example) |
Usage statistics | View Token consumption rankings and trends by model, endpoint, and API Key, with aggregation by hour, day, and other granularities. Export usage details as CSV for reconciliation. | thcli usage rank / trend / export | How many tokens were used today, and which model consumed the most? View the tpm trend of the xx service over the last 7 days. Export the usage data of the last 7 days by Key to a CSV file. |
Model monitoring | View monitoring data by language, vision, and speech model type. You can view metrics such as RPM, TTFT, TPOT, and error rate by model, access point, and API Key, with aggregation supported by hour or day. | thcli monitor text / vision / audio thcli monitor text --model <name> | Check whether the hy3 model has any call failure records in the last 7 days. |
Diagnosis and troubleshooting | Full-path health check (credentials, regions, permissions) Diagnose Key, Service, Model, and Plan, and view their status and availability. Error code translation. | thcli doctor all thcli doctor key / endpoint / model / plan thcli doctor error | Why did the call fail? Check which step went wrong. What does this error code mean? Before generating images with hy-image-v3.5-preview, check whether it can be called successfully. What does Kling video generation returning 1201 mean, and how can it be fixed? |
Capability | Capability Description | Core Command | Agent Natural Language Description (Example) |
One-click Skill injection | Inject the read-only capabilities of TokenHub into the local Agent as a Skill, enabling the Agent to understand and call TokenHub using natural language. | thcli +connect thcli +connect uninstall thcli +connect status | Read the <installation document link> and help me integrate TokenHub CLI into my Claude Code. Check which TokenHub-related Skills are already installed on this machine. |
Capability | Capability Description | Agent Natural Language Description (Example) |
Document search | Based on the TokenHub official documentation, quickly understand and help users search for the information they need. | What are the call parameters and steps for hy3? Where can I view my billing details? Provide a link. Explain to me what inference services are. According to the official documentation, help me integrate the hy3 model into WorkBuddy. |
-h or --help. This applies at any level, for example, thcli --help, thcli plan --help, or thcli plan key create --help.Command Group | Description | View Full Parameters |
auth | Sign in, sign out, manually enter keys, and view status | thcli auth --help |
key | API key list, details, create, delete, modify, enable, disable, and plaintext | thcli key --help |
models | Model list, details, price comparison, and search recommendations | thcli models --help |
endpoint / deploy | Endpoint list, details, modify, delete; create endpoint | thcli endpoint --help thcli deploy --help |
+chat | Inference call | thcli +chat --help |
+gen | Generate images, videos, 3D content, and audio; query asynchronous tasks | thcli +gen --help |
chat-config | Locally maintain the API Key used for +chat conversations and +gen generation | thcli chat-config --help |
plan | Enterprise package list, details, purchase, renewal, upgrade, and usage details | thcli plan --help |
plan personal | Personal package list, details, purchase, renewal, upgrade, and usage details | thcli plan personal --help |
usage | Usage ranking and export to CSV | thcli usage --help |
monitor | RPM, TTFT, TPOT, error rate, and more | thcli monitor --help |
doctor | Full-path health check and output repair actions | thcli doctor --help |
profile | Multi-account Profile management | thcli profile --help |
site | Site (cn / intl) switching | thcli site --help |
lang | Interface language (zh / en) switching | thcli lang --help |
+connect | One-click Agent Skills injection | thcli +connect --help |
~/.thcli/), and Activity Log, see the open-source repository.Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan