1. IDEs and AI Programming Assistants
TreeRouter
  • 价格-充值-分组-模型价格介绍
    TREEROUTER
  • 站点操作指南-快速上手调用大模型API
    TREEROUTER
  • 中文文档
    • FAQ常见问题
      • 问题自查方法
      • 入门必看
        • 我注册并且充值了,key 在哪?
        • 如何充值?
        • 可以使用哪些大模型 API ?
        • 如何获取 OpenAI Key ? 如何获取 Claude Key ? 如何获取 Gemini Key ?等等
        • 怎么更换模型使用?
        • 接口在中国大陆能使用吗?
        • 按量计费还是按月支付?
        • 配置模型的时候 URL 用哪个?
        • 怎么检查一次调用消耗了多少 Token?
        • 请问我余额为负了怎么回事?
      • 常见误区
        • 明明余额还有很多,为什么显示令牌无法使用?
        • Key 为什么不能用?为什么我调用 API 没反应?
        • 新建令牌参数怎么填?
        • 为什么调用接口返回“无效的令牌”?
        • API 接口返回报错,报错代码 400 401 403 404 405 413 429 500 503 504 524 是什么意思?
    • 软件/插件 配置treerouter教程
      • IDE 与 AI 编程助手 (IDE & Coding Assistants)
        • vscode接入treerouter教程
        • gemini cli 配置教程
        • Trae 配置使用 API 教程
        • Cursor接入4treerouter教程
        • opencode接入treerouter教程
        • GPT-codex安装教程
        • claudecode安装教程(win/mac)
        • cc+ccs配置deepseek|glm模型
      • 桌面级 AI 客户端 (Desktop Clients)
        • Claude Desktop 配置 treerouter教程(测试中)
        • WorkBuddy 接入treerouter教程
        • treerouter接入chatbox
        • treerouter接入Cherry Studio
      • 工作流与自动化工具 (Workflows & Automation)
        • Coze 配置使用 treerouter 教程
        • Dify 配置使用 treerouter教程
        • n8n配置使用treerouter教程
        • cc switch使用教程
        • open claw在云服务器linux环境下通过终端配置api
      • 开源项目与高级部署 (Open Source & Infrastructure)
        • Hermes Agent linux安装接入treerouter教程
        • 腾讯云openclaw接入treerouter教程
        • OpenClaw 接入 API 教程
    • 模型接口
      • Openai
        • 文本生成
        • 文本生成---上下文阅读
        • 图片理解
        • 图片生成(gpt-image-2)
        • 图片生成(gpt-image-1)
        • 图片编辑/edits
        • 图片编辑 / 网页版
        • 函数调用 tools
        • v1/Responses / 通用
        • 创建文本嵌入
        • 批量创建嵌入
        • 文本转语音 / TTS
        • 语音转文本 / whisper-1
        • 语音转文本 / gpt-4o-transcribe
        • 音频翻译
        • Audio接口 / 输出
        • Audio接口 / 输入
        • 内容补全接口
        • 创建内容审核
        • PDF文件分析
        • deep-research / 深度研究
        • Web search / 联网搜索
        • response_format
        • 图像编辑(gpt-image-2)
      • Anthropic
        • 原生接口
          • 文本生成 (思考配置)
          • 图片理解
          • 文本生成
          • 文本生成 / 强制返回思考
          • 函数调用
          • Web search / 联网搜索
        • OpenAI兼容接口
          • 文本生成
          • 图片理解
          • 文本生成 / 强制返回思考
          • 函数调用
          • Web search / 联网搜索
      • Google
        • OpenAI兼容接口(推荐)
          • 文本生成
          • 文本生成 / 强制返回思考
          • 图片理解
          • 图片生成
          • 图片修改
          • 图片生成 / Imagen 4
          • 音频理解
          • 视频理解
          • 文本转语音 / TTS
          • 图片编辑(Nano-banana)
          • 图片编辑(Nano-banana) base64格式
        • Google Gemini接口
          • 文本生成
          • 文字转语音
          • 音频转文
          • 视频转文
          • 图片理解
          • 文生图片(nanobanana pro)
          • 图片编辑(nanobanana)
          • 图片编辑(nanobanana pro)
        • 视频生成
          • 创建视频任务
          • 轮询任务状态
          • 下载 MP4
      • Midjourney
        • openai兼容/chat格式
          • MJ视频 (chat格式)
        • 原生接口
          • 文生图(Imagine)
          • 图片融合(Blend)
          • 按钮点击(Action)
          • 窗口执行(Modal)
          • 生成视频(Video)
          • 图生文(Describe)
          • 编辑图片(Edit)
          • 上传(upload)
          • 换脸(FaceSwap)
          • 缩短提示词(Shorten)
          • 查询
          • 获取种子(Seed)接口
          • 批量查询
          • 文生图 / OpenAI兼容
      • FLUX
        • /fal-ai/nano-banana 文生图
        • /fal-ai/nano-banana/edit 图片编辑
      • 文生图接口
        • flux / OpenAI兼容接口
        • flux-kontext-pro / OpenAI兼容接口
        • stable-diffusion / OpenAI兼容接口
        • ideogram / OpenAI兼容接口
        • recraftv3 / OpenAI兼容接口
        • flux携带参考图 / OpenAI兼容接口
      • Suno
        • 场景一:stems声曲分离 Vocals Instrumental
        • 生成歌曲
        • 生成歌词
        • 查询任务状态(批量)
        • 查询任务状态(单个)
      • 3D模型
        • Hunyuan3D-2
      • veo
        • 图生视频
        • 文生视频
        • 查询视频生成状态
        • 图生视频(chat格式)
      • 豆包
        • doubao-seedream-4-0-250828-文生图
        • doubao-seedream-4-0-250828-图生图
        • doubao-seedream-4-0-250828-多图生图
      • sora
        • 官方异步格式
          • 创建视频任务
          • 获取视频任务状态
          • 编辑视频(remix)
          • 获取视频内容
        • 渠道异步格式
          • 创建视频任务
          • 获取视频任务状态
          • 转存视频
          • 创建视频(带 Character)
          • 编辑视频(remix)
          • 获取视频内容
          • 创建视频任务 Copy
          • 从已生成的任务中创建角色
          • 使用故事板创建视频
        • chat格式
          • 创建绘画
        • 创建角色接口
          • 创建角色
      • FLUX
        • Flux(Dalle3 Edits(图生图&文生图))
        • Flux 创建(OpenAI dall-e-3格式)
    • 个人API接口文档
      • 获取个人token
      • 一、个人信息
        • 1. 获取个人信息
        • 2. 修改个人信息
        • 3. 注销账户
        • 4. 获取可用模型列表
        • 5. 获取用户分组
        • 6. 更新用户设置(额度预警等)
        • 7. 生成系统访问令牌
      • 二、令牌管理(API Key)
        • 1. 获取令牌列表
        • 2.搜索令牌
        • 3. 获取单个令牌
        • 4.创建令牌
        • 5.更新令牌
        • 6. 删除令牌
        • 7.批量删除令牌
        • 8.获取单个令牌(明文显示)
      • 三、日志与统计
        • 1. 查看个人使用日志
        • 2. 个人日志统计
        • 3. 令牌每日消耗
        • 4. 令牌模型消耗预览(Top 3)
        • 5. 令牌全量模型消耗
        • 6. 导出令牌每日消耗 XLSX
        • 7. 个人额度时序数据
  • Englische Dokumentation
    • Desktop AI client
      • Claude Desktop Configuration treerouter Tutorial (in testing)
      • treerouter Access chatbox
      • treerouter Access Cherry Studio
      • WorkBuddy Access treerouter Tutorial
    • Open-Source Projects and Advanced Deployment
      • Hermes Agent Linux Installation and Access treerouter Tutorial
      • OpenClaw Access API Tutorial
      • Tencent Cloud OpenClaw Access treerouter Tutorial
    • Workflow and Automation Tools
      • cc_switch Usage Tutorial
      • Coze Configuration and Usage of treerouter Tutorial
      • Dify Configuration and Usage of treerouter Tutorial
      • n8n Configuration and Usage of treerouter Tutorial
      • Open Claw Configure API via Terminal in Cloud Server Linux Environment
    • IDEs and AI Programming Assistants
      • cc+ccs Configuration deepseek|glm model
      • claudecode Installation Tutorial (win/mac)
      • Cursor Access 4treerouter Tutorial
      • gemini cli 配置教程
      • GPT-codex Installation Tutorial
      • opencode接入treerouter教程
      • Trae 配置使用 API 教程
      • vscode接入treerouter教程
  • 数据模型
    • 示例数据模型
      • 未命名数据模型
      • Pet
      • Category
      • Tag
  1. IDEs and AI Programming Assistants

