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

openclaw-cliproxyapi-provider

v0.1.6

Published

OpenClaw provider plugin that auto-registers CLIProxyAPI models with models.dev pricing

Readme

openclaw-cliproxyapi-provider

OpenClaw 的 CLIProxyAPI (CPA) 模型提供商插件。 通过 OpenAI Responses 协议对接 CLIProxyAPI,自动发现与同步模型列表,支持对话与图片生成。


特性

  • 即开即用:自动拉取可用模型目录、上下文窗口及多模态输入配置。
  • 对话与生图:支持文本对话(Responses 协议)及文生图 / 参考图编辑(/v1/images/*)。
  • 后台自动同步:定时静默更新上游模型目录,感知渠道变动无需重启网关。
  • 官方参考定价:自动匹配 models.dev 基准费率,便于统计用量。

环境要求

  • OpenClaw:>=2026.9.4
  • Node.js:>=24.16.0 <25 || >=26.1.0
  • 运行中的 CLIProxyAPI 实例

安装

通过 npm 安装

openclaw plugins install npm:openclaw-cliproxyapi-provider

本地开发安装

git clone https://github.com/hkfires/openclaw-cliproxyapi-provider.git
cd openclaw-cliproxyapi-provider
npm ci && npm run build
openclaw plugins install --link .
openclaw plugins enable cliproxyapi
openclaw gateway restart

配置

方式 1:交互式登录(推荐)

运行登录向导,根据提示输入服务地址(回车默认 http://127.0.0.1:8317)与 API Key,并按需选择主对话模型、识图理解模型(自动筛选支持看图的模型)及文生图模型(多 Agent 环境需带上 --agent 认领凭据,模型默认值仍全局生效):

openclaw models auth login --provider cliproxyapi --method api-key --set-default --agent main

(若自定义了 Agent 名称,将 main 替换为对应 Agent ID 即可)

方式 2:环境变量

| 环境变量(优先全称,兼容简写) | 默认值 | 说明 | | :--- | :--- | :--- | | CLIPROXYAPI_BASE_URL / CPA_BASE_URL | http://127.0.0.1:8317 | CLIProxyAPI 服务地址 | | CLIPROXYAPI_API_KEY / CPA_API_KEY | (空) | API Key | | CLIPROXYAPI_FAST / CPA_FAST | false | 是否开启 Priority 优先服务等级 |


使用指南

1. 对话模型

使用 cliproxyapi/ 前缀:

# 设置主模型
openclaw models set cliproxyapi/gpt-4o

# 对话中即时切换
/model cliproxyapi/claude-3-7-sonnet-20250219

2. 查看与刷新模型

# 查看当前可用模型
openclaw models list --provider cliproxyapi

# 强制从上游刷新全量模型列表
openclaw models list --refresh --all --provider cliproxyapi

3. 图片生成与编辑

若后端模型支持 /v1/images/*,可直接通过 OpenClaw 进行文生图和参考图编辑:

# 文生图
openclaw infer image generate --model cliproxyapi/gpt-image-2 --prompt "A cozy wooden cabin in the snow" --output ./cabin.png

# 参考图编辑
openclaw infer image edit --model cliproxyapi/gpt-image-2 --file ./cabin.png --prompt "Change the scene to summer with green grass" --output ./cabin-summer.png

可选配置

在 ~/.openclaw/openclaw.json 中可调整后台模型刷新频率(默认 1800 秒,填 0 则禁用):

{
  "plugins": {
    "entries": {
      "cliproxyapi": {
        "enabled": true,
        "config": {
          "refreshIntervalSeconds": 1800
        }
      }
    }
  }
}

开发与测试

npm run check          # 类型检查与代码格式
npm test               # 单元测试
npm run test:host      # OpenClaw 宿主集成测试
npm run test:images    # 生图与编辑能力测试
npm run build          # 构建

许可证

MIT © hkfires