供应商配置
配置 AI 供应商连接 Tron
概述
Tron 支持多种 AI 供应商,包括 Anthropic Claude、OpenAI、Google Gemini 和 TronCode 托管服务。你可以根据需求选择合适的供应商,也可以在使用过程中随时切换。
TronCode(推荐)
TronCode 是由 Tron 团队提供的精选模型托管服务,汇集了多家顶级 AI 供应商的优质模型,经过严格质量筛选,确保稳定性和性能。
在 TUI 中使用 /connect 命令,选择 troncode,然后访问 platform.troncode.cn 获取 API Key。
也可以直接通过环境变量设置:
设置好环境变量后,启动 Tron 即可自动使用 TronCode 服务。
Anthropic
直接使用 Anthropic 提供的 Claude API,无需经过任何中间层。访问 console.anthropic.com 创建 API Key。
在 TUI 中运行 /connect,选择 anthropic,然后粘贴你的 API Key 即可完成配置。
OpenAI
使用 OpenAI API,支持 GPT-4o、GPT-4o-mini 等模型。访问 platform.openai.com 获取 API Key。
在 TUI 中运行 /connect,选择 openai,输入 API Key 完成配置。
Google Gemini
使用 Google 提供的 Gemini API,支持 Gemini 2.0 Flash、Gemini 1.5 Pro 等模型。访问 aistudio.google.com 获取 API Key。
在 TUI 中运行 /connect,选择 google,输入 API Key 完成配置。
切换供应商
你可以在使用过程中随时切换供应商,无需重启 Tron。
在 TUI 中运行 /connect 命令,即可重新选择供应商和模型:
也可以在 ~/.config/tron/config.json 中设置默认供应商,这样每次启动 Tron 时会自动使用该供应商:
{
"provider": "troncode",
"model": "claude-opus-4-6"
}