npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

telecomjs-tokenhub-checker

v0.1.5

Published

Check if your TokenHub Key is valid.

Readme

ttc

npm version npm downloads License: MIT Codacy Badge

TokenHub Checker — 测试 TokenHub / 电信大模型网关 API Key 是否有效的命令行工具。

安装

npm install -g telecomjs-tokenhub-checker

用法

交互式测试

ttc

无参数时进入交互式流程:输入 API Key → 自动获取可用模型列表 → 选择模型 → 并行测试三种接口(chat-completion、responses、anthropic)并展示结果。

列出可用模型

ttc models <key>

输出 JSON 对象:

{
  "url": "https://aigw.telecomjs.com/v1/models",
  "models": ["deepseek-v3", "gpt-4o-mini", "glm-4.5"]
}

测试单接口

ttc test <key> [--chat | --anthropic | --responses] <model_name>

测试某个模型在指定接口下的回复是否正常,输出 JSON 对象:

{
  "key": "sk-xxxxxx",
  "model": "deepseek-v3",
  "content": "我是……",
  "valid": true,
  "url": "https://aigw.telecomjs.com/v1/chat/completions",
  "elapsed": "123.456ms",
  "type": "chat"
}

参数说明

| 参数 | 说明 | | ------------ | ----------------------------- | | key | API Key(必填) | | model_name | 模型名称(必填) | | --flag | 接口类型标志,默认为 --chat |

接口标志

| 标志 | 接口 | 端点 | | ---------------- | ------------------ | ---------------------- | | --chat(默认) | Chat Completions | /v1/chat/completions | | --responses | Responses | /v1/responses | | --anthropic | Anthropic Messages | /v1/messages |

标志和 model_name 顺序可互换:ttc test sk-xxx deepseek-v3 --anthropic 等效于 ttc test sk-xxx --anthropic deepseek-v3。 如果只传一个位置参数(无标志),该参数视为 model_name,接口默认为 --chat。

输出字段

| 字段 | 类型 | 说明 | | --------- | ------- | ---------------------------------------------- | | key | string | 本次使用的 API Key | | model | string | 测试的模型名称 | | content | string | 模型返回的内容(失败时为空字符串) | | valid | boolean | 请求是否成功且返回了有效内容 | | url | string | 实际请求的接口地址 | | elapsed | string | 请求耗时(如 123.456ms) | | type | string | 接口类型(chat / responses / anthropic) | | error | string | 仅在失败时出现,描述错误原因 |

usage 字段在单接口测试的输出中被移除,仅在交互模式的日志中展示。

环境变量

| 变量 | 默认值 | 说明 | | ----------------------- | ------ | ------------------------------------------------- | | TTC_MAX_OUTPUT_TOKENS | 300 | 最大输出 token 数,设置过小可能被截断导致响应异常 |

协议透传说明

电信大模型网关对三种接口均为透传。如果源供应商没有对应的接口(例如某些模型不支持 /responses 或 /messages),返回失败是正常现象。

License

MIT