Open Code
在 OpenCode 中使用 AICodewith
通过 opencode-aicodewith-auth 插件,在 OpenCode 中使用 GPT-5.2 / Claude / Gemini 等模型。
前置条件
- 已安装 OpenCode
- 已获取 AICodewith API Key
安装配置
1. 启用插件
编辑配置文件 ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-aicodewith-auth"]
}- 配置 API Key
运行以下命令:
opencode auth login
按提示操作:
- 选择 Other
- Provider 填 aicodewith
- 输入你的 API Key
使用
指定模型启动:
opencode --model aicodewith/gpt-5.2-codex
或在配置文件中设置默认模型:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-aicodewith-auth"],
"model": "aicodewith/gpt-5.2-codex"
}可用模型
- aicodewith/gpt-5.2-codex — GPT-5.2 Codex
- aicodewith/gpt-5.2 — GPT-5.2
- aicodewith/claude-sonnet-4-5-20250929 — Claude Sonnet 4.5
- aicodewith/claude-opus-4-5-20251101 — Claude Opus 4.5
- aicodewith/gemini-3-pro — Gemini 3 Pro