202 字
1 分钟
Mac使用Kiro Gate Way反代Kiro IDE模型

下载Kiro IDE并登录#

  1. 下载地址
  2. 打开IDE并登录

启动kiro-gateway#

  1. 拉取仓库

    Terminal window
    git clone https://github.com/Jwadow/kiro-gateway.git && cd kiro-gateway
  2. 配置虚拟环境,本文章使用的环境管理工具是UV

    Terminal window
    uv venv && source .venv/bin/activate && uv pip install -r requirements.txt
  3. 编辑配置

    Terminal window
    cp .env.example .env && vim .env
    ...
    PROXY_API_KEY="<配置你自己的apikey,用于Claude Code验证>"
    # ===========================================
    # OPTION 1: Kiro IDE credentials (JSON file)
    # ===========================================
    # Path to JSON credentials file from Kiro IDE
    KIRO_CREDS_FILE="~/.aws/sso/cache/kiro-auth-token.json" # IDE授权文件路径
    ...
  4. 安装supervisor

    Terminal window
    brew install supervisor
    Terminal window
    brew services start supervisor
  5. 配置 kiro-gateway 服务到supervisor并启动

    Terminal window
    mkdir -p /opt/homebrew/etc/supervisor.d/ && cd /opt/homebrew/etc/supervisor.d/
    Terminal window
    vim kiro-gateway.ini
    [program:kiro-gateway]
    directory=<kiro-gateway项目路径>
    command=<kiro-gateway项目路径>/.venv/bin/python main.py --port 8989
    autostart=true
    autorestart=true
    startsecs=3
    stopasgroup=true
    killasgroup=true
    stdout_logfile=/tmp/kiro-gateway.out.log
    stderr_logfile=/tmp/kiro-gateway.err.log
    stdout_logfile_maxbytes=50MB
    stderr_logfile_maxbytes=50MB
    stdout_logfile_backups=5
    stderr_logfile_backups=5
    user=<user>
    environment=PYTHONUNBUFFERED="1"
    Terminal window
    supervisorctl reread && supervisorctl update && tail -f /tmp/kiro-gateway.out.log

配置Claude Code CLI环境变量#

Terminal window
vim ~/.claude/settings.json
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "{PROXY_API_KEY}",
"ANTHROPIC_MODEL": "",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "",
"ANTHROPIC_BASE_URL": "http://localhost:8989",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
},
"codemossProviderId": "xxxxxxx"
}
Mac使用Kiro Gate Way反代Kiro IDE模型
https://blog.beocean.net/posts/kiro-gateway/
作者
Beocean
发布于
2026-01-22
许可协议
CC BY-NC-SA 4.0