Amanai Provider
Amanai provider plugin for OpenCode (OpenAI-compatible API at https://api.amanai.dev/v1)
0
751
751 in 7 days
37.7
Multi-signal model
1 day ago
2026-10-03
Install and configure
opencode.jsonWrites to this project's opencode.json — applies to this repository only.
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-amanai-provider@1.2.0"]
}Writes to ~/.config/opencode/opencode.json — applies to every project.
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-amanai-provider@1.2.0"]
}If you want to modify the plugin locally, install it into the project and reference the local path.
shell
pnpm add -D opencode-amanai-providerOpenCode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.
An OpenCode plugin that registers the Amanai provider — an OpenAI-compatible API at https://api.amanai.dev/v1 — and discovers the models it serves (currently ~47: GLM, Qwen, Kimi, DeepSeek, MiniMax, Grok, GPT, Claude, and more).
Install
Publish the package once (see Publishing), then install it on any machine:
# From npm
opencode plugin add opencode-amanai-provider
# Or straight from a Git repository
opencode plugin add github:YOUR_GITHUB_USER/opencode-amanai-provider
Restart or reload OpenCode, then select a model with /models, for example
amanai/glm-5.3.
For a local checkout instead of a published package, add the directory to
plugins in your global opencode.jsonc:
{
"$schema": "https://opencode.ai/config.json",
"plugins": ["/absolute/path/to/opencode-amanai-provider"]
}
Authentication
The plugin reads your API key from the AMANAI_API_KEY environment variable:
# PowerShell
$env:AMANAI_API_KEY = "your-key"
opencode service restart
# bash / zsh
export AMANAI_API_KEY="your-key"
opencode service restart
You can also run /connect, choose Amanai, and paste the key. The plugin
registers both an environment method and an interactive key method.
Configuration
| Setting | Default | Purpose |
|---|---|---|
AMANAI_API_KEY |
– | API key. |
AMANAI_BASE_URL |
https://api.amanai.dev/v1 |
Override the endpoint. |
How it works
On setup the plugin fetches GET /models and registers every returned model
with its context window, output limit, and input modalities. A baked-in
inventory is used when discovery is unavailable, and the inventory is refreshed
every six hours.
Amanai advertises the reasoning levels it accepts in each model's thinking
list. The plugin exposes every level except the default (auto) as a model
variant backed by settings.reasoningEffort, so you can pick one with the
#variant selector:
opencode run --model amanai/glm-5.3#high "Review this migration plan"
Run /models to see the available efforts for a model. Levels differ per model
(low/medium/high/xhigh/max, and none/minimal where supported).
Transient failures are retried instead of ending the turn. A request that hits a rate limit, a server error, or loses its connection mid-stream is retried up to five times with exponential backoff and jitter, mirroring the Command Code provider. Client errors such as a bad request or a rejected credential stay terminal.
Publishing
npm login
npm publish --access public
The package name opencode-amanai-provider is free on the public registry; use
a scope such as @yourname/opencode-amanai-provider if you prefer.
Similar plugins
Litellm
@finger_xie/opencode-plugin-litellm
OpenCode plugin for connecting to LiteLLM through an OpenAI-compatible provider.
Model Sync
@chalk_calliope/opencode-model-sync
OpenCode V2 plugin that discovers the latest models from connected OpenAI-compatible providers on server startup.
Omniroute V2
@piyush97/opencode-omniroute-v2
OpenCode v2 plugin for live OmniRoute model discovery, combos, authentication, and metadata.