OpenCode plugin for Kiro Gateway with dynamic model discovery, credit usage display, and reasoning effort variants.
At startup, the plugin:
- Connects to your Kiro Gateway and fetches available models from
GET /v1/models - Fetches your credit usage from
GET /v1/credits - Injects discovered models into the opencode
kiroprovider — with capabilities derived from the gateway response - Adds reasoning effort
variantsfor models that support them (e.g., low/medium/high/xhigh/max) - Estimates cost per 1M tokens from the gateway's
rate_multiplier - Never overwrites models you have already configured explicitly
- OpenCode 1.17.7 or newer
- A running Kiro Gateway instance (defaults to
http://localhost:8000) - A Kiro API key (
ksk_*) — generate one from kiro-cli settings - For credit usage and cost display: requires jwadow/kiro-gateway#212 (adds
/v1/creditsendpoint andksk_*API key passthrough)
Add to opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-kiro@git+https://github.com/marcelloceschia/opencode-kiro.git"]
}The plugin reads from the provider.kiro block. All fields are optional.
{
"plugin": ["opencode-kiro@git+https://github.com/marcelloceschia/opencode-kiro.git"],
"provider": {
"kiro": {
"options": {
"baseURL": "https://kiro.example.com/v1",
"apiKey": "{env:KIRO_API_KEY}"
}
}
}
}| Option | Default | Description |
|---|---|---|
options.baseURL |
http://localhost:8000/v1 |
Gateway base URL |
options.apiKey |
— | Kiro API key. Supports {env:VAR} syntax. |
Set your API key as an environment variable:
export KIRO_API_KEY=ksk_your_key_hereOr inline in the config (not recommended for shared configs):
"apiKey": "ksk_your_key_here"The plugin discovers all models the gateway exposes and maps capabilities from the response:
context_window→ context limitmax_output_tokens→ output limitsupported_inputs→ attachment support, modalitiesreasoning_efforts→ reasoning flag + variants (effort levels in model picker)rate_multiplier→ estimated cost per 1M tokens
Model names are annotated with usage info:
Claude Opus 4.8 [150/1000 · 2.2x · ≈$0.044/1MT]
Models with reasoning_efforts get variant entries in the model picker:
claude-opus-4.8 → low, medium, high, xhigh, max
claude-sonnet-4.6 → low, medium, high, max
Any model you define under provider.kiro.models takes precedence over discovery:
{
"provider": {
"kiro": {
"options": { "apiKey": "{env:KIRO_API_KEY}" },
"models": {
"claude-sonnet-4.6": {
"name": "Sonnet (custom)",
"limit": { "context": 200000, "output": 32000 }
}
}
}
}
}/kiro-quota— Check your current Kiro credit usage (plan, credits used/limit, overage, reset date)
All network calls degrade gracefully:
- Gateway unreachable — skips discovery, logs a warning. Manually configured models still work.
- Credits endpoint fails — models still load, but without cost estimates or credit annotations.
MIT