GPT-codex Installation Tutorial

Path#

treerouter

Content#

GPT-codex Installation#

Prerequisites:
A treerouter GPT-codex key/token (key)
Install GPT-codex:
To install GPT-codex, please follow these two processes:
1. Local installation (recommended)
macOS, Linux, WSL, Windows PowerShell, Windows CMD:
2. Environment Variable Configuration
Custom api and key (win)
Custom api and key (mac)

1. Codex Configuration#

Create a configuration file config.toml
You can use any editor available on your computer, such as nano, vim, code (VS Code), etc., or you can create the config.toml file directly under the .codex directory.
Run the following code in the installation directory:

code .codex/config.toml#

Paste the following configuration in config.toml, and modify it according to your needs:#

2. Add apikey environment variable#

Method 1: Using the command line (for those accustomed to the command line)#

Both Windows Command Prompt (CMD) and PowerShell can do this. The setx command is recommended. setx is used to permanently set environment variables.
Important note: setx will write the variable to the registry. It will affect all command prompt windows opened in the future, but it will not affect the current window. Therefore, you need to reopen a new terminal window (win+R, enter cmd and press Enter) after the operation:
Use setx for permanent setting (equivalent to editing .bashrc)
Operation steps (Open and execute in CMD):
Set the first variable setx 4SAPI_API_KEY "sk "
image.png
Important: After the setting is completed, you need to close all opened CMD or PowerShell windows, and then reopen a new window so that the new environment variable will take effect.

