huangzhenpc 2b29616723
Some checks failed
Build Docker Image / build (push) Has been cancelled
refactor: compact kiro log format (status-first, per-request tracing)
Old format had 9+ lines per request with key=value noise, and concurrent
requests interleaved without any way to tell which line belongs to which
call. The new format:

- Each line starts with the status code/outcome (200, 400, 429, FAIL,
  TIMEOUT, ERR) so success/failure is visible at a glance.
- Every request gets a 6-char hex req_id; all lines for that request
  share it, disambiguating interleaved concurrent traffic.
- Endpoint abbreviated to 2 chars (CW/Q), model stripped of "claude-"
  prefix, attempt compacted to "a1"/"a2".
- Successful requests collapse to 2 lines (REQ start + 200 done with
  first_byte and total elapsed). Retries/errors add one line each.
- Durations use fmtMs: <1s -> "235ms", >=1s -> "2.8s" (one sig fig).

Sample successful request:
  [KiroAPI] REQ  a3f2b1  model=opus-4.7  account=x@y  endpoints=CW,Q
  [KiroAPI] 200  a3f2b1  CW/a1  first_byte=1.2s  total=2.8s

Sample fallback chain:
  [KiroAPI] REQ  b8e3c4  model=opus-4.6  account=x@y  endpoints=Q,CW
  [KiroAPI] 400  b8e3c4  Q /a1  INVALID_MODEL_ID  325ms  retry 1/3
  [KiroAPI] 400  b8e3c4  Q /a2  INVALID_MODEL_ID  242ms  retry 2/3
  [KiroAPI] 400  b8e3c4  Q /a4  INVALID_MODEL_ID  216ms  exhausted -> fallback
  [KiroAPI] 400  b8e3c4  CW/a1  INVALID_MODEL_ID  452ms  retry 1/3
  ...
  [KiroAPI] FAIL b8e3c4  all endpoints failed  2.1s  last=400
2026-05-12 10:42:32 +08:00
2026-05-11 15:58:21 +08:00
2026-05-11 22:31:31 +08:00
2026-05-11 22:31:31 +08:00
2026-05-11 22:31:31 +08:00

Kiro-Go

Go Version Docker License

Convert Kiro accounts to OpenAI / Anthropic compatible API service.

English | 中文

If this project helps you, a Star would mean a lot.

Features

  • Anthropic /v1/messages & OpenAI /v1/chat/completions
  • Multi-account pool with round-robin load balancing
  • Auto token refresh, SSE streaming, Web admin panel
  • Multiple auth: AWS Builder ID, IAM Identity Center (Enterprise SSO), SSO Token, local cache, credentials JSON
  • Usage tracking, account import/export, i18n (CN / EN)
  • Support configuring outbound proxy (SOCKS5 / HTTP)

Quick Start

git clone https://github.com/Quorinex/Kiro-Go.git
cd Kiro-Go
mkdir -p data
docker-compose up -d

Docker Run

docker run -d \
  --name kiro-go \
  -p 8080:8080 \
  -e ADMIN_PASSWORD=your_secure_password \
  -v /path/to/data:/app/data \
  --restart unless-stopped \
  ghcr.io/quorinex/kiro-go:latest

Build from Source

git clone https://github.com/Quorinex/Kiro-Go.git
cd Kiro-Go
go build -o kiro-go .
./kiro-go

Config is auto-created at data/config.json. Mount /app/data for persistence. The default admin password is changeme — override it via the ADMIN_PASSWORD env var or change it in the admin panel before going to production.

Usage

Open http://localhost:8080/admin, log in, add accounts, then call the API:

# Claude
curl http://localhost:8080/v1/messages \
  -H "Content-Type: application/json" \
  -H "anthropic-version: 2023-06-01" \
  -d '{"model":"claude-sonnet-4.5","max_tokens":1024,"messages":[{"role":"user","content":"Hello!"}]}'

# OpenAI
curl http://localhost:8080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer any" \
  -d '{"model":"gpt-4o","messages":[{"role":"user","content":"Hello!"}]}'

Thinking Mode

Append a suffix (default -thinking) to the model name, e.g. claude-sonnet-4.5-thinking. Claude-compatible requests that include a top-level thinking config such as {"type":"enabled","budget_tokens":2048} or {"type":"adaptive"} also enable thinking mode automatically. Configure output format in the admin panel under Settings - Thinking Mode.

Outbound Proxy

For users in restricted network regions, configure an outbound proxy in the admin panel under Settings - Outbound Proxy Settings. Supports SOCKS5 and HTTP proxies.

The setting takes effect immediately without restarting.

Environment Variables

Variable Description Default
CONFIG_PATH Config file path data/config.json
ADMIN_PASSWORD Admin panel password (overrides config) -

Contributing

Friendly discussion is welcome. If you run into issues, try asking Claude Code, Codex, or similar tools for help first — most problems can be solved that way. PRs are even better.

Disclaimer

For educational and research purposes only. Not affiliated with Amazon, AWS, or Kiro. Users are responsible for complying with applicable terms of service and laws. Use at your own risk.

License

MIT

Description
No description provided
Readme MIT 1.1 MiB
Languages
Go 67.9%
HTML 32%
Dockerfile 0.1%