00bx-kiro-gateway

中文文档
1.0.9发布于 2026/02/09MITTypeScriptESM + CJS零依赖

AI SDK provider that lets OpenCode use Claude models through Kiro CLI's free-tier credits

原始使用文档
文档目录11 节
  1. How it works
  2. Models
  3. Setup
  4. 1. Install and sign in to Kiro
  5. 2. Install OpenCode
  6. 3. Add the provider config
  7. 4. Run
  8. Multiple accounts
  9. Troubleshooting
  10. Technical details
  11. License

00bx-kiro-gateway

AI SDK provider that lets OpenCode use Claude models through Kiro CLI's free-tier credits.

How it works

Kiro is Amazon's AI IDE. It comes with free credits for Claude models. When you sign in to Kiro, it stores auth tokens locally. This package reads those tokens and routes OpenCode requests through the same backend — so you can use your Kiro free-tier credits directly inside OpenCode.

Models

ModelConfig IDStatus
Claude Sonnet 4claude-sonnet-4Working
Claude Sonnet 4.5claude-sonnet-4-5Working
Claude Haiku 4.5claude-haiku-4-5Working
Claude Opus 4.5claude-opus-4-5Currently disabled by Kiro (capacity limits)

Opus 4.5 note: Kiro's servers have disabled Opus 4.5 due to capacity constraints on their end. The config is included so it works automatically whenever Kiro re-enables it — no update needed on your side.

All working models support streaming, tool use, and multi-turn conversations.

Setup

1. Install and sign in to Kiro

brew install --cask kiro

Or download from kiro.dev.

Open Kiro, sign in with your AWS Builder ID (create one at profile.aws if needed), then you can close it. The credentials stay on your machine.

2. Install OpenCode

curl -fsSL https://opencode.ai/install | bash

3. Add the provider config

Edit ~/.config/opencode/opencode.json:

{
  "provider": {
    "kiro": {
      "npm": "00bx-kiro-gateway",
      "name": "Kiro Gateway",
      "models": {
        "claude-sonnet-4": {
          "name": "Claude Sonnet 4",
          "limit": { "context": 200000, "output": 8192 }
        },
        "claude-sonnet-4-5": {
          "name": "Claude Sonnet 4.5",
          "limit": { "context": 200000, "output": 8192 }
        },
        "claude-haiku-4-5": {
          "name": "Claude Haiku 4.5",
          "limit": { "context": 200000, "output": 8192 }
        },
        "claude-opus-4-5": {
          "name": "Claude Opus 4.5",
          "limit": { "context": 200000, "output": 8192 }
        }
      }
    }
  }
}

If you already have other providers configured, add the "kiro" block inside your existing "provider" object.

4. Run

# Interactive
opencode -m kiro/claude-sonnet-4

# Single command
opencode run -m kiro/claude-sonnet-4 "explain this codebase"

Multiple accounts

If you have more than one AWS Builder ID, you can switch between them in Kiro IDE at any time. The gateway detects the account change automatically on the next request — it re-reads Kiro's local database before every API call. When it sees a different refresh token, it drops the old session and starts using the new account's credentials.

This means you can rotate between accounts to use each account's free-tier credits without restarting OpenCode.

Troubleshooting

ProblemFix
Kiro refresh token not foundOpen Kiro IDE and sign in.
Empty or no responseYou may have hit a rate limit. Try claude-haiku-4-5 — it has the highest limits.
Token/auth errorsReopen Kiro IDE to refresh your session.
Opus 4.5 not respondingKiro has it disabled for now due to capacity. Use Sonnet 4 or 4.5 instead.
OpenCode doesn't show Kiro modelsCheck your opencode.json for valid JSON (no trailing commas).

Technical details

  1. Reads Kiro CLI's refresh token from its local SQLite database (bun:sqlite → better-sqlite3 → sqlite3 CLI fallback)
  2. Exchanges it for a short-lived access token via Kiro's auth endpoint
  3. Sends prompts to the AWS CodeWhisperer streaming API
  4. Parses the AWS binary event stream protocol into AI SDK V2 stream format
  5. Handles token refresh, 403 retry, 429/5xx backoff, idle stream timeouts, and tool-call accumulation

Zero runtime dependencies. Works with Bun and Node.js.

License

MIT — 00bx

版本与发布记录

00bx-kiro-gateway 共发布 10 个版本,首次发布于 2026/02/09;过去 12 个月发布了 10 个版本。

版本发布日期距今
1.0.9latest2026/02/098 个月前
1.0.82026/02/098 个月前
1.0.72026/02/098 个月前
1.0.62026/02/098 个月前
1.0.52026/02/098 个月前
1.0.42026/02/098 个月前

关于 00bx-kiro-gateway 的常见问题

00bx-kiro-gateway 是什么?

AI SDK提供商,允许OpenCode通过Kiro CLI的免费信用使用Claude模型

如何安装 00bx-kiro-gateway?

在项目目录运行 npm install 00bx-kiro-gateway,或使用 pnpm add / yarn add / bun add。

00bx-kiro-gateway 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

00bx-kiro-gateway 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

00bx-kiro-gateway 可以商用吗?

00bx-kiro-gateway 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

00bx-kiro-gateway 还在维护吗?

最新版本 1.0.9 发布于 2026/02/09(8 个月前);至今共发布 10 个版本,其中过去 12 个月发布了 10 个;首次发布于 2026/02/09。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。