Method 2: Using Graphic User Interface (GUI) (Recommended for all Windows users)#

This is the most intuitive and least error-prone method.
Open "System Properties" Press the Windows key + R key on the keyboard to open the "Run" dialog box. Enter sysdm.cpl and then press Enter.
图片2.png
Enter "Environment Variables" settings In the opened "System Properties" window, switch to the "Advanced" tab. Click the "Environment Variables..." button in the lower right corner.
image.png
Add a new user variable In the pop-up "Environment Variables" window, the upper half is "User variables for (your username)". Click the "New (N)..." button. Variable name (N): 4SAPI_API_KEY Variable value (V): sk-... (your key) Click "OK".
image.png
image.png
Save and close Click "OK" in the "Environment Variables" window. Click "OK" in the "System Properties" window.
Important: After completing the setting through the GUI, you need to close all opened CMD or PowerShell windows, and then reopen a new window so that the new environment variable will take effect.
How to open GPT-codex:
Open a new terminal, enter codex "Hello" and press enter. When something similar to the following appears, the configuration is successful and can be used normally.

image.png
Start using GPT-codex:
Open a new terminal, enter codex and press enter.
修改于 2026-05-12 03:21:36
上一页
gemini cli 配置教程
下一页
opencode接入treerouter教程
Built with