106 lines
3.4 KiB
Markdown
106 lines
3.4 KiB
Markdown
# Kiro-Go
|
|
|
|
[](https://go.dev/)
|
|
[](https://www.docker.com/)
|
|
[](LICENSE)
|
|
|
|
Convert Kiro accounts to OpenAI / Anthropic compatible API service.
|
|
|
|
[English](README.md) | [中文](README_CN.md)
|
|
|
|
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
|
|
|
|
### Docker Compose (Recommended)
|
|
|
|
```bash
|
|
git clone https://github.com/Quorinex/Kiro-Go.git
|
|
cd Kiro-Go
|
|
mkdir -p data
|
|
docker-compose up -d
|
|
```
|
|
|
|
### Docker Run
|
|
|
|
```bash
|
|
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
|
|
|
|
```bash
|
|
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:
|
|
|
|
```bash
|
|
# 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.
|
|
|
|
## Friend Links
|
|
|
|
- [LINUX DO](https://linux.do)
|
|
|
|
## 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](LICENSE)
|