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-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
Install THCLI for me by following the command below: https://gz-thcli-skills-1258344699.cos.ap-guangzhou.myqcloud.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. | 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) |
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. |
Capability | Capability Description | Core Command | Agent Natural Language Description (Example) |
Query packages | View details of held Token Plan plans, available model scopes, and usage details. Note: Currently, you can only view Enterprise Edition Token Plan information. The Personal Edition Token Plan is not supported yet and will be available in a later version. | 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? |
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? |
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 |
chat-config | API Key used for locally maintaining +chat conversations | thcli chat-config --help |
plan | Enterprise package list, details, purchase, renewal, upgrade, and usage details | thcli plan --help |
plan key | Create, delete, modify, and query enterprise package-specific keys | thcli plan key --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