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-hub-manager

v1.0.0

Published

Terminal-based API management tool for various AI services

Readme

API Hub

一个终端下的API管理工具,用于管理各种AI服务的API配置,支持模型列表获取、连接测试和对话测试。

功能特性

  • 🔧 API配置管理: 添加、查看、更新、删除API配置
  • 🌐 多平台支持: 支持OpenAI格式API、Claude等
  • 💰 免费/付费标识: 区分公益站和付费API,支持筛选
  • 📋 模型列表: 获取API提供的可用模型列表
  • 🔍 连接测试: 测试API连接状态和可用性,支持特定模型测试
  • 📊 状态跟踪: 显示最后测试时间和连接状态
  • 💬 对话测试: 与指定模型进行实时对话测试
  • 🔒 安全存储: 配置信息安全存储在本地
  • 🎨 彩色界面: 关键信息高亮显示,易于阅读

安装

# 克隆项目
git clone <repository-url>
cd api-hub

# 安装依赖
npm install

# 构建项目
npm run build

# 全局安装(可选)
npm link

使用方法

1. 添加API配置

api-hub add

交互式添加新的API配置,包括:

  • 渠道名称
  • API URL(如: https://api.openai.com)
  • API Key
  • API类型(OpenAI格式/Claude/其他)
  • 是否为免费/公益站
  • 描述信息(可选)

2. 查看API配置

# 列出所有API配置
api-hub list

# 只列出免费/公益站
api-hub list free

# 查看指定API的详细信息(显示完整KEY)
api-hub get <api名称或ID>

list命令显示格式:

  • ✅/❌/❓ 最后测试状态图标
  • [FREE]/[PAID] 免费/付费标识
  • 渠道、URL、KEY 彩色高亮显示
  • 最后测试时间(多久前)
  • 创建时间、描述、ID等详细信息

3. 测试API连接

api-hub test <api名称或ID>
  • 测试API连接状态
  • 显示可用模型列表
  • 可选择特定模型进行功能测试
  • 自动更新最后测试时间和状态

4. 获取模型列表

api-hub models <api名称或ID>

5. 模型对话测试

api-hub chat <api名称或ID>

选择模型后可进行实时对话,输入 exitquit 退出。

6. 删除API配置

api-hub delete <api名称或ID>

配置文件

配置文件存储在 ~/.api-hub/config.json,包含所有API配置信息。

支持的API格式

  • OpenAI格式: 包括OpenAI官方API和各种兼容的中转站
  • Claude: Anthropic Claude API
  • 其他: 自定义格式的API

开发

# 开发模式运行
npm run dev

# 构建
npm run build

# 启动
npm start

示例

# 添加一个OpenAI API配置
api-hub add
# 输入: 名称=OpenAI, URL=https://api.openai.com, Key=sk-xxx, 类型=openai

# 测试连接
api-hub test OpenAI

# 查看可用模型
api-hub models OpenAI

# 开始对话
api-hub chat OpenAI

注意事项

  • API Key将以明文形式存储在本地配置文件中,请确保文件安全
  • 网络连接超时设置为10秒
  • 对话模式下默认使用较低的温度值以获得更稳定的回复