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

kiro-proxy

v0.2.1

Published

Kiro API proxy with OpenAI and Anthropic compatible endpoints

Readme

English | 中文

kiro-proxy

Kiro 订阅内含的 Claude 模型可以在 Claude Code 中使用。

通过读取 Kiro 的认证 token,代理请求到 Amazon Q Developer,暴露 OpenAI 和 Anthropic 兼容的 API 接口。

前提

需要先安装并登录 Kiro,确保 ~/.aws/sso/cache/kiro-auth-token.json 存在且未过期。

快速开始

npx kiro-proxy

服务默认监听 http://localhost:3456

配置

| 环境变量 | 默认值 | 说明 | |----------|--------|------| | PORT | 3456 | 监听端口 | | PROXY_API_KEY | 无 | 设置后所有请求需携带此 key 进行鉴权,未设置则不校验 | | HTTPS_PROXY | 无 | HTTP/HTTPS 代理地址,如 http://127.0.0.1:7890 |

API

GET /v1/models — 查询可用模型

curl http://localhost:3456/v1/models

POST /v1/messages — Anthropic 兼容

# 非流式
curl http://localhost:3456/v1/messages \
  -H "Content-Type: application/json" \
  -H "x-api-key: any" \
  -d '{"model": "claude-sonnet-4.6", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello"}]}'

# 流式
curl http://localhost:3456/v1/messages \
  -H "Content-Type: application/json" \
  -H "x-api-key: any" \
  -d '{"model": "claude-sonnet-4.6", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello"}], "stream": true}'

POST /v1/chat/completions — OpenAI 兼容

# 非流式
curl http://localhost:3456/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model": "claude-sonnet-4.6", "messages": [{"role": "user", "content": "Hello"}]}'

# 流式
curl http://localhost:3456/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model": "claude-sonnet-4.6", "messages": [{"role": "user", "content": "Hello"}], "stream": true}'

GET /health

检查 token 状态及过期时间。

GET /credits

查询积分消耗统计,支持 period 参数:

# 今日消耗(默认)
curl http://localhost:3456/credits

# 最近 7 天
curl http://localhost:3456/credits?period=7d

# 最近 30 天
curl http://localhost:3456/credits?period=30d

# 全部
curl http://localhost:3456/credits?period=all

与 Claude Code 集成

Claude Code 默认使用 Anthropic 官方 model ID,需要通过环境变量映射到 Q Developer 的 model ID。

~/.claude/settings.json 中添加:

{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "any",
    "ANTHROPIC_BASE_URL": "http://localhost:3456",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4.6",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4.6",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4.5"
  },
  "model": "sonnet"
}

model 可选值:sonnetopushaiku,添加 [1m] 后缀可启用 1M 上下文窗口(如 "opus[1m]")。

注意:不要设置 ANTHROPIC_MODEL 环境变量,它会覆盖 model 字段,导致上下文窗口等配置失效。

代理设置

自 2026 年 5 月 1 日起,Kiro 上的 Claude 模型无法在中国大陆及港澳台地区使用。如果遇到 Invalid model 错误,请配置代理。

注意:代理节点需选择其他地区(如新加坡、泰国、韩国等)。

通过环境变量设置 HTTP 代理:

# 设置代理后启动
HTTPS_PROXY=http://127.0.0.1:7890 npx kiro-proxy

支持的环境变量:HTTPS_PROXYhttps_proxyHTTP_PROXYhttp_proxy,优先级从左到右。

相关项目

  • kiro-web-search — 将 Kiro 内置的联网搜索封装为 MCP server,可在 Claude Code 等客户端中使用