在 Continue.dev 中接入树新在线 API 网关
Continue 通过配置文件声明模型提供方,支持 openai 兼容端点。树新在线的 Base URL 为 https://api.treenew.online/v1,可通过 openai provider 接入。
配置
配置文件位置一般在用户目录的 .continue 下,可能为 config.json 或 config.yaml,请以实际版本为准。配置示例如下:
json
{
"models": [
{
"title": "树新在线 gpt-5.6-luna",
"provider": "openai",
"model": "gpt-5.6-luna",
"apiKey": "sk-xxx",
"apiBase": "https://api.treenew.online/v1"
}
]
}其中 API Key 需在 https://api.treenew.online 的「令牌」页创建,模型清单见 https://treenew.online/models/。
关键提醒
Continue 的 autocomplete(tabAutocompleteModel)和 embeddings 相关功能需要额外端点,本站只有 chat/completions,所以自动补全与本地索引/嵌入检索请另配提供方,纯对话与编辑功能不受影响。
验证
curl 示例:
bash
curl https://api.treenew.online/v1/chat/completions \
-H "Authorization: Bearer sk-xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.6-luna",
"messages": [{"role": "user", "content": "测试"}]
}'