Amanai Provider
Amanai provider plugin for OpenCode (OpenAI-compatible API at https://api.amanai.dev/v1)
0
751
近 7 天 751
37.7
生态多维模型
1 天前
2026-10-03
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-amanai-provider@1.2.0"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-amanai-provider@1.2.0"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D opencode-amanai-providerOpenCode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
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.
同类生态推荐
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.