Repository navigation
v0.0.1
Release v0.0.1
Initial release of kirocc - a local proxy server that relays Anthropic Messages API-compatible requests to the Kiro (Amazon Q) backend using Kiro CLI credentials.
Features
Anthropic Messages API Proxy
/v1/messagesendpoint with streaming and non-streaming support/v1/messages/count_tokensendpoint (approximate token count via tiktoken)/v1/modelsendpoint for listing available models
Request Conversion
- Automatic conversion of Anthropic API requests to Kiro API (AWS Event Stream) format
- Message normalization (merge consecutive same-role messages, extract multi-block content)
- Tool and JSON Schema conversion with sanitization (removes unsupported keywords, flattens anyOf/oneOf/allOf)
- System prompt extraction and placement as history entry pair
- Tool result reordering to match assistant tool_use order
- Anthropic tool-level
cache_controlto KirocachePointconversion
Response Conversion
- AWS Event Stream binary frame parsing
- Cumulative-to-incremental text delta conversion
<thinking>tag parsing fromassistantResponseEventandreasoningContentEvent(with deduplication)- Adapter-side
stop_sequencesandmax_tokensenforcement - Truncation detection with automatic notice injection into the next request
- Gate Writer: buffered output enabling transparent retry of thinking-only responses
Extended Thinking
- Support for
[1m]model suffix,thinkingfield, andreasoning_effort/budget_tokens - Thinking parameters injected as XML tags into message content
- Configurable budget via
reasoning_effortlevels (high/medium/low) or explicitbudget_tokens
Model Mapping
- Automatic mapping of Anthropic model names to Kiro model names
- Customizable mappings via
KIROCC_MODEL_MAPPINGSenvironment variable - Thinking-enabled models automatically append
-1msuffix
Authentication
- Automatic credential reading from Kiro CLI's SQLite DB
- Automatic token refresh (Social / OIDC)
- Optional API key auth for proxy access
Reliability
- Exponential backoff retry for 403 (token expiry), 429, and 5xx errors
- Automatic retry of thinking-only (empty visible) responses
Other
- CORS support for localhost origins
- Configurable via CLI flags and environment variables
- Health check endpoint
Upgrade Instructions
Homebrew
brew install d-kuro/tap/kiroccgo install
go install github.com/d-kuro/kirocc/cmd/kirocc@v0.0.1