KiroGate banner
aliom-v aliom-v

KiroGate

Development community

Description

OpenAI & Anthropic 兼容的 Kiro IDE API 代理网关,支持 Claude Code CLI

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

KiroGate

**OpenAI & Anthropic 兼容的 Kiro IDE API 代理网关**

[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0) [![Deno](https://img.shields.io/badge/Deno-2.x-blue.svg)](https://deno.land/)

*通过任何支持 OpenAI 或 Anthropic API 的工具使用 Claude 模型*

[功能特性](#-功能特性) • [快速开始](#-快速开始) • [配置说明](#%EF%B8%8F-配置说明) • [API 参考](#-api-参考) • [部署](#-部署)


**致谢**: 本项目基于 [kiro-openai-gateway](https://github.com/Jwadow/kiro-openai-gateway) by [@Jwadow](https://github.com/jwadow) 开发,整合 [kiro-account-manager](https://github.com/dext7r/kiro-account-manager) 全部功能。


✨ 功能特性

  • 双 API 兼容 — 同时支持 OpenAI (/v1/chat/completions) 和 Anthropic (/v1/messages) 格式
  • 完整流式传输 — SSE 流式响应,支持 Thinking 标签解析
  • 工具调用 — 完整的 Function Calling / Tool Use 支持
  • 多账号智能调度 — 账号池 + 健康分数 + 自动故障转移 + 配额追踪
  • 多租户认证 — 简单 API Key / 组合模式 / 托管 API Key 三种认证方式
  • 上下文压缩 — 三层缓存 + AI 摘要,自动压缩超长对话
  • 熔断器 + 限流 — 令牌桶限流 + 熔断器模式保护后端
  • 管理面板 — 内置 Web UI,账号管理、API Key 管理、Dashboard 监控
  • 零外部依赖 — Deno 原生运行,内置 KV 存储,无需 Redis/数据库

📁 项目结构

kirogate/
├── main.ts              # 入口 + HTTP 路由 + 管理 API
├── lib/
│   ├── types.ts         # 类型定义
│   ├── kiroApi.ts       # Kiro API 客户端(双端点、DNS 缓存、机器码)
│   ├── accountPool.ts   # 多账号智能调度池
│   ├── translator.ts    # 格式转换(OpenAI ↔ Kiro ↔ Claude)
│   ├── stream.ts        # 流处理(AWS Event Stream + SSE)
│   ├── compressor.ts    # 上下文压缩(三层缓存 + AI 摘要)
│   ├── storage.ts       # Deno KV 存储层
│   ├── rateLimiter.ts   # 令牌桶限流
│   ├── errorHandler.ts  # 错误分类 + 熔断器
│   ├── logger.ts        # 日志系统
│   └── pages.ts         # 嵌入式 HTML 前端页面
├── deno.json            # Deno 配置
├── Dockerfile
└── docker-compose.yml

🚀 快速开始

环境要求

本地运行

# 设置环境变量
export PROXY_API_KEY="your-secret-api-key"
export ADMIN_PASSWORD="your-admin-password"

# 启动服务
deno run --allow-net --allow-env --unstable-kv main.ts

# 或使用 deno task
deno task start

# 开发模式(自