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

api-tester-pro

v1.0.0

Published

一鍵測試 AI API 連接,專為 OpenClaw 用戶設計

Readme

API Tester Pro

一鍵測試 AI API 連接,專為 OpenClaw 用戶設計

Node.js License

✨ 功能特色

  • 🔍 三步測試:連接 → Models → Chat,快速驗證 API 可用性
  • 🌐 多 Provider 支援:Moonshot、OpenRouter、Perplexity、OpenAI、自定義
  • 📝 顯示輸入模式:打字時見到 characters,按 Enter 後遮罩,防錯又安全
  • ⚙️ 一鍵配置:測試成功直接寫入 OpenClaw config
  • 🎨 中文界面:繁體中文提示,清楚易明
  • 🔒 本地執行:API key 唔會上傳到任何伺服器

📦 安裝

方法一:直接下載

# 下載
wget https://github.com/eddiecck1608/api-tester/releases/download/v1.0.0/api-tester-v3.tar.gz

# 解壓
tar -xzf api-tester-v3.tar.gz

# 執行
node test-api-interactive.js

方法二:Git Clone

git clone https://github.com/eddiecck1608/api-tester.git
cd api-tester
node test-api-interactive.js

🚀 使用方法

$ node test-api-interactive.js

============================================================
        API Provider 測試工具 (交互式 v3)
============================================================

請選擇 Provider:

  1. 🌙 Moonshot (Kimi)
     → https://api.moonshot.cn/v1
  2. 🔄 OpenRouter
     → https://openrouter.ai/api/v1
  3. 🧠 OpenAI
     → https://api.openai.com/v1
  4. 🔍 Perplexity
     → https://api.perplexity.ai
  5. ⚡ 自定義 (手動輸入 Base URL)

選擇 (1-5): 1

📋 設定資訊:
   Provider: 🌙 Moonshot (Kimi)
   Base URL: https://api.moonshot.cn/v1
   測試 Model: kimi-k2.5

🔑 請輸入 API Key (顯示模式,按 Enter 後遮罩): sk-xxx
   API Key: sk-xxx...xxx

確認開始測試? (y/n): y

============================================================
                    開始測試
============================================================

🌐 測試 1: 檢查連接...
✅ 連接成功 (HTTP 200)

📊 測試 2: 獲取可用 Models...
✅ 成功獲取 15 個 Models

📋 可用 Models (顯示首 15 個):
------------------------------------------------------------
  01. kimi-k2.5
  02. kimi-k2-turbo-preview
  ...
------------------------------------------------------------

💬 測試 3: Chat Completion...
   Model: kimi-k2.5
✅ Chat 測試成功
   回應: "API test successful"
   Tokens: 18 (輸入: 8, 輸出: 10)

============================================================
                    測試結果
============================================================
✅ 所有測試通過!API 完全正常

💡 建議設定:
   Provider: Moonshot (Kimi)
   Base URL: https://api.moonshot.cn/v1
   Model: kimi-k2.5

📝 OpenClaw Config:
   "primary": "moonshot/kimi-k2.5"

是否直接寫入 OpenClaw Config? (y/n): y

📝 正在更新 OpenClaw Config...
✅ Config 更新成功!
   檔案: /root/.openclaw/openclaw.json
   Primary Model: moonshot/kimi-k2.5

請運行以下指令重啟 Gateway:
   openclaw gateway restart

🎯 適合邊個用?

| 用戶類型 | 使用場景 | |---------|---------| | 🆕 OpenClaw 新手 | 第一次設定 API,唔知 key 啱唔啱 | | 🔄 轉 Provider | 由 Moonshot 轉去 OpenRouter,快速驗證 | | 🧪 開發者 | 測試新 API provider 嘅連接性 | | 👨‍🏫 教育用途 | 學生學習 API 運作原理 | | ⏱️ 效率追求者 | 唔想逐個手動改 config 嚟試 |

📋 系統要求

  • Node.js 16.0+
  • OpenClaw(選擇性,用於自動寫入 config)

🔧 支援 Provider

| Provider | 預設 Base URL | 預設 Model | |----------|--------------|-----------| | Moonshot | https://api.moonshot.cn/v1 | kimi-k2.5 | | OpenRouter | https://openrouter.ai/api/v1 | anthropic/claude-sonnet-4.5 | | OpenAI | https://api.openai.com/v1 | gpt-4o-mini | | Perplexity | https://api.perplexity.ai | sonar-pro | | 自定義 | 手動輸入 | 手動輸入 |

💡 常見問題

Q: 測試失敗,點算?

A: 檢查以下幾點:

  1. API Key 是否正確(有冇多咗或漏咗字符)
  2. Base URL 是否正確(注意要有 /v1 結尾)
  3. 網絡連接是否正常(試下 ping api.xxx.com
  4. Provider 是否支援該 Model

Q: 會唔會儲存咗我嘅 API Key?

A: 唔會。除非你選擇「寫入 OpenClaw Config」,否則 key 只會喺記憶體內,程式結束後就消失。

Q: 可以測試自定義 Provider 嗎?

A: 可以!揀選項 5「自定義」,然後輸入你嘅 Base URL 同 Model ID。

📝 License

MIT License - 自由使用、修改、分享

🙏 鳴謝

特別鳴謝 Eddie Chi 提供寶貴意見,令呢個工具更加易用。


有問題或建議? 歡迎開 Issue 或 Pull Request!