idea中增加api中转站教程(Mac,Window通用)

本文我来写Mac教程。

准备工作:

  1. 安装node和npm,这里不再赘述
  2. 安装acp
    npm install -g @zed-industries/codex-acp
  3. idea安装ai插件(需要高版本,我的是2026.1)
  4. 添加自定义 Agent
    1. 在 IDEA 的 AI 插件区域,找到右上角的 三个点(⋮) 菜单按钮并点击。
    2. 在弹出的下拉菜单中,选择 "Add Custom Agent"(添加自定义代理)选项。
    3. 此时会弹出一个新的配置窗口或侧边栏,用于定义一个新的 AI 代理服务器连接。
  5. 配置key和URL
bash 复制代码
{
    "default_mcp_settings": {
        "use_idea_mcp": true
    },
    "agent_servers": {
        "codex-2": {
            "command": "npx",
            "args": [
                "@zed-industries/codex-acp@0.16.0",
                "-c",
                "model_provider=c9token",
                "-c",
                "model=gpt-5.5",
                "-c",
                "model_providers.c9token.name=c9token",
                "-c",
                "model_providers.c9token.base_url=你的中转站URL",
                "-c",
                "model_providers.c9token.env_key=c9token_API_KEY",
                "-c",
                "model_providers.c9token.wire_api=responses",
                "-c",
                "sandbox_mode=danger-full-access",
                "-c",
                "sandbox_workspace_write.network_access=true",
                "-c",
                "approval_policy=never"
            ],
            "env": {
                "c9token_API_KEY": "中转站key"
            },
            "use_idea_mcp": true,
            "use_custom_mcp": true
        },
        "cagent": {
            "command": "/usr/local/bin/cagent",
            "args": [
                "acp",
                "<your_agent.yaml>"
            ]
        }
    }
}

windows教程:https://aicoding.csdn.net/6a238ea310ee7a33f2786fd3.html

相关推荐
小石潭记丶19 小时前
本地mac创建秘钥,然后远程登录Linux服务器
linux·服务器·macos
卓怡学长1 天前
w272基于springboot便民医疗服务小程序
java·spring boot·spring·小程序·intellij-idea
小呀小叮当~1 天前
OpenAI Codex 桌面版(Windows / macOS)体验分享:AI 编程效率再次提升
人工智能·windows·macos
myenjoy_11 天前
I2S 音频与数字音频接口详解
macos·音视频·xcode
星野爱8952 天前
崩坏星穹铁道4.4版本即将前瞻!Mac畅玩PC端开荒新版本
macos
funnycoffee1232 天前
lacp报文占多少字节?报文的目的mac
网络·网络协议·macos
卓怡学长2 天前
w273基于springboot的智能笔记的开发与应用
java·spring boot·spring·intellij-idea
itwangyang5202 天前
Claude Code macOS 安装完整指南:Homebrew、原生脚本与常见问题解决
macos
汤姆yu3 天前
macOS系统下Aider完整安装、配置与实战使用教程
大数据·人工智能·算法·macos·github·copilot