CONNECT & CREATE

从这里,开始第一次调用。Your first request starts here.

选好工具和系统,剩下的跟着做。Pick your tool and operating system. We’ll guide you through the rest.

  1. 01选工具Pick a tool
  2. 02填配置Configure
  3. 03开始使用Get started
还不知道选哪个?Not sure where to start?我想直接对话I want to chatChatbox ↗我想辅助编程I want coding helpClaude Code ↗
接入指南Setup guide

Claude Code

官方文档Official docs ↗

Windows 使用 PowerShell;macOS / Linux 使用终端。已有安装可以跳过安装步骤。Use PowerShell on Windows, or Terminal on macOS / Linux. Already installed? Skip the installation step.

你的操作系统Your operating system
安装方式Installation methods

无需安装 Node.js。已有 npm 版本的用户,可切换到 npm 安装查看对应步骤。No Node.js installation is needed. If you already use the npm version, select npm install for its instructions.

需要 Node.js 22 或更新版本。安装方式只需选择一种,后续接入配置相同。Requires Node.js 22 or later. Choose one installation method; the connection settings are the same. 下载 Node.jsDownload Node.js ↗ npm 更新与卸载npm updates and uninstall ↓

开始前,准备这两项Have these two things ready

选择支持 Claude 的分组,协议为 Anthropic Messages。Choose a Claude group using the Anthropic Messages protocol.

接入地址已填入下方示例The endpoint is already in the examples查看地址View endpoint ↓
API Base URLtext
https://newapi.world

已使用根地址,按下面示例填写。The root address is already set. Follow the examples below. 切换线路与地址规则Endpoints and address formats ↗

跟着步骤完成接入Follow these steps to connect

已有安装?从配置步骤开始即可Already installed? Start with configuration

先替换示例中的密钥和模型;出现 your-project 时,改成你自己的项目文件夹路径。Replace the key and model placeholders first. Replace your-project with the path to your own project folder.

安装 Claude CodeInstall Claude Code

在终端中运行Run in your terminal · Bash / Zsh
curl -fsSL https://claude.ai/install.sh | bash
claude --version

安装 Claude CodeInstall Claude Code

在终端中运行Run in your terminal · PowerShell

安装后若找不到 claude 命令,请重新打开终端。If the claude command is not found after installation, open a new terminal.

irm https://claude.ai/install.ps1 | iex
claude --version

检查 Node.js 与 npmCheck Node.js and npm

在终端中运行Run in your terminal · Bash / Zsh

Node.js 需要 22 或更新版本。若命令未找到,请先通过上方链接安装 Node.js,再重新打开终端执行这两行。Node.js 22 or later is required. If either command is not found, install Node.js using the link above, reopen your terminal, and run these two commands.

node --version
npm --version

通过 npm 安装 Claude CodeInstall Claude Code with npm

在终端中运行Run in your terminal · Bash / Zsh

Windows PowerShell、macOS 与 Linux 终端使用同一组 npm 命令。显示 Claude Code 版本号即安装成功,再继续填写本站连接信息。原生安装与 npm 安装选择一种即可。Use these npm commands in Windows PowerShell, macOS, or Linux. Once the Claude Code version is printed, continue with the portal connection settings. Choose either native or npm installation.

npm install -g @anthropic-ai/claude-code
claude --version

填写连接信息并启动Configure and start

在终端中运行Run in your terminal · Bash / Zsh
export ANTHROPIC_BASE_URL="https://newapi.world"
export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"
cd your-project
claude --model "YOUR_MODEL_ID"

填写连接信息并启动Configure and start

在终端中运行Run in your terminal · PowerShell
$env:ANTHROPIC_BASE_URL = "https://newapi.world"
$env:ANTHROPIC_AUTH_TOKEN = "YOUR_API_KEY"
Set-Location your-project
claude --model "YOUR_MODEL_ID"

检查生效的地址与模型Check the active URL and model

在工具对话框中输入Enter in the tool’s chat

启动后输入 /status,检查地址、模型与鉴权来源,再发一条简短消息,到用量明细确认记录。若存在旧 API Key 或云平台配置,先检查冲突来源。Run /status to check the URL, model, and credential source. Send a short message and confirm its usage record. Check for conflicting keys or cloud provider settings if needed.

/status

最后,确认请求确实走了本站Finally, check that your request used this portal

发送一条简短消息,再到用量明细核对这把 Key 的记录。出现记录才说明本站收到请求,测试调用按实际规则计费。Send a short message, then check this key in Usage. A matching record confirms the portal received your request. Test requests are billed normally.

查看用量View usage ↗
更多配置方式More setup options已有配置、其他安装方式与可选设置Existing setups, alternative installs, and optional settings

可选:保存到个人设置文件Optional: save to your user settings

编辑配置文件Edit the configuration file

合并到 ~/.claude/settings.json;Windows 为 %USERPROFILE%\.claude\settings.json。保留已有设置,勿写入项目中共享的 .claude/settings.json。Merge into ~/.claude/settings.json, or %USERPROFILE%\.claude\settings.json on Windows. Preserve existing settings. Keep credentials out of a project’s shared .claude/settings.json.

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://newapi.world",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY"
  },
  "model": "YOUR_MODEL_ID"
}
适用范围与配置说明Compatibility and configuration notes遇到版本差异时查看Check when versions differ

使用支持 Anthropic Messages 的分组和 Claude 模型。根地址不加 /v1,也不加 /messages。Use a Claude model in an Anthropic Messages group. The root URL must not include /v1 or /messages.

原生安装与 npm 安装选择一种,再按操作系统配置连接。环境变量仅对当前终端及其启动的程序生效。Choose either native or npm installation, then follow the connection steps for your OS. Environment variables apply only to the current terminal and programs launched from it.

更新、卸载与清理Update, uninstall and clean up按需执行,不属于接入步骤Optional maintenance, separate from setup

安装、更新与清理Install, update and clean up

持久化变量与缓存Persistent variables and caches ↗

先确认原来的安装方式,再展开对应选项。安装、更新和卸载按需执行,无需依次运行。Identify your installation method and expand its option. Choose the operation you need; do not run install, update and uninstall in sequence.

官方原生安装Official native installermacOS / Linux / WSL

原生版支持自动更新,也可手动更新。卸载命令仅适用于默认安装路径,会移除程序及版本文件,个人设置和会话保留。Native installations support automatic and manual updates. These uninstall commands apply only to the default path and remove the program and version files while keeping personal settings and sessions.

安装Install

curl -fsSL https://claude.ai/install.sh | bash
claude --version

更新Update

claude update
claude --version

卸载程序Uninstall the program

rm -f "$HOME/.local/bin/claude"
rm -rf "$HOME/.local/share/claude"
官方原生安装Official native installerWindows PowerShell

使用默认原生安装路径。先关闭 Claude Code;安装后命令未找到时重新打开终端。卸载会逐项要求确认。Uses the default native installation paths. Close Claude Code first. Reopen the terminal if the installed command is not found. Uninstallation asks for confirmation.

安装Install

irm https://claude.ai/install.ps1 | iex
claude --version

更新Update

claude update
claude --version

卸载程序Uninstall the program

Remove-Item -LiteralPath "$env:USERPROFILE\.local\bin\claude.exe" -Confirm
Remove-Item -LiteralPath "$env:USERPROFILE\.local\share\claude" -Recurse -Confirm
Homebrew 安装Homebrew installationmacOS

仅适用于使用 Homebrew 安装的版本。安装与更新使用同一个包名,避免与 npm 或原生安装重复。For Homebrew installations only. Use the same package name to install and upgrade; avoid duplicate npm or native installations.

安装Install

brew install --cask claude-code

更新Update

brew upgrade --cask claude-code

卸载程序Uninstall the program

brew uninstall --cask claude-code
WinGet 安装WinGet installationWindows PowerShell

仅适用于 WinGet 安装。先退出正在运行的 Claude Code,再更新或卸载。For WinGet installations only. Exit Claude Code before updating or uninstalling.

安装Install

winget install --id Anthropic.ClaudeCode --exact

更新Update

winget upgrade --id Anthropic.ClaudeCode --exact

卸载程序Uninstall the program

winget uninstall --id Anthropic.ClaudeCode --exact
npm 全局安装Global npm installationmacOS / Linux / Windows

适用于 npm 安装,需要 Node.js 22 或更新版本。更新前先退出正在运行的 Claude Code,再更新同一个包;卸载程序会保留个人配置与会话。下方登录、配置与数据清理按需执行。For npm installations; Node.js 22 or later is required. Close running Claude Code sessions before upgrading the same package. Uninstalling preserves personal settings and sessions. Use the credential, configuration, and data cleanup options below only as needed.

安装Install

npm install -g @anthropic-ai/claude-code
claude --version

更新Update

npm install -g @anthropic-ai/claude-code@latest
claude --version

卸载程序Uninstall the program

npm uninstall -g @anthropic-ai/claude-code
版本与安装位置Version and installation location

macOS / Linux:查看版本与命令位置macOS / Linux: check version and command locations

type -a claude
claude --version

Windows PowerShell:查看版本与命令位置Windows PowerShell: check version and command locations

Get-Command claude -All | Select-Object CommandType, Source
claude --version

检查安装与更新状态Check installation and update status

如果存在多个 claude 路径,先确认实际使用哪一份,再更新对应的安装。If multiple claude commands are found, identify the active installation before updating it.

claude doctor
登录、配置与数据清理Login, configuration and data cleanup

退出已保存的官方登录Sign out of your saved official account

在卸载前运行。使用门户 Key 时,还需清除接入变量或个人 settings.json 中对应的 env 项;退出登录不会撤销门户 Key。Run before uninstalling. For a portal key, also clear connection variables or matching env entries in your personal settings.json. Signing out does not revoke the portal key.

claude auth logout

macOS / Linux:清除当前终端的接入变量macOS / Linux: clear connection variables in this terminal

关闭工具后执行,再从同一终端重新启动。若变量写入 ~/.zshrc、~/.bashrc 或工具配置,也需编辑对应文件移除;此命令只影响当前终端。Close the tool, run these commands, then restart it from this terminal. Also remove matching entries from ~/.zshrc, ~/.bashrc or tool settings if saved there. These commands affect only the current terminal.

unset ANTHROPIC_BASE_URL ANTHROPIC_AUTH_TOKEN ANTHROPIC_API_KEY

Windows PowerShell:清除当前终端的接入变量Windows PowerShell: clear connection variables in this terminal

如果曾保存为用户环境变量,再到下方的“持久化变量与缓存”清理。关闭旧终端,重新登录系统后再验证。For saved user variables, also follow Persistent variables and caches below. Close old terminals and sign in to the operating system again before checking.

Remove-Item Env:ANTHROPIC_BASE_URL -ErrorAction SilentlyContinue
Remove-Item Env:ANTHROPIC_AUTH_TOKEN -ErrorAction SilentlyContinue
Remove-Item Env:ANTHROPIC_API_KEY -ErrorAction SilentlyContinue

预览指定项目的本地记录清理Preview local record cleanup for one project

此命令形式适用于 Claude Code 2.1.288 及以上,旧版曾使用 claude project purge。先用 --version 和 --help 核对支持情况,再替换为目标项目路径进行预览;此步骤不会删除。This syntax applies to Claude Code 2.1.288 and later; older versions used claude project purge. Check --version and --help first, then replace the project path to preview the cleanup. This step does not delete anything.

claude purge "YOUR_PROJECT_PATH" --dry-run

确认清理指定项目的本地记录Confirm local record cleanup for one project

关闭该项目的 Claude 会话,核对上一步预览后逐项确认。会删除本地会话与相关状态,无法用来恢复对话;项目源代码不是此命令的清理对象。Close Claude sessions for this project, review the preview, then confirm each item. Local conversations and related state are deleted and cannot be resumed. This command does not target project source code.

claude purge "YOUR_PROJECT_PATH" --interactive

可选:重置个人数据(macOS / Linux)Optional: reset personal data (macOS / Linux)

仅限默认用户目录。先关闭 Claude Code、相关 IDE 插件和桌面应用。此操作把设置、MCP、技能及会话移到私人备份目录,重新启动后会重新建立数据;备份仍占空间,可能含凭据。确认不再需要后再手动删除备份。项目里的 .claude、CLAUDE.md 和 .mcp.json 需单独检查。For default user directories only. Close Claude Code and related IDE and desktop apps. Settings, MCP, skills and sessions move to a private backup; new data is created on restart. Backups still use disk space and may contain credentials. Delete them manually only when no longer needed. Check project .claude, CLAUDE.md and .mcp.json separately.

cli_backup_dir="$HOME/claude-backup-$(date +%Y%m%d-%H%M%S)"
if (umask 077; mkdir "$cli_backup_dir"); then
  [ ! -e "$HOME/.claude" ] || mv -i "$HOME/.claude" "$cli_backup_dir/"
  [ ! -e "$HOME/.claude.json" ] || mv -i "$HOME/.claude.json" "$cli_backup_dir/"
fi

可选:重置个人数据(Windows PowerShell)Optional: reset personal data (Windows PowerShell)

关闭相关程序后执行;会移走默认用户目录里的设置和会话,保留备份。仅在重置故障配置或清除本机数据时使用,日常更新无需执行。备份可能包含密钥,不要上传。Close related apps first. Settings and sessions in default user directories are moved into a backup. Use only to reset broken configuration or clear local data, not for routine updates. Backups may contain keys; do not upload them.

$cliBackupDir = Join-Path $env:USERPROFILE ("claude-backup-" + [guid]::NewGuid().ToString("N"))
New-Item -ItemType Directory -Path $cliBackupDir -ErrorAction Stop | Out-Null
foreach ($cliPath in @("$env:USERPROFILE\.claude", "$env:USERPROFILE\.claude.json")) {
  if (Test-Path -LiteralPath $cliPath) { Move-Item -LiteralPath $cliPath -Destination $cliBackupDir -ErrorAction Stop }
}
接入指南Setup guide

Codex

官方文档Official docs ↗

先安装 Node.js 与 npm,再打开终端。已有 Codex 可以跳过安装步骤。Install Node.js and npm, then open a terminal. If Codex is already installed, skip installation.

你的操作系统Your operating system

开始前,准备这两项Have these two things ready

选择支持 Responses、流式输出和工具调用的分组。Choose a group supporting Responses, streaming, and tool calls.

接入地址已填入下方示例The endpoint is already in the examples查看地址View endpoint ↓
API Base URLtext
https://newapi.world/v1

已包含 /v1,按下面示例填写。The address already includes /v1. Follow the examples below. 切换线路与地址规则Endpoints and address formats ↗

跟着步骤完成接入Follow these steps to connect

已有安装?从配置步骤开始即可Already installed? Start with configuration

先替换示例中的密钥和模型;出现 your-project 时,改成你自己的项目文件夹路径。Replace the key and model placeholders first. Replace your-project with the path to your own project folder.

安装工具Install the tool

在终端中运行Run in your terminal · Bash / Zsh
npm install -g @openai/codex
codex --version

编辑 ~/.codex/config.toml(保留其他已有配置)Edit ~/.codex/config.toml (keep other existing settings)

编辑配置文件Edit the configuration file

Windows 打开 %USERPROFILE%\.codex\config.toml;macOS / Linux 打开 ~/.codex/config.toml。不存在时先创建目录与文件;设置过 CODEX_HOME 时使用该目录。将根级字段放在第一个表之前,合并同名字段,不要覆盖其他配置。On Windows, open %USERPROFILE%\.codex\config.toml; on macOS / Linux, open ~/.codex/config.toml. Create the directory and file if missing. If CODEX_HOME is set, use that directory. Keep root fields before the first table, merge matching fields, and preserve other settings.

model = "YOUR_MODEL_ID"
model_provider = "portal"
web_search = "disabled"

[model_providers.portal]
name = "NewAPI"
base_url = "https://newapi.world/v1"
wire_api = "responses"
env_key = "PORTAL_API_KEY"

填写密钥并启动Set your key and start

在终端中运行Run in your terminal · Bash / Zsh
export PORTAL_API_KEY="YOUR_API_KEY"
cd your-project
codex

填写密钥并启动Set your key and start

在终端中运行Run in your terminal · PowerShell
$env:PORTAL_API_KEY = "YOUR_API_KEY"
Set-Location your-project
codex

检查当前提供方Check the active provider

在工具对话框中输入Enter in the tool’s chat

确认 provider 为 portal,模型与配置一致。先测试简短对话,再测试流式回复和一次工具调用;到用量明细核对。自定义模型别名可能还需要管理员提供模型目录文件。Confirm provider portal and your model. Test a short conversation, streaming, and a tool call, then check usage. Custom model aliases may need a model catalog supplied by your administrator.

/status

最后,确认请求确实走了本站Finally, check that your request used this portal

发送一条简短消息,再到用量明细核对这把 Key 的记录。出现记录才说明本站收到请求,测试调用按实际规则计费。Send a short message, then check this key in Usage. A matching record confirms the portal received your request. Test requests are billed normally.

查看用量View usage ↗
配置已改好,窗口仍提示?查看重启与复查步骤Already fixed the config? Restart and recheck lingering warnings ↗
适用范围与配置说明Compatibility and configuration notes遇到版本差异时查看Check when versions differ

需要支持 Responses、流式输出和工具调用的分组。仅支持 Chat Completions 的入口不能直接用于 Codex。Requires a group with Responses, streaming, and tool support. A Chat Completions-only endpoint cannot be used directly with Codex.

配置文件位于 ~/.codex/config.toml;Windows 为 %USERPROFILE%\.codex\config.toml。WSL 使用 Linux 路径。先安装 Node.js 与 npm。Use ~/.codex/config.toml, or %USERPROFILE%\.codex\config.toml on Windows. WSL uses Linux paths. Install Node.js and npm first.

更新、卸载与清理Update, uninstall and clean up按需执行,不属于接入步骤Optional maintenance, separate from setup

安装、更新与清理Install, update and clean up

持久化变量与缓存Persistent variables and caches ↗

先确认原来的安装方式,再展开对应选项。安装、更新和卸载按需执行,无需依次运行。Identify your installation method and expand its option. Choose the operation you need; do not run install, update and uninstall in sequence.

npm 全局安装Global npm installationmacOS / Linux / Windows

本页主教程使用 npm,需要已安装 Node.js 与 npm。macOS / Linux 在 Bash 或 Zsh 执行,Windows 在 PowerShell 执行同一组 npm 命令。卸载包后,个人配置与历史仍保留。The main guide uses npm and requires Node.js and npm. Run the same npm commands in Bash or Zsh on macOS / Linux, or PowerShell on Windows. Uninstalling the package preserves personal settings and history.

安装Install

npm install -g @openai/codex
codex --version

更新Update

npm install -g @openai/codex@latest
codex --version

卸载程序Uninstall the program

npm uninstall -g @openai/codex
Homebrew 安装Homebrew installationmacOS

仅适用于使用 Homebrew 安装的版本。安装与更新使用同一个包名,避免与 npm 或原生安装重复。For Homebrew installations only. Use the same package name to install and upgrade; avoid duplicate npm or native installations.

安装Install

brew install --cask codex

更新Update

brew upgrade --cask codex

卸载程序Uninstall the program

brew uninstall --cask codex
官方独立安装器Official standalone installermacOS / Linux

仅适用于默认独立安装路径。若设置了 CODEX_INSTALL_DIR 或 CODEX_HOME,先核实实际位置。卸载只处理命令入口与独立安装包,不清空整个 .codex;不要用此方式删除 npm / Homebrew 管理的安装。For default standalone installation paths only. Check the actual location if CODEX_INSTALL_DIR or CODEX_HOME is set. Removes the command and standalone package, not the whole .codex directory. Do not use this for npm or Homebrew installations.

安装Install

curl -fsSL https://chatgpt.com/codex/install.sh | sh
codex --version

更新Update

curl -fsSL https://chatgpt.com/codex/install.sh | sh
codex --version

卸载程序Uninstall the program

rm -i "$HOME/.local/bin/codex"
rm -ri "$HOME/.codex/packages/standalone"
版本与安装位置Version and installation location

macOS / Linux:查看版本与命令位置macOS / Linux: check version and command locations

type -a codex
codex --version

Windows PowerShell:查看版本与命令位置Windows PowerShell: check version and command locations

Get-Command codex -All | Select-Object CommandType, Source
codex --version
登录、配置与数据清理Login, configuration and data cleanup

清除已保存的登录凭据Remove saved login credentials

先关闭其他 Codex 会话,在卸载前运行。凭据可能保存在 auth.json 或系统凭据库,使用退出命令处理;CLI 与 IDE 可能共用登录状态。门户环境变量 Key 还需单独清除。Close other Codex sessions and run before uninstalling. Use logout to clear credentials stored in auth.json or the system credential store. CLI and IDE may share login state. Clear the portal key environment variable separately.

codex logout

macOS / Linux:清除当前终端的接入变量macOS / Linux: clear connection variables in this terminal

关闭工具后执行,再从同一终端重新启动。若变量写入 ~/.zshrc、~/.bashrc 或工具配置,也需编辑对应文件移除;此命令只影响当前终端。Close the tool, run these commands, then restart it from this terminal. Also remove matching entries from ~/.zshrc, ~/.bashrc or tool settings if saved there. These commands affect only the current terminal.

unset PORTAL_API_KEY

Windows PowerShell:清除当前终端的接入变量Windows PowerShell: clear connection variables in this terminal

如果曾保存为用户环境变量,再到下方的“持久化变量与缓存”清理。关闭旧终端,重新登录系统后再验证。For saved user variables, also follow Persistent variables and caches below. Close old terminals and sign in to the operating system again before checking.

Remove-Item Env:PORTAL_API_KEY -ErrorAction SilentlyContinue

macOS:清除桌面应用的会话环境变量macOS: clear the desktop session environment variable

适用于曾按桌面教程使用 launchctl setenv 的用户。先完全退出桌面应用,清除后重新打开。For users who followed the desktop guide with launchctl setenv. Fully quit the desktop app and reopen it after clearing the variable.

launchctl unsetenv PORTAL_API_KEY

可选:重置用户配置(macOS / Linux)Optional: reset user configuration (macOS / Linux)

先关闭 CLI、IDE 扩展和桌面工作区。此操作备份并移走用户 config.toml,个人模型、MCP 和偏好需重新配置;会话、技能和工作树保留。项目配置与组织托管策略仍可能生效。Close the CLI, IDE extension and desktop workspace. Backs up and moves your config.toml; model, MCP and preference settings must be configured again. Sessions, skills and worktrees remain. Project configuration and managed policies may still apply.

cli_state_dir="${CODEX_HOME:-$HOME/.codex}"
if [ -f "$cli_state_dir/config.toml" ]; then
  mv -i "$cli_state_dir/config.toml" "$cli_state_dir/config.toml.backup-$(date +%Y%m%d-%H%M%S)"
fi

可选:重置用户配置(Windows PowerShell)Optional: reset user configuration (Windows PowerShell)

仅重置用户配置文件,备份仍可能包含敏感配置。不要把整个 .codex 当成缓存删除,其中可能还有会话、技能、数据库和未合并的工作树;历史清理优先使用所在客户端的管理功能。Resets only the user configuration file. Backups may contain sensitive settings. Do not delete the whole .codex directory as a cache: it may contain sessions, skills, databases and unmerged worktrees. Prefer your client's history management features.

$cliStateDir = if ($env:CODEX_HOME) { $env:CODEX_HOME } else { Join-Path $env:USERPROFILE ".codex" }
$cliConfigPath = Join-Path $cliStateDir "config.toml"
if (Test-Path -LiteralPath $cliConfigPath) {
  Move-Item -LiteralPath $cliConfigPath -Destination ($cliConfigPath + ".backup-" + [guid]::NewGuid().ToString("N")) -ErrorAction Stop
}
版本兼容与旧配置Version compatibility and old settings处理 ignored / unrecognized 提示Fix ignored / unrecognized warnings

Codex 版本与旧配置迁移Codex versions and configuration migration

先核对运行版本、命令位置和警告指出的文件。CLI、IDE 扩展与桌面应用可能使用不同版本;网页上的最新配置示例不等于旧版本一定支持。Check the running version, command location and file named in the warning. CLI, IDE extensions and desktop apps may use different versions. The latest online examples may not work on older versions.

配置已经改好,旧窗口还显示警告?先退出出现提示的 Codex,再重新运行。若新启动的检查已通过,旧窗口留下的启动警告不需要通过反复修改文件来消除。Fixed the configuration but still see a warning in the old window? Exit that Codex session and start again. If the new startup passes its checks, old startup messages do not call for repeated file edits.

修复后复查:什么时候不用再改配置?After the fix: when can I stop editing?

以本机重新启动后的结果为准,按下面三项确认。只通过 TOML 语法检查、查看旧截图或运行 --help,都不能代替实际启动时的配置检查。Use the results from a fresh local startup to check these three items. TOML syntax validation, an old screenshot, or --help alone does not validate the configuration at startup.

  1. 本次被忽略的字段已经处理The fields ignored in this case have been addressed

    例如移除 disable_response_storage;若本机同时忽略 windows_wsl_setup_acknowledged,也从该配置文件移除。后者仍是官方参考中的 Windows 专用字段,不代表所有版本都无效。For example, remove disable_response_storage. If your local client also ignores windows_wsl_setup_acknowledged, remove it from that file. The latter remains a Windows-only field in the official reference, so it is not invalid in every version.

  2. network_access 的层级正确network_access is in the correct table

    使用 workspace-write 配置时,放在 [sandbox_workspace_write] 下。不要留在根级或 [model_providers.portal] 下,也不必为了消除警告改成 true。For workspace-write configurations, place it under [sandbox_workspace_write], not at the root or under [model_providers.portal]. Clearing a warning does not require changing it to true.

  3. 新启动的客户端检查通过The freshly started client passes its checks

    支持严格检查的版本应没有未知字段错误;重新打开的窗口也不再产生这些配置警告。若只剩旧窗口中的记录,本次无需再修改文件。On versions supporting strict checks, there should be no unknown-field errors, and the fresh window should no longer produce these configuration warnings. If only the old window retains them, no further edit is needed.

先确认版本与参数支持Check the version and available flags first

codex --version
codex --help

核对到的 CLI 0.163.0 提供 --strict-config;这不是最低支持版本声明。其他版本以其 --help 为准,不能仅凭版本较新就套用所有示例。The inspected CLI 0.163.0 offers --strict-config. This does not establish the earliest supported version. Check --help for other versions rather than assuming every example applies to newer releases.

支持时:以严格模式重新启动If supported, restart with strict configuration checks

codex --strict-config

此命令会启动 Codex 交互会话,不是独立的文件检查命令。先正常退出旧会话,再在相同项目目录运行;普通启动使用 codex。This starts an interactive Codex session; it is not a standalone file validator. Exit the old session normally and run it in the same project directory. Use codex for a normal startup.

新窗口仍有提示时,核对警告中的完整路径、CODEX_HOME、项目 .codex/config.toml、所选配置文件与托管策略。支持 /debug-config 的版本可查看实际加载来源;不要只检查默认的用户文件。If a fresh window still warns, check the full path in the message, CODEX_HOME, project .codex/config.toml, selected configuration files, and managed policies. Use /debug-config when supported to inspect loaded sources, beyond the default user file.

检查通过后,用 /status 核对提供方和模型,再发送一条简短请求并查看本站用量。配置检查通过和模型调用成功需要分别确认。After the checks pass, use /status to confirm the provider and model, then send a short request and check portal Usage. Configuration validation and model connectivity must be verified separately.

不同版本与客户端,怎么选择说明?Which instructions match my version and client?
本机情况Your setup对应操作What to do
帮助中有 --strict-config--strict-config appears in help退出旧会话后,在同一个项目目录运行 codex --strict-config。未知字段会作为错误处理;成功启动后检查是否还有新警告。Exit the old session, then run codex --strict-config in the same project directory. Unknown fields become errors. After startup, check for any new warnings.
帮助中没有 --strict-config--strict-config is absent from help使用 codex 正常启动,检查本次输出,并参考该版本的配置文档。不要把 unsupported / unexpected argument 当成 config.toml 字段错误。Start with codex, inspect the new output, and consult the documentation for that version. An unsupported or unexpected argument is not a config.toml field error.
使用 sandbox_mode / sandbox_workspace_writeUsing sandbox_mode / sandbox_workspace_write沿用当前版本支持的沙箱配置,network_access 放在 [sandbox_workspace_write] 内,保留你原本需要的 true / false。Keep the sandbox configuration supported by your version. Place network_access in [sandbox_workspace_write], preserving the true or false value you need.
使用 default_permissions / permissionsUsing default_permissions / permissions按该版本的权限配置说明设置网络权限,不要同时混入旧沙箱配置。已正常工作的旧配置无需只为清除旧窗口提示而迁移。Set networking according to that version’s permission profile documentation, without mixing in legacy sandbox settings. A working legacy configuration does not need migration just to clear an old window’s warning.
CLI 正常,IDE 或桌面端仍提示CLI works, but the IDE or desktop app still warns分别确认客户端版本与实际配置来源,完全退出出现提示的客户端再重开。CLI 的检查结果不代表其他客户端也已通过。Check each client’s version and configuration sources. Fully quit and reopen the client that shows the warning. A CLI check does not validate other clients.

当前官方文档会持续更新。固定旧版本时,保留该版本的配置说明;在线 Schema 的最新版校验不能替代旧客户端自身的检查。Official documentation changes over time. Keep the configuration guidance for any pinned older version. The latest online schema cannot replace checks by that older client.

出现 unrecognized configuration settings 时When you see unrecognized configuration settings

ignored 表示这些配置没有生效。先备份警告中列出的 config.toml,仅移除或迁移对应项,保留模型、网关、MCP 与其他已有配置。Ignored means the settings were not applied. Back up the config.toml named in the warning. Remove or migrate only the affected entries, preserving model, gateway, MCP and other settings.

配置项Setting如何处理What to do
disable_response_storage当前官方参考未列出此项;遇到 ignored 时移除。它不能保证门户或上游不保存响应,也不要直接替换成 history.persistence:本地历史与服务端存储是两件事。Not listed in the current official reference; remove it when reported as ignored. It does not guarantee that the portal or upstream stores no responses. history.persistence is not an equivalent replacement: local history and server storage are separate.
network_access不应作为根级或提供方字段。使用 workspace-write 沙箱且当前版本支持时,放在 [sandbox_workspace_write] 中;新权限配置方案则按对应版本的 permissions 文档处理。Not a root or provider field. For supported versions using workspace-write, place it under [sandbox_workspace_write]. For newer permission profiles, follow the permissions documentation for that version.
windows_wsl_setup_acknowledged当前官方参考仍列为 Windows 引导状态,不能断言所有版本均已废弃。若你的版本忽略它,先从手写配置中移除;按当前客户端完成 Windows / WSL 引导即可,门户接入无需此项。Still listed as Windows onboarding state in the current official reference; it is not universally deprecated. If your version ignores it, remove the handwritten entry and use the client's Windows / WSL setup flow. Portal access does not require it.

TOML 中,[model_providers.portal] 后的字段属于这个提供方,直到出现下一个表头。根级 model、model_provider、web_search 应放在第一个表头之前;同名表不要重复创建。In TOML, fields after [model_providers.portal] belong to that provider until another table header. Place root model, model_provider and web_search settings before the first header. Do not create duplicate tables.

可选:workspace-write 沙箱的联网设置Optional: networking in the workspace-write sandbox

[sandbox_workspace_write]
network_access = false

仅合并到已使用 workspace-write 的配置中。false 保持沙箱命令禁止联网;确实需要命令下载依赖时才考虑 true。这不控制 Codex 向模型服务发送请求,也不替代 web_search;组织策略仍可能限制联网。Merge only into a configuration already using workspace-write. false keeps sandboxed commands offline; consider true only when commands need network access, such as downloading dependencies. This does not control model requests or replace web_search. Managed policies may still restrict networking.

macOS / Linux:确认版本与实际配置路径macOS / Linux: check the version and configuration path
type -a codex
codex --version
codex --help
printf '%s\n' "${CODEX_HOME:-$HOME/.codex}/config.toml"

默认用户文件为 ~/.codex/config.toml。最后一行只显示当前终端的用户配置路径,不读取或修改文件;若启动警告指出其他来源,继续检查那个路径。The default user file is ~/.codex/config.toml. The final command only prints the current terminal’s user configuration path; it does not read or change the file. If a startup warning points elsewhere, inspect that source.

Windows:确认版本并备份实际配置Windows: check the version and back up the actual configuration
Get-Command codex -All | Select-Object CommandType, Source
codex --version
codex --help

下面的 YOUR_CONFIG_PATH 必须替换为警告里的完整路径。默认目录通常是 %USERPROFILE%\.codex,也可能被 CODEX_HOME 改写;以实际警告为准。此步骤仅备份并打开编辑器,不自动删改字段。Replace YOUR_CONFIG_PATH with the full path from the warning. The default is usually %USERPROFILE%\.codex, but CODEX_HOME can change it. Follow the actual warning. This step only backs up the file and opens an editor; it does not remove or change settings.

$codexConfigPath = "YOUR_CONFIG_PATH"
if (Test-Path -LiteralPath $codexConfigPath -PathType Leaf) {
  $codexBackupPath = $codexConfigPath + ".backup-" + [guid]::NewGuid().ToString("N")
  Copy-Item -LiteralPath $codexConfigPath -Destination $codexBackupPath -ErrorAction Stop
  notepad.exe $codexConfigPath
} else {
  throw "Replace YOUR_CONFIG_PATH with the config.toml path from the warning."
}

保存后完全退出并重新启动对应客户端,确认警告消失,再用 /status 检查提供方和模型。若只有 IDE 或桌面端报错,核对它自身的版本与配置入口。配置能加载不代表线路已联通,仍需一次实际调用验证。Save, fully restart the affected client and check that warnings are gone. Use /status to check the provider and model. For IDE-only or desktop-only warnings, check that client's version and configuration. A successful config load still needs a real request to verify connectivity.

新版、旧版与固定版本怎么选择Choosing current, older or pinned versions

日常使用按原安装方式更新稳定版。需要复现问题或暂时保留旧版时,先备份配置,按该发行版本的文档核对字段与命令;不要仅为消除警告关闭沙箱或审批。For everyday use, update to a stable release through your original installation method. To reproduce an issue or keep an older release, back up settings and consult that release's documentation. Do not disable sandboxing or approvals just to silence warnings.

npm:安装指定版本npm: install a specific version

npm install -g @openai/codex@YOUR_VERSION
codex --version

将 YOUR_VERSION 换为已确认存在且需要使用的版本号。更新 CLI 不会同时更新 IDE 扩展或桌面应用;切换版本后重新检查配置警告。Replace YOUR_VERSION with an existing release you intend to use. Updating the CLI does not update IDE extensions or desktop apps. Check for configuration warnings after changing versions.

编辑器中的配置校验Configuration validation in your editor

#:schema https://developers.openai.com/codex/config-schema.json

使用支持 JSON Schema 的 TOML 扩展时,可将这行注释放在文件顶部辅助检查。该地址跟随最新版;固定旧版本时,以对应发行版本和本机实际提示为准。With a TOML extension that supports JSON Schema, add this comment at the top of the file for validation. This URL follows the latest release. For a pinned older version, use its release documentation and the actual local diagnostics.

接入指南Setup guide

Gemini CLI

官方文档Official docs ↗

先安装 Node.js 20 或更新版本,再打开终端。Install Node.js 20 or later, then open a terminal.

你的操作系统Your operating system

开始前,准备这两项Have these two things ready

选择开放 Gemini 原生协议的分组。Choose a group that supports the native Gemini protocol.

接入地址已填入下方示例The endpoint is already in the examples查看地址View endpoint ↓
API Base URLtext
https://newapi.world

已使用根地址,按下面示例填写。The root address is already set. Follow the examples below. 切换线路与地址规则Endpoints and address formats ↗

跟着步骤完成接入Follow these steps to connect

已有安装?从配置步骤开始即可Already installed? Start with configuration

先替换示例中的密钥和模型;出现 your-project 时,改成你自己的项目文件夹路径。Replace the key and model placeholders first. Replace your-project with the path to your own project folder.

安装工具Install the tool

在终端中运行Run in your terminal · Bash / Zsh
npm install -g @google/gemini-cli
gemini --version

填写连接信息Set your connection details

在终端中运行Run in your terminal · Bash / Zsh
export GEMINI_API_KEY="YOUR_API_KEY"
export GOOGLE_GEMINI_BASE_URL="https://newapi.world"

填写连接信息Set your connection details

在终端中运行Run in your terminal · PowerShell
$env:GEMINI_API_KEY = "YOUR_API_KEY"
$env:GOOGLE_GEMINI_BASE_URL = "https://newapi.world"

在项目中启动Launch in your project

在终端中运行Run in your terminal · Bash / Zsh
cd your-project
gemini

最后,确认请求确实走了本站Finally, check that your request used this portal

发送一条简短消息,再到用量明细核对这把 Key 的记录。出现记录才说明本站收到请求,测试调用按实际规则计费。Send a short message, then check this key in Usage. A matching record confirms the portal received your request. Test requests are billed normally.

查看用量View usage ↗
适用范围与配置说明Compatibility and configuration notes遇到版本差异时查看Check when versions differ

先安装 Node.js 20 或更新版本。连接步骤按操作系统二选一;分组需支持 Gemini 原生协议,不能直接改填 OpenAI Chat Completions 地址。Install Node.js 20 or later. Choose the connection steps for your OS. Your group must support the native Gemini protocol; an OpenAI Chat Completions endpoint is not interchangeable.

更新、卸载与清理Update, uninstall and clean up按需执行,不属于接入步骤Optional maintenance, separate from setup

安装、更新与清理Install, update and clean up

持久化变量与缓存Persistent variables and caches ↗

先确认原来的安装方式,再展开对应选项。安装、更新和卸载按需执行,无需依次运行。Identify your installation method and expand its option. Choose the operation you need; do not run install, update and uninstall in sequence.

npm 全局安装Global npm installationmacOS / Linux / Windows

需要 Node.js 20 或更新版本。更新同一个全局包;如果使用 npx 临时运行,没有对应的全局安装需要卸载。Requires Node.js 20 or later. Update the same global package. If you only used npx, there is no corresponding global installation to uninstall.

安装Install

npm install -g @google/gemini-cli
gemini --version

更新Update

npm install -g @google/gemini-cli@latest
gemini --version

卸载程序Uninstall the program

npm uninstall -g @google/gemini-cli
Homebrew 安装Homebrew installationmacOS / Linux

仅适用于使用 Homebrew 安装的版本。安装与更新使用同一个包名,避免与 npm 或原生安装重复。For Homebrew installations only. Use the same package name to install and upgrade; avoid duplicate npm or native installations.

安装Install

brew install gemini-cli

更新Update

brew upgrade gemini-cli

卸载程序Uninstall the program

brew uninstall gemini-cli
版本与安装位置Version and installation location

macOS / Linux:查看版本与命令位置macOS / Linux: check version and command locations

type -a gemini
gemini --version

Windows PowerShell:查看版本与命令位置Windows PowerShell: check version and command locations

Get-Command gemini -All | Select-Object CommandType, Source
gemini --version
登录、配置与数据清理Login, configuration and data cleanup

macOS / Linux:清除当前终端的接入变量macOS / Linux: clear connection variables in this terminal

关闭工具后执行,再从同一终端重新启动。若变量写入 ~/.zshrc、~/.bashrc 或工具配置,也需编辑对应文件移除;此命令只影响当前终端。Close the tool, run these commands, then restart it from this terminal. Also remove matching entries from ~/.zshrc, ~/.bashrc or tool settings if saved there. These commands affect only the current terminal.

unset GEMINI_API_KEY GOOGLE_GEMINI_BASE_URL

Windows PowerShell:清除当前终端的接入变量Windows PowerShell: clear connection variables in this terminal

如果曾保存为用户环境变量,再到下方的“持久化变量与缓存”清理。关闭旧终端,重新登录系统后再验证。For saved user variables, also follow Persistent variables and caches below. Close old terminals and sign in to the operating system again before checking.

Remove-Item Env:GEMINI_API_KEY -ErrorAction SilentlyContinue
Remove-Item Env:GOOGLE_GEMINI_BASE_URL -ErrorAction SilentlyContinue

查看当前项目的已保存会话List saved sessions for the current project

在目标项目目录运行。先核对会话 ID,再决定删除哪一条;普通清屏不会删除已保存记录。Run in the target project directory. Check session IDs before choosing one to delete. Clearing the terminal does not delete saved records.

gemini --list-sessions

删除指定会话Delete a specific session

将占位符替换为上一步确认的 ID,会删除该会话及关联数据。~/.gemini/tmp 中也包含会话与计划,不能当成普通下载缓存整体清空。Replace the placeholder with the ID you checked. Deletes that session and related data. ~/.gemini/tmp also contains sessions and plans; do not clear it as a download cache.

gemini --delete-session "YOUR_SESSION_ID"

检查登录方式Check authentication method

在 Gemini CLI 内运行以管理认证方式。若曾使用 Google 登录,环境变量清理不会撤销 Google 授权;按认证界面处理,不要将 oauth_creds.json 当成可公开的缓存文件。Run inside Gemini CLI to manage authentication. Clearing environment variables does not revoke Google authorization. Use the authentication interface; oauth_creds.json is not a cache file you can share.

/auth
接入指南Setup guide

CC Switch

官方文档Official docs ↗

先安装你要使用的 CLI,CC Switch 用来管理它的连接配置。Install your preferred CLI first. CC Switch manages its connection settings.

你的操作系统Your operating system

开始前,准备这两项Have these two things ready

按目标工具选择分组:Claude 使用 Messages,Codex 使用 Responses。Choose the group for your tool: Messages for Claude, Responses for Codex.

接入地址已填入下方示例The endpoint is already in the examples查看地址View endpoint ↓
API Base URLtext
https://newapi.world

已使用根地址,按下面示例填写。The root address is already set. Follow the examples below. 切换线路与地址规则Endpoints and address formats ↗

跟着步骤完成接入Follow these steps to connect

已有安装?从配置步骤开始即可Already installed? Start with configuration

先替换示例中的密钥和模型;出现 your-project 时,改成你自己的项目文件夹路径。Replace the key and model placeholders first. Replace your-project with the path to your own project folder.

安装桌面应用Install the desktop app

在应用中操作In the application
打开官方仓库的 Releases,下载适合操作系统的安装包。
https://github.com/farion1231/cc-switch/releases
Open Releases in the official repository and download the installer for your operating system.
https://github.com/farion1231/cc-switch/releases

添加 Claude Code 提供方Add a Claude Code provider

在应用中操作In the application
名称:NewAPI
API 地址:https://newapi.world
API Key:YOUR_API_KEY
在应用中选择对应工具,添加提供方并保存。
Name: NewAPI
API URL: https://newapi.world
API Key: YOUR_API_KEY
Select the tool in the app, add the provider and save.

切换配置Switch profiles

在应用中操作In the application
在 CC Switch 中启用刚保存的提供方,然后重新启动对应 CLI。
为 Codex 添加配置时使用 /v1 地址与 Responses 协议。
Enable the saved provider in CC Switch, then restart the CLI.
For Codex, use the /v1 endpoint and Responses protocol.

最后,确认请求确实走了本站Finally, check that your request used this portal

发送一条简短消息,再到用量明细核对这把 Key 的记录。出现记录才说明本站收到请求,测试调用按实际规则计费。Send a short message, then check this key in Usage. A matching record confirms the portal received your request. Test requests are billed normally.

查看用量View usage ↗
更新、卸载与清理Update, uninstall and clean up按需执行,不属于接入步骤Optional maintenance, separate from setup

安装、更新与清理Install, update and clean up

持久化变量与缓存Persistent variables and caches ↗

先确认原来的安装方式,再展开对应选项。安装、更新和卸载按需执行,无需依次运行。Identify your installation method and expand its option. Choose the operation you need; do not run install, update and uninstall in sequence.

Homebrew 安装Homebrew installationmacOS

仅适用于使用 Homebrew 安装的版本。安装与更新使用同一个包名,避免与 npm 或原生安装重复。For Homebrew installations only. Use the same package name to install and upgrade; avoid duplicate npm or native installations.

安装Install

brew install --cask cc-switch

更新Update

brew upgrade --cask cc-switch

卸载程序Uninstall the program

brew uninstall --cask cc-switch
其他安装方式与维护Other installation methods and maintenance

安装包方式:更新与卸载Installers: update and uninstall

从官方 Releases 下载同一系统的新版本,关闭应用后按安装包说明更新。Windows 在“已安装的应用”卸载;macOS 移除应用;Linux 使用原安装包对应的包管理器。此桌面项目不使用旧教程中的 npm install -g cc-switch。Download the new release for your OS, close the app and follow the installer instructions. Uninstall through Installed apps on Windows, remove the app on macOS, or use the original package manager on Linux. The old npm install -g cc-switch command does not apply to this desktop project.

https://github.com/farion1231/cc-switch/releases
登录、配置与数据清理Login, configuration and data cleanup

清理提供方与已写入的配置Remove providers and generated configuration

先在 CC Switch 中移除不再使用的提供方,再检查它写入的 CLI 配置和环境变量。删除桌面应用不会自动恢复这些文件;仅编辑对应提供方的条目,保留其他模型和设置。Remove unused providers in CC Switch, then check the CLI settings and environment variables it wrote. Removing the desktop app does not restore those files. Edit only the relevant provider entries.

Claude Code → ~/.claude/settings.json
Codex → ~/.codex/config.toml
官方资料 · 核对日期Official sources · Reviewed 官方安装与更新Official installation and updates ↗
接入指南Setup guide

Cursor

官方文档Official docs ↗

使用提供自定义 Base URL 选项的版本,自有 Key 不覆盖所有内置功能。Use a version with a custom Base URL option. Your own key does not cover every built-in feature.

你的操作系统Your operating system

开始前,准备这两项Have these two things ready

选择当前编辑器与分组共同支持的模型。Choose a model supported by both your editor and your group.

接入地址已填入下方示例The endpoint is already in the examples查看地址View endpoint ↓
API Base URLtext
https://newapi.world/v1

已包含 /v1,按下面示例填写。The address already includes /v1. Follow the examples below. 切换线路与地址规则Endpoints and address formats ↗

跟着步骤完成接入Follow these steps to connect

已有安装?从配置步骤开始即可Already installed? Start with configuration

先替换示例中的密钥和模型;出现 your-project 时,改成你自己的项目文件夹路径。Replace the key and model placeholders first. Replace your-project with the path to your own project folder.

安装并打开模型设置Install and open model settings

在应用中操作In the application
从 https://cursor.com/download 安装 Cursor。
打开 Settings → Models / API Keys。
Install Cursor from https://cursor.com/download.
Open Settings → Models / API Keys.

配置自定义地址Set a custom endpoint

在应用中操作In the application
OpenAI API Key: YOUR_API_KEY
Override OpenAI Base URL: https://newapi.world/v1
Model: YOUR_MODEL_ID

验证连接Verify the connection

在应用中操作In the application
使用当前分组支持的模型发起一次对话。
若当前版本没有地址覆盖选项,请使用支持自定义网关的客户端。
Start a conversation using a model supported by your group.
If this version has no endpoint override, use a client that supports custom gateways.

最后,确认请求确实走了本站Finally, check that your request used this portal

发送一条简短消息,再到用量明细核对这把 Key 的记录。出现记录才说明本站收到请求,测试调用按实际规则计费。Send a short message, then check this key in Usage. A matching record confirms the portal received your request. Test requests are billed normally.

查看用量View usage ↗
更新、卸载与清理Update, uninstall and clean up按需执行,不属于接入步骤Optional maintenance, separate from setup

安装、更新与清理Install, update and clean up

持久化变量与缓存Persistent variables and caches ↗
其他安装方式与维护Other installation methods and maintenance

更新与卸载桌面应用Update and uninstall the desktop app

通过应用的更新入口或官方安装包更新。先保存工作并关闭 Cursor;Windows 在“已安装的应用”卸载,macOS 移除应用,Linux 按原安装方式移除软件包或 AppImage。Update through the app or an official installer. Save your work and close Cursor. Use Installed apps on Windows, remove the app on macOS, or remove the original package or AppImage on Linux.

https://cursor.com/download
登录、配置与数据清理Login, configuration and data cleanup

清除自定义接入配置Remove custom connection settings

移除自己的 API Key、自定义 Base URL 和不再使用的模型。若启用了设置同步,检查其他设备是否仍保存配置。需要清理会话时,先导出所需内容,再使用客户端提供的删除入口。Remove your API key, custom base URL and unused models. If settings sync is enabled, check other devices too. Export any conversations you need before deleting them through the client.

Settings → Models / API Keys
官方资料 · 核对日期Official sources · Reviewed 官方安装包Official installers ↗API Key 设置API key settings ↗
接入指南Setup guide

Continue.dev

官方文档Official docs ↗

先安装 VS Code 或 JetBrains,再安装 Continue 插件。Install VS Code or a JetBrains IDE, then add the Continue extension.

你的操作系统Your operating system

开始前,准备这两项Have these two things ready

选择支持 OpenAI 兼容接入的模型与分组。Choose a model and group with OpenAI-compatible API support.

接入地址已填入下方示例The endpoint is already in the examples查看地址View endpoint ↓
API Base URLtext
https://newapi.world/v1

已包含 /v1,按下面示例填写。The address already includes /v1. Follow the examples below. 切换线路与地址规则Endpoints and address formats ↗

跟着步骤完成接入Follow these steps to connect

已有安装?从配置步骤开始即可Already installed? Start with configuration

先替换示例中的密钥和模型;出现 your-project 时,改成你自己的项目文件夹路径。Replace the key and model placeholders first. Replace your-project with the path to your own project folder.

安装插件Install the extension

在应用中操作In the application
在 VS Code 或 JetBrains 插件市场中安装 Continue。
Install Continue from the VS Code or JetBrains extension marketplace.

编辑 ~/.continue/config.yaml,合并已有配置Edit ~/.continue/config.yaml and merge with your existing settings

编辑配置文件Edit the configuration file
name: NewAPI
version: 1.0.0
schema: v1
models:
  - name: My workspace model
    provider: openai
    model: YOUR_MODEL_ID
    apiBase: https://newapi.world/v1
    apiKey: YOUR_API_KEY
    roles:
      - chat
      - edit

选择模型Choose a model

在应用中操作In the application
在 Continue 的模型列表选择 My workspace model。
将本地配置中的占位符替换为自己的密钥;不要把密钥配置提交到仓库。
Select My workspace model in Continue.
Replace placeholders with your own key locally; do not commit credentials to your repository.

最后,确认请求确实走了本站Finally, check that your request used this portal

发送一条简短消息,再到用量明细核对这把 Key 的记录。出现记录才说明本站收到请求,测试调用按实际规则计费。Send a short message, then check this key in Usage. A matching record confirms the portal received your request. Test requests are billed normally.

查看用量View usage ↗
更新、卸载与清理Update, uninstall and clean up按需执行,不属于接入步骤Optional maintenance, separate from setup

安装、更新与清理Install, update and clean up

持久化变量与缓存Persistent variables and caches ↗

先确认原来的安装方式,再展开对应选项。安装、更新和卸载按需执行,无需依次运行。Identify your installation method and expand its option. Choose the operation you need; do not run install, update and uninstall in sequence.

VS Code 扩展VS Code extensionmacOS / Linux / Windows

需先安装 VS Code 并使 code 命令可用。也可直接在扩展管理页安装、更新或卸载。远程工作区和不同 Profile 的扩展安装需分别检查。Requires VS Code and the code command on PATH. You can also install, update or uninstall from Extensions. Check remote workspaces and separate profiles individually.

安装Install

code --install-extension Continue.continue

更新Update

code --install-extension Continue.continue --force

卸载程序Uninstall the program

code --uninstall-extension Continue.continue
其他安装方式与维护Other installation methods and maintenance

JetBrains 插件管理JetBrains plugin management

在插件管理页选择更新或卸载,并按提示重启 IDE。VS Code 的 code 命令不适用于 JetBrains。Update or uninstall in Plugins, then restart the IDE if prompted. VS Code's code commands do not apply to JetBrains.

Settings / Preferences → Plugins → Installed → Continue
登录、配置与数据清理Login, configuration and data cleanup

清理本地模型配置Remove local model configuration

先关闭 IDE,从配置中移除对应模型和 apiKey。若使用环境变量、其他配置文件或远程开发环境,也检查对应来源。保留仍在使用的模型;卸载插件不会自动撤销门户密钥。Close the IDE and remove the relevant model and apiKey entries. Also check environment variables, other configuration files and remote environments. Keep models you still use. Uninstalling the extension does not revoke portal keys.

~/.continue/config.yaml
接入指南Setup guide

Aider

官方文档Official docs ↗

此安装方式需要 Python 3.9–3.12;使用虚拟环境时先激活它。This installation method requires Python 3.9–3.12. Activate your virtual environment first if you use one.

你的操作系统Your operating system

开始前,准备这两项Have these two things ready

选择支持 OpenAI 兼容接入的模型与分组。Choose a model and group with OpenAI-compatible API support.

接入地址已填入下方示例The endpoint is already in the examples查看地址View endpoint ↓
API Base URLtext
https://newapi.world/v1

已包含 /v1,按下面示例填写。The address already includes /v1. Follow the examples below. 切换线路与地址规则Endpoints and address formats ↗

跟着步骤完成接入Follow these steps to connect

已有安装?从配置步骤开始即可Already installed? Start with configuration

先替换示例中的密钥和模型;出现 your-project 时,改成你自己的项目文件夹路径。Replace the key and model placeholders first. Replace your-project with the path to your own project folder.

安装工具Install the tool

在终端中运行Run in your terminal · Bash / Zsh

保留原教程的 pip 安装方式,需 Python 3.9–3.12。已有虚拟环境时先激活它;也可选择下方维护指南中的 uv 独立安装。Keeps the original pip installation and requires Python 3.9–3.12. Activate your existing virtual environment first, or choose the isolated uv installation in the maintenance guide below.

python -m pip install aider-chat
aider --version

填写连接信息Set your connection details

在终端中运行Run in your terminal · Bash / Zsh
export OPENAI_API_BASE="https://newapi.world/v1"
export OPENAI_API_KEY="YOUR_API_KEY"

填写连接信息Set your connection details

在终端中运行Run in your terminal · PowerShell
$env:OPENAI_API_BASE = "https://newapi.world/v1"
$env:OPENAI_API_KEY = "YOUR_API_KEY"

在项目中启动Launch in your project

在终端中运行Run in your terminal · Bash / Zsh
cd your-project
aider --model openai/YOUR_MODEL_ID

最后,确认请求确实走了本站Finally, check that your request used this portal

发送一条简短消息,再到用量明细核对这把 Key 的记录。出现记录才说明本站收到请求,测试调用按实际规则计费。Send a short message, then check this key in Usage. A matching record confirms the portal received your request. Test requests are billed normally.

查看用量View usage ↗
更新、卸载与清理Update, uninstall and clean up按需执行,不属于接入步骤Optional maintenance, separate from setup

安装、更新与清理Install, update and clean up

持久化变量与缓存Persistent variables and caches ↗

先确认原来的安装方式,再展开对应选项。安装、更新和卸载按需执行,无需依次运行。Identify your installation method and expand its option. Choose the operation you need; do not run install, update and uninstall in sequence.

pip 安装pip installationmacOS / Linux / Windows

保留原教程的 pip 方式,需 Python 3.9–3.12。在原 Python / 虚拟环境中更新或卸载;不要清空项目虚拟环境或批量删除其他依赖。也可选下方 uv 独立安装。Keeps the original pip method and requires Python 3.9–3.12. Update or uninstall in the original Python or virtual environment. Keep other project dependencies. The isolated uv installation below is another option.

安装Install

python -m pip install -U --upgrade-strategy only-if-needed aider-chat
aider --version

更新Update

python -m pip install -U --upgrade-strategy only-if-needed aider-chat
aider --version

卸载程序Uninstall the program

python -m pip uninstall aider-chat
uv 独立工具环境Isolated uv tool environmentmacOS / Linux / Windows

先按 uv 官方说明安装 uv。工具安装在独立环境;终端找不到 aider 时重新打开终端。更新和卸载只操作 aider-chat,不删除整个 uv 工具目录。Install uv using its official instructions first. Aider runs in an isolated environment. Reopen the terminal if aider is not found. Update and uninstall only aider-chat; keep the rest of the uv tools directory.

安装Install

uv tool install --python python3.12 --with pip aider-chat@latest
uv tool update-shell
aider --version

更新Update

uv tool upgrade aider-chat
aider --version

卸载程序Uninstall the program

uv tool uninstall aider-chat
版本与安装位置Version and installation location

macOS / Linux:查看版本与命令位置macOS / Linux: check version and command locations

type -a aider
aider --version

Windows PowerShell:查看版本与命令位置Windows PowerShell: check version and command locations

Get-Command aider -All | Select-Object CommandType, Source
aider --version
登录、配置与数据清理Login, configuration and data cleanup

macOS / Linux:清除当前终端的接入变量macOS / Linux: clear connection variables in this terminal

关闭工具后执行,再从同一终端重新启动。若变量写入 ~/.zshrc、~/.bashrc 或工具配置,也需编辑对应文件移除;此命令只影响当前终端。Close the tool, run these commands, then restart it from this terminal. Also remove matching entries from ~/.zshrc, ~/.bashrc or tool settings if saved there. These commands affect only the current terminal.

unset OPENAI_API_BASE OPENAI_API_KEY

Windows PowerShell:清除当前终端的接入变量Windows PowerShell: clear connection variables in this terminal

如果曾保存为用户环境变量,再到下方的“持久化变量与缓存”清理。关闭旧终端,重新登录系统后再验证。For saved user variables, also follow Persistent variables and caches below. Close old terminals and sign in to the operating system again before checking.

Remove-Item Env:OPENAI_API_BASE -ErrorAction SilentlyContinue
Remove-Item Env:OPENAI_API_KEY -ErrorAction SilentlyContinue

清理 Aider 的 uv 下载缓存Clear Aider's uv download cache

仅用于 uv 安装方式,清理指定包缓存;再次安装可能重新下载。会话历史和项目文件不属于这个缓存。For uv installations only. Clears this package's cache; reinstalling may download it again. Session history and project files are separate.

uv cache clean aider-chat

macOS / Linux:删除当前项目的默认历史文件macOS / Linux: delete this project's default history files

先退出 Aider,并确认当前目录就是目标项目。命令逐个确认删除,只覆盖默认历史文件;若自定义历史路径,需单独处理。项目代码、Git 历史、.env 与 .aider.conf.yml 保留。Exit Aider and check the current project directory. Confirms deletion of each default history file. Handle custom history paths separately. Source code, Git history, .env and .aider.conf.yml remain.

pwd
rm -i .aider.chat.history.md .aider.input.history

Windows PowerShell:删除当前项目的默认历史文件Windows PowerShell: delete this project's default history files

核对当前项目后确认删除。若密钥写在用户配置或项目 .env 中,需手动移除相应条目,不要直接删除整个项目 .env。Check the project before confirming deletion. Remove key entries from user settings or project .env manually if present; keep the rest of the .env file.

Get-Location
Remove-Item -LiteralPath ".aider.chat.history.md", ".aider.input.history" -Confirm
接入指南Setup guide

LobeChat / LobeHub

官方文档Official docs ↗

打开已有的 LobeChat / LobeHub。首次部署说明在下方“更多配置方式”中。Open your existing LobeChat / LobeHub. First-time deployment instructions are under “More setup options” below.

你的操作系统Your operating system

开始前,准备这两项Have these two things ready

在服务商设置中选择 OpenAI 兼容提供方。Choose an OpenAI-compatible provider in the provider settings.

接入地址已填入下方示例The endpoint is already in the examples查看地址View endpoint ↓
API Base URLtext
https://newapi.world/v1

已包含 /v1,按下面示例填写。The address already includes /v1. Follow the examples below. 切换线路与地址规则Endpoints and address formats ↗

跟着步骤完成接入Follow these steps to connect

已有安装?从配置步骤开始即可Already installed? Start with configuration

先替换示例中的密钥和模型;出现 your-project 时,改成你自己的项目文件夹路径。Replace the key and model placeholders first. Replace your-project with the path to your own project folder.

打开服务商设置Open provider settings

在应用中操作In the application
进入你的 LobeChat / LobeHub → 设置 → 语言模型 / 服务商。
选择支持自定义地址的 OpenAI 接入。
Open LobeChat / LobeHub → Settings → Language models / Providers.
Choose an OpenAI connection that supports custom endpoints.

填写连接配置Enter connection settings

在应用中操作In the application
API 地址:https://newapi.world/v1
API Key:YOUR_API_KEY
模型 ID:YOUR_MODEL_ID
API URL: https://newapi.world/v1
API Key: YOUR_API_KEY
Model ID: YOUR_MODEL_ID

最后,确认请求确实走了本站Finally, check that your request used this portal

发送一条简短消息,再到用量明细核对这把 Key 的记录。出现记录才说明本站收到请求,测试调用按实际规则计费。Send a short message, then check this key in Usage. A matching record confirms the portal received your request. Test requests are billed normally.

查看用量View usage ↗
更多配置方式More setup options已有配置、其他安装方式与可选设置Existing setups, alternative installs, and optional settings

可选:首次部署 LobeHub(Docker Compose)Optional: first LobeHub deployment with Docker Compose

在终端中运行Run in your terminal · Bash / WSL

先安装并启动 Docker,使用 macOS / Linux 的 Bash,Windows 使用 WSL 2。官方脚本仅用于新的部署目录;已有部署直接跳过。按提示选择本地或域名模式并生成配置,检查所需端口,尤其 8787 不要与门户后端冲突。原单容器 LobeChat 用户需查阅迁移说明。Install and start Docker. Use Bash on macOS / Linux or WSL 2 on Windows. Run the official script only in a new deployment directory; skip for an existing deployment. Choose local or domain mode and generate configuration. Check ports, especially 8787, for conflicts with the portal backend. Older single-container LobeChat deployments need the migration guide.

mkdir lobehub && cd lobehub && bash <(curl -fsSL https://lobe.li/setup.sh) -l en

启动新部署Start the new deployment

在终端中运行Run in your terminal · Bash / Zsh

在上一步生成的 lobehub 目录执行。按安装脚本输出的地址访问;部署配置、数据库与上传文件需持久保存。更新和卸载见下方维护指南。Run in the lobehub directory from the previous step. Open the address shown by the setup script. Persist configuration, databases and uploads. See the maintenance guide below for updates and removal.

docker compose up -d
docker compose ps

已有服务端部署可配置环境变量Set environment variables for an existing server deployment

编辑部署的 .env 文件Edit the deployment .env file
OPENAI_PROXY_URL="https://newapi.world/v1"
OPENAI_API_KEY="YOUR_API_KEY"
更新、卸载与清理Update, uninstall and clean up按需执行,不属于接入步骤Optional maintenance, separate from setup

安装、更新与清理Install, update and clean up

持久化变量与缓存Persistent variables and caches ↗
版本与安装位置Version and installation location

检查当前 Compose 服务Check current Compose services

以下命令均在这套 LobeHub 的 Compose 目录运行。旧版单容器 LobeChat 需先按官方迁移文档处理,不能直接套用另一套部署的配置。Run all commands in this LobeHub deployment's Compose directory. For an older single-container LobeChat deployment, follow the official migration instructions before adopting a different deployment configuration.

docker compose ps
其他安装方式与维护Other installation methods and maintenance

更新现有 Compose 部署Update an existing Compose deployment

先备份数据库、上传文件及 .env,阅读目标版本的迁移要求并更新对应配置;确认镜像标签指向目标版本后再执行。会重建相关服务并中断正在进行的请求。Back up databases, uploads and .env, then review migration requirements and update configuration for your target version. Confirm the image tags before running. Services are recreated and active requests are interrupted.

docker compose pull
docker compose up -d

卸载这套 Compose 服务Remove this Compose deployment

停止并删除当前 Compose 项目的容器和网络,保留持久化卷与绑定目录。不要添加 -v,除非已备份且确定要永久删除卷内数据库和文件。Stops and removes this Compose project's containers and networks while keeping persistent volumes and bind mounts. Add -v only if you have backups and intend to permanently delete databases and files in those volumes.

docker compose down
登录、配置与数据清理Login, configuration and data cleanup

核对旧镜像后按 ID 清理Check old images before removing by ID

仅删除已确认不再使用的旧镜像,可使用 docker image rm IMAGE_ID(替换为核对后的 ID)。数据库卷、上传目录、.env 和浏览器会话属于用户数据;移除容器不等于清空这些数据。Remove only confirmed unused images with docker image rm IMAGE_ID, replacing the ID after checking. Database volumes, uploads, .env and browser sessions are user data; removing containers does not erase them.

docker image ls
官方资料 · 核对日期Official sources · Reviewed Docker Compose 部署与升级Docker Compose deployment and upgrades ↗
接入指南Setup guide

Chatbox

官方文档Official docs ↗

在应用设置里填写连接信息,无需编辑命令行配置文件。Enter the connection details in the app settings. No CLI configuration files are needed.

你的操作系统Your operating system
你要使用的模型Your model type

开始前,准备这两项Have these two things ready

GPT 选择 Chat Completions 分组;Claude 选择 Anthropic Messages 分组。For GPT, choose a Chat Completions group. For Claude, choose an Anthropic Messages group.

接入地址已填入下方示例The endpoint is already in the examples查看地址View endpoint ↓
API Base URLtext
https://newapi.world

已使用根地址,按下面示例填写。The root address is already set. Follow the examples below. 切换线路与地址规则Endpoints and address formats ↗

跟着步骤完成接入Follow these steps to connect

已有安装?从配置步骤开始即可Already installed? Start with configuration

先替换示例中的密钥和模型;出现 your-project 时,改成你自己的项目文件夹路径。Replace the key and model placeholders first. Replace your-project with the path to your own project folder.

Windows:安装并选择自定义提供方Windows: install and select a custom provider

在应用中操作In the application

在官网选择 Windows 安装包,安装后添加自定义提供方。按下一步的 GPT / Claude 配置填写本站 Host、Path 和用户 Key;不需要编辑 Codex 的 config.toml。Download the Windows installer from the official site and add a custom provider. Use the portal host, path and user key from the GPT / Claude examples above. No Codex config.toml changes are needed.

https://chatboxai.app
Settings → Model Provider → Add

macOS:安装并选择自定义提供方macOS: install and select a custom provider

在应用中操作In the application

在官网选择适配当前 Mac 的安装包,按提示完成安装,再添加自定义提供方。本站 Host、Path、Key 与 Windows 相同,直接在 Chatbox 设置中填写。Download the installer for your Mac from the official site, finish installation and add a custom provider. Enter the same portal host, path and key as on Windows directly in Chatbox settings.

https://chatboxai.app
Settings → Model Provider → Add

安装客户端Install the client

在应用中操作In the application
从 https://chatboxai.app 下载适合设备的客户端。
打开设置 → 模型提供方 → 添加自定义提供方。
Download the client for your device from https://chatboxai.app.
Open Settings → Model provider → Add custom provider.

GPT 对话:OpenAI 兼容配置GPT chat: OpenAI-compatible setup

在应用中操作In the application

适用于开放 Chat Completions 的分组。在提供方里添加模型,再到新对话中选择它;GPT 模型权限与 ChatGPT 订阅分别管理。Use a group with Chat Completions support. Add a model under the provider and select it in a new chat. GPT API access is separate from a ChatGPT subscription.

Provider: NewAPI GPT
API Mode: OpenAI API Compatible
API Host: https://newapi.world
API Path: /v1/chat/completions
API Key: YOUR_API_KEY
Model: YOUR_MODEL_ID

Claude 对话:Anthropic 兼容配置Claude chat: Anthropic-compatible setup

在应用中操作In the application

适用于带 Anthropic 兼容选项的版本。使用 Claude 分组的 Key;客户端如果已经自动拼接 /v1/messages,不要重复填写路径。For versions with an Anthropic-compatible option. Use a Claude group key. Do not duplicate /v1/messages if the client adds it automatically.

Provider: NewAPI Claude
API Mode: Anthropic API Compatible
API Host: https://newapi.world
API Path: /v1/messages
API Key: YOUR_API_KEY
Model: YOUR_MODEL_ID

Windows:选择本站模型并验证Windows: select a portal model and verify

在应用中操作In the application

选择刚添加的本站提供方及模型,发送一条消息,到本站用量页面核对。若仍选中客户端的默认服务商,该次对话不会自动改走本站。Select the portal provider and model you added, send a message and check portal usage. A chat using the client's default provider will not automatically route through this portal.

Check → Save → New Chat

macOS:选择本站模型并验证macOS: select a portal model and verify

在应用中操作In the application

保存后新建对话,选择本站提供方与模型,发送测试消息并核对用量。此客户端在设置中保存 Key,无需使用 launchctl 给它传入 Codex 的环境变量。Save, start a new chat, select the portal provider and model, then send a test message and check usage. Chatbox stores the key in its settings; it does not need Codex environment variables from launchctl.

Check → Save → New Chat

验证并保存Verify and save

在应用中操作In the application

连接检查成功后,新建对话发送简短消息,并在门户查看用量记录。只有 Responses 的分组,请使用 Codex 或明确支持 Responses 的客户端。After a successful connection check, send a short message in a new chat and review portal usage. For Responses-only groups, use Codex or a client with explicit Responses support.

Check → Save → New Chat

最后,确认请求确实走了本站Finally, check that your request used this portal

发送一条简短消息,再到用量明细核对这把 Key 的记录。出现记录才说明本站收到请求,测试调用按实际规则计费。Send a short message, then check this key in Usage. A matching record confirms the portal received your request. Test requests are billed normally.

查看用量View usage ↗
更新、卸载与清理Update, uninstall and clean up按需执行,不属于接入步骤Optional maintenance, separate from setup

安装、更新与清理Install, update and clean up

持久化变量与缓存Persistent variables and caches ↗
其他安装方式与维护Other installation methods and maintenance

更新与卸载客户端Update and uninstall the client

通过客户端更新入口、官方安装包或原应用商店更新。卸载前先导出需要的对话和设置,再通过操作系统的应用管理卸载。Update through the client, official installer or original app store. Export conversations and settings you need before uninstalling through your operating system.

https://chatboxai.app
登录、配置与数据清理Login, configuration and data cleanup

清理提供方与本地记录Remove providers and local records

在模型提供方设置中移除不再使用的 API Key 和地址。对话记录先导出备份,再从客户端删除;备份也可能含敏感内容。清除本机数据不会删除门户用量记录或撤销 Key。Remove unused API keys and addresses in provider settings. Export conversations before deleting them in the client; backups may contain sensitive data. Clearing local data does not remove portal usage records or revoke keys.

https://chatboxai.app/en/guide/faq/data-storage
官方资料 · 核对日期Official sources · Reviewed 数据与备份说明Data storage and backups ↗
接入指南Setup guide

Claude Desktop

官方文档Official docs ↗

需要应用中提供 Configure Third-Party Inference 入口;托管设备可能限制修改。The app must offer Configure Third-Party Inference. Managed devices may restrict changes.

你的操作系统Your operating system

开始前,准备这两项Have these two things ready

需要 Anthropic Messages 分组;本指南用于桌面端第三方推理模式。An Anthropic Messages group is required. This guide covers third-party inference on desktop.

接入地址已填入下方示例The endpoint is already in the examples查看地址View endpoint ↓
API Base URLtext
https://newapi.world

已使用根地址,按下面示例填写。The root address is already set. Follow the examples below. 切换线路与地址规则Endpoints and address formats ↗

跟着步骤完成接入Follow these steps to connect

已有安装?从配置步骤开始即可Already installed? Start with configuration

先替换示例中的密钥和模型;出现 your-project 时,改成你自己的项目文件夹路径。Replace the key and model placeholders first. Replace your-project with the path to your own project folder.

打开桌面端的网关设置Open desktop gateway settings

在应用中操作In the application

安装官方桌面应用,在登录界面的菜单中启用开发者模式,再进入第三方推理设置。Install the official app, enable developer mode from the login screen menu, then open third-party inference settings.

https://claude.com/download

Help → Troubleshooting → Enable Developer Mode
Developer → Configure Third-Party Inference…

填写 Gateway 配置Enter the gateway settings

在应用中操作In the application

Key 填写门户中创建的用户 API Key,地址填写根地址。保存配置后选择 Apply Changes,再 Save & Restart。Use your portal user API key and the gateway root URL. Choose Apply Changes, then Save & Restart.

Inference provider: Gateway
Gateway base URL: https://newapi.world
Credential kind: Static API key
Gateway auth scheme: Bearer
Gateway API key: YOUR_API_KEY

选择可用模型Select an available model

编辑配置文件Edit the configuration file

通常从 /v1/models 发现模型。如果列表为空,在配置窗口的模型列表填写准确 ID;此片段只说明 inferenceModels 字段,合并时保留其他配置。Models are usually discovered through /v1/models. If the list is empty, enter the exact ID in model settings. This snippet illustrates inferenceModels only; preserve the rest of your configuration.

{
  "inferenceModels": [
    "YOUR_MODEL_ID"
  ]
}

验证桌面端连接Verify the desktop connection

在应用中操作In the application

在第三方模式下发送消息,并到门户核对用量。模型、流式输出、工具调用需要分别验证。网关模式和官方订阅模式的功能范围可能不同。Send a message in third-party mode and check portal usage. Verify models, streaming, and tools separately. Gateway and subscription modes may offer different features.

Reply with: connection-ok

最后,确认请求确实走了本站Finally, check that your request used this portal

发送一条简短消息,再到用量明细核对这把 Key 的记录。出现记录才说明本站收到请求,测试调用按实际规则计费。Send a short message, then check this key in Usage. A matching record confirms the portal received your request. Test requests are billed normally.

查看用量View usage ↗
适用范围与配置说明Compatibility and configuration notes遇到版本差异时查看Check when versions differ

适用于提供 Configure Third-Party Inference 入口的桌面版本;组织托管设置可能锁定配置。CLI 的环境变量不会自动配置桌面端。For desktop versions with Configure Third-Party Inference. Organization policies may lock settings. CLI environment variables do not configure the desktop app automatically.

需要 Anthropic Messages 的流式响应与工具调用支持。先确认分组开放所选 Claude 模型,再验证具体功能;此配置不适用于 Claude 网页或手机客户端。Requires Anthropic Messages with streaming and tools. Confirm access to your Claude model and test each feature. These instructions do not apply to Claude web or mobile.

接入指南Setup guide

ChatGPT / Codex Desktop

官方文档Official docs ↗

确认应用包含支持自定义提供方的 Codex 工作区,再按系统操作。Check that your app includes a Codex workspace with custom provider support, then follow your OS instructions.

你的操作系统Your operating system

开始前,准备这两项Have these two things ready

仅适用于 Codex 工作区,不会自动更改普通 ChatGPT 对话的线路。需要 Responses 分组。For the Codex workspace only. This does not reroute regular ChatGPT chats. A Responses group is required.

接入地址已填入下方示例The endpoint is already in the examples查看地址View endpoint ↓
API Base URLtext
https://newapi.world/v1

已包含 /v1,按下面示例填写。The address already includes /v1. Follow the examples below. 切换线路与地址规则Endpoints and address formats ↗

跟着步骤完成接入Follow these steps to connect

已有安装?从配置步骤开始即可Already installed? Start with configuration

先替换示例中的密钥和模型;出现 your-project 时,改成你自己的项目文件夹路径。Replace the key and model placeholders first. Replace your-project with the path to your own project folder.

安装官方 Windows 桌面应用Install the official Windows desktop app

在终端中运行Run in your terminal · PowerShell

也可通过下方官方 Windows 文档进入 Microsoft Store 安装。已有桌面应用先核对版本与 Codex 工作区,不需要重复安装;仅安装 npm CLI 不会自动更新桌面应用。You can also open Microsoft Store from the official Windows guide below. If already installed, check the version and Codex workspace first. Installing the npm CLI does not update the desktop app.

winget install --id 9PLM9XGG6VKS -s msstore

打开并备份 Windows 配置文件Open and back up the Windows configuration

在终端中运行Run in your terminal · PowerShell

默认路径为 %USERPROFILE%\.codex\config.toml。在记事本中合并下一步的接入配置后保存;若桌面端提示了其他路径,以它实际读取的文件为准。The default path is %USERPROFILE%\.codex\config.toml. Merge the shared configuration in Notepad and save. If the desktop app reports a different path, use the file it actually reads.

$desktopConfigDir = if ($env:CODEX_HOME) { $env:CODEX_HOME } else { Join-Path $env:USERPROFILE ".codex" }
New-Item -ItemType Directory -Path $desktopConfigDir -Force -ErrorAction Stop | Out-Null
$desktopConfigPath = Join-Path $desktopConfigDir "config.toml"
if (Test-Path -LiteralPath $desktopConfigPath) {
  Copy-Item -LiteralPath $desktopConfigPath -Destination ($desktopConfigPath + ".backup-" + [guid]::NewGuid().ToString("N")) -ErrorAction Stop
} else {
  New-Item -ItemType File -Path $desktopConfigPath -ErrorAction Stop | Out-Null
}
notepad.exe $desktopConfigPath

把接入配置合并到刚打开的文件Merge these settings into the file you opened

编辑 config.tomlEdit config.toml

base_url 已使用本站配置的 API 地址。替换 YOUR_MODEL_ID,保留其他已有设置;model、model_provider、web_search 放在第一个表之前,合并同名提供方表,密钥通过 PORTAL_API_KEY 提供。base_url uses this portal's configured API address. Replace YOUR_MODEL_ID and preserve existing settings. Put model, model_provider and web_search before the first table, merge the provider table and supply the key through PORTAL_API_KEY.

model = "YOUR_MODEL_ID"
model_provider = "portal"
web_search = "disabled"

[model_providers.portal]
name = "NewAPI"
base_url = "https://newapi.world/v1"
wire_api = "responses"
env_key = "PORTAL_API_KEY"

让桌面应用读取本站用户 KeyMake the portal user key available to the desktop app

在终端中运行Run in your terminal · PowerShell

替换为本站用户 Key。该变量会保存在当前 Windows 用户环境中;关闭应用并重新登录 Windows,再从开始菜单打开应用。只在 PowerShell 设置 $env:PORTAL_API_KEY,不保证开始菜单启动的应用能读取。Replace the placeholder with your portal user key. Saves the variable in your Windows user environment. Close the app, sign in to Windows again and launch it from Start. A PowerShell-only $env:PORTAL_API_KEY may not reach apps launched from Start.

[Environment]::SetEnvironmentVariable("PORTAL_API_KEY", "YOUR_API_KEY", "User")

验证 Windows 桌面工作区Verify the Windows desktop workspace

在应用中操作In the application

重新打开 Codex 工作区,确认 provider 为 portal、模型与共用配置一致,再发起一次新任务。到本站“用量明细”核对这把 Key 的请求;普通 Chat 对话成功不能作为网关配置生效的证据。Reopen the Codex workspace and check that the provider is portal and the model matches your configuration. Start a new task and verify the key's request in portal Usage. A successful regular Chat conversation does not verify gateway routing.

Reply with exactly: gateway-ok

安装官方 macOS 桌面应用Install the official macOS desktop app

在应用中操作In the application

从官方页面下载适配芯片与系统版本的安装包,安装到“应用程序”。当前官方页面提供 Apple Silicon 下载;其他硬件按官方下载支持范围确认。已有应用先检查是否包含 Codex 工作区。Download an installer for your chip and OS from the official page and install it in Applications. The current page offers Apple Silicon downloads; check official support for other hardware. If already installed, check for the Codex workspace.

https://learn.chatgpt.com/docs/app

打开并备份 macOS 配置文件Open and back up the macOS configuration

在终端中运行Run in your terminal · Bash / Zsh

默认路径为 ~/.codex/config.toml。用纯文本模式合并下一步的接入配置并保存;若自定义了 CODEX_HOME,确保桌面应用与终端读取同一目录。The default path is ~/.codex/config.toml. Merge the shared configuration as plain text and save. If you set CODEX_HOME, ensure the desktop app and terminal use the same directory.

desktop_config_dir="${CODEX_HOME:-$HOME/.codex}"
(
  set -e
  mkdir -p "$desktop_config_dir"
  if [ -f "$desktop_config_dir/config.toml" ]; then
    cp -p -i "$desktop_config_dir/config.toml" "$desktop_config_dir/config.toml.backup-$(date +%Y%m%d-%H%M%S)"
  else
    (umask 077; touch "$desktop_config_dir/config.toml")
  fi
  open -e "$desktop_config_dir/config.toml"
)

把接入配置合并到刚打开的文件Merge these settings into the file you opened

编辑 config.tomlEdit config.toml

base_url 已使用本站配置的 API 地址。替换 YOUR_MODEL_ID,保留其他已有设置;model、model_provider、web_search 放在第一个表之前,合并同名提供方表,密钥通过 PORTAL_API_KEY 提供。base_url uses this portal's configured API address. Replace YOUR_MODEL_ID and preserve existing settings. Put model, model_provider and web_search before the first table, merge the provider table and supply the key through PORTAL_API_KEY.

model = "YOUR_MODEL_ID"
model_provider = "portal"
web_search = "disabled"

[model_providers.portal]
name = "NewAPI"
base_url = "https://newapi.world/v1"
wire_api = "responses"
env_key = "PORTAL_API_KEY"

把本站用户 Key 提供给图形界面应用Provide the portal user key to GUI apps

在终端中运行Run in your terminal · Bash / Zsh

先完全退出桌面应用,替换为本站用户 Key 后执行,再从“应用程序”重新打开。此方式用于当前 macOS 登录会话,注销或重启后需重新设置;仅在 .zshrc 中 export 不保证图形界面应用能读取。Fully quit the desktop app, substitute your portal user key, run the command and reopen from Applications. This applies to the current macOS login session; set it again after logout or restart. An export in .zshrc may not reach GUI apps.

launchctl setenv PORTAL_API_KEY "YOUR_API_KEY"

验证 macOS 桌面工作区Verify the macOS desktop workspace

在应用中操作In the application

在 Codex 工作区确认 provider 为 portal 和正确模型,发起新任务,再到本站“用量明细”核对对应 Key。若提示缺少 PORTAL_API_KEY,先完全退出应用再设置变量,随后重新打开。Confirm the portal provider and correct model in the Codex workspace. Start a task and check the key's portal Usage. If PORTAL_API_KEY is missing, fully quit the app, set the variable and reopen it.

Reply with exactly: gateway-ok

选择 Linux 发行版与安装包Choose a Linux distribution and installer

在应用中操作In the application

官方 Linux 桌面版目前为预览,按发行版与 CPU 架构选择安装包。Windows 内的 WSL 2 CLI 请沿用 Codex CLI 教程,无需为此另装 Linux 图形桌面。The official Linux desktop app is currently in preview. Choose the package for your distribution and architecture. For the CLI inside WSL 2, follow the Codex CLI guide; a Linux graphical desktop is not required.

https://learn.chatgpt.com/docs/linux/linux-app

合并 Linux / WSL 的配置Merge Linux / WSL configuration

在应用中操作In the application

先备份并合并下一步的接入配置。自定义 CODEX_HOME 时使用该目录;WSL 默认使用 Linux 用户目录,不会自动读取 Windows 用户的配置与密钥。Back up the file and merge the shared configuration. Use your custom CODEX_HOME if set. WSL defaults to the Linux user's home and does not automatically read Windows settings or keys.

~/.codex/config.toml

把接入配置合并到刚打开的文件Merge these settings into the file you opened

编辑 config.tomlEdit config.toml

base_url 已使用本站配置的 API 地址。替换 YOUR_MODEL_ID,保留其他已有设置;model、model_provider、web_search 放在第一个表之前,合并同名提供方表,密钥通过 PORTAL_API_KEY 提供。base_url uses this portal's configured API address. Replace YOUR_MODEL_ID and preserve existing settings. Put model, model_provider and web_search before the first table, merge the provider table and supply the key through PORTAL_API_KEY.

model = "YOUR_MODEL_ID"
model_provider = "portal"
web_search = "disabled"

[model_providers.portal]
name = "NewAPI"
base_url = "https://newapi.world/v1"
wire_api = "responses"
env_key = "PORTAL_API_KEY"

Linux 桌面:从持有 Key 的终端启动Linux desktop: launch from the terminal holding your key

在终端中运行Run in your terminal · Bash / Zsh

先完全退出桌面应用,安装完成后从同一终端启动并进入支持自定义提供方的 Codex 工作区。环境变量只作用于这次启动;菜单启动的进程不一定继承。Fully quit the desktop app. After installation, launch from this terminal and open a Codex workspace with custom provider support. The variable applies to this launch; apps launched from menus may not inherit it.

export PORTAL_API_KEY="YOUR_API_KEY"
chatgpt

最后,确认请求确实走了本站Finally, check that your request used this portal

发送一条简短消息,再到用量明细核对这把 Key 的记录。出现记录才说明本站收到请求,测试调用按实际规则计费。Send a short message, then check this key in Usage. A matching record confirms the portal received your request. Test requests are billed normally.

查看用量View usage ↗
配置已改好,窗口仍提示?查看重启与复查步骤Already fixed the config? Restart and recheck lingering warnings ↗
更多配置方式More setup options已有配置、其他安装方式与可选设置Existing setups, alternative installs, and optional settings

WSL 2:启动 Codex CLIWSL 2: launch Codex CLI

在终端中运行Run in your terminal · Bash / WSL

仅用于已安装 CLI 的 WSL 2 环境,与 Linux 桌面步骤按需选择。启动后用 /status 检查提供方与模型,发起测试请求,再核对本站用量。For WSL 2 with the CLI already installed. Choose this or the Linux desktop step as appropriate. Use /status to check the provider and model, send a test request and check portal usage.

export PORTAL_API_KEY="YOUR_API_KEY"
cd your-project
codex
适用范围与配置说明Compatibility and configuration notes遇到版本差异时查看Check when versions differ

本指南适用于官方文档所述的 Codex 桌面工作区。普通 ChatGPT Chat、网页与手机客户端是否提供自定义 API 入口,应按对应版本确认;填写网关不会获得官方订阅权益。This guide covers the Codex desktop workspace described in the official documentation. Check custom API support separately for regular ChatGPT Chat, web and mobile clients. Gateway configuration does not grant official subscription benefits.

选择支持 Responses、流式输出和工具调用的分组,使用本站创建的用户 API Key。登录本站的密码、网页 Token 和管理员 Key 都不能代替它。Choose a group supporting Responses, streaming and tool calls, and use a user API key created in this portal. Your portal password, web session token and admin key are not substitutes.

选择自己的操作系统,依次完成安装、配置和验证。CLI、桌面和 IDE 的版本可能不同;模型别名还需对应版本的模型目录支持。Choose your operating system, then install, configure, and verify. CLI, desktop, and IDE versions may differ; custom model aliases may require a model catalog compatible with that version.

桌面端使用本站的连接信息Portal connection details for your desktop app

Base URLtext
https://newapi.world/v1
填写项Field对应内容Value
Base URLhttps://newapi.world/v1保留结尾 /v1;不填写登录页或 /api/v1。Keep the trailing /v1. Do not use a login page or /api/v1.
API KeyYOUR_API_KEY替换为本站 API Keys 页面创建的用户密钥。Use a user key created on this portal's API Keys page.
ModelYOUR_MODEL_ID从本站模型页面选择当前分组可用的模型 ID。Choose a model ID available to your group on the portal Models page.
ProtocolResponses模型请求使用 Base URL 下的 /responses 路径。Model requests use /responses under the base URL.
想在 Windows / Mac 上直接与 GPT 对话?Want to chat with GPT on Windows or Mac?

如果使用的官方 Chat 界面没有自定义提供方入口,可安装 Chatbox,通过设置中的自定义 OpenAI 兼容提供方填写本站地址、用户 Key 和模型。下面 Codex 工作区的配置不能自动改变所有 Chat 对话的路由。If the official Chat interface has no custom provider setting, use Chatbox and add an OpenAI-compatible provider with the portal address, user key and model. The Codex workspace configuration below does not reroute every Chat conversation.

查看 Chatbox 的 Windows / macOS 配置View Chatbox setup for Windows / macOS ↗
停止使用时清理桌面接入Remove desktop credentials when finished

Windows:移除桌面接入凭据Windows: remove desktop connection credentials

在终端中运行Run in your terminal · PowerShell

仅在停止使用本站接入时执行,重新登录 Windows 后生效。需要阻止旧 Key 继续调用时,还应在本站停用或删除它。Use only when stopping portal access. Sign in to Windows again for the change to take effect. Disable or delete the key in the portal to prevent further use.

[Environment]::SetEnvironmentVariable("PORTAL_API_KEY", $null, "User")
Remove-Item Env:PORTAL_API_KEY -ErrorAction SilentlyContinue

macOS:移除桌面接入凭据macOS: remove desktop connection credentials

在终端中运行Run in your terminal · Bash / Zsh

完全退出桌面应用后执行。只移除当前登录会话与终端的变量;已写入启动脚本的条目需单独移除,门户 Key 的有效性在本站管理。Fully quit the app first. Removes variables from the current login session and terminal only. Remove saved startup-script entries separately; manage the key's validity in the portal.

launchctl unsetenv PORTAL_API_KEY
unset PORTAL_API_KEY
Codex 版本与旧配置迁移Codex versions and configuration migration ↗

需要时,再看这些More help when you need it

API Key 是什么,怎么创建?What is an API key, and how do I create one?
  1. 01

    为工具创建独立 KeyCreate a key for each tool

    进入 API Keys,点击创建,名称可填写 Claude Code、Codex 或 Chatbox,便于分别查看用量和停用。Open API Keys and create a key named after its tool, such as Claude Code, Codex, or Chatbox. This makes usage tracking and revocation easier.

  2. 02

    选择分组与模型Choose a group and model

    Claude 工具选择支持 Anthropic Messages 的分组;Codex 选择 Responses 分组;普通对话客户端按其支持的协议选择。模型 ID 从模型与价格页面复制。Choose an Anthropic Messages group for Claude tools, a Responses group for Codex, and a matching protocol for chat clients. Copy a model ID from Models & pricing.

  3. 03

    设置额度与有效期Set a spending cap and expiry

    按需填写消费额度和有效期。额度填 0 表示不设置 Key 上限,账户余额、订阅、分组权限和平台限额仍然生效。Set a spending cap and expiry as needed. A cap of 0 means no key-specific cap; balance, subscription, group permissions, and platform limits still apply.

  4. 04

    复制到自己的工具Copy the key into your tool

    将创建结果中的完整密钥替换 YOUR_API_KEY,模型替换 YOUR_MODEL_ID。不要复制列表里的掩码,也不要保留占位符。Replace YOUR_API_KEY with the complete created key and YOUR_MODEL_ID with your model. Do not copy a masked display value or leave placeholders unchanged.

工具使用用户 API Key。网页登录密码、验证码、登录 Token、管理员 Key 和上游账号凭据均不能作为这里的示例密钥。Use your user API key in tools. Login passwords, verification codes, session tokens, administrator keys, and upstream credentials are not suitable here.

请把密钥保存在自己的设备或密钥管理工具中。配置文件含真实 Key 时不要共享、提交到仓库或截图;泄露后立即停用并重新创建。Store keys on your device or in a secrets manager. Do not share, commit, or screenshot files with real keys. Revoke and replace an exposed key immediately.

不同线路的地址怎么填写?How do I use a different endpoint?

选择你的接入地区

按网络环境选择入口,工具配置使用对应地址。

接入指南
正在加载接入地区…

下表与代码使用本站默认示例地址。登录后可查看地区线路;使用其他线路时,请手动替换示例中的根地址或 /v1 地址,代码不会随地区选择自动改变。The table and code use the default example endpoint. Sign in to view regional routes. For another route, replace the root or /v1 URL manually; selecting a region does not update the code.

工具 / 客户端Tool / client填写的地址URL to enter请求路径Request path
Claude Code / Claude Desktophttps://newapi.world根地址,不加 /v1Root URL, without /v1/v1/messages
Codex / OpenAI SDKhttps://newapi.world/v1Base URL 带 /v1Include /v1 in the base URL/v1/responses
ChatGPT / Codex Desktophttps://newapi.world/v1适用于支持自定义提供方的 Codex 工作区For Codex workspaces with custom provider support/v1/responses
Chatbox · GPThttps://newapi.worldHost 与完整 Path 分开填写Enter the host and full path separately/v1/chat/completions
Chatbox · Claudehttps://newapi.world选择 Anthropic 兼容协议Select the Anthropic-compatible protocol/v1/messages
Gemini CLIhttps://newapi.world根地址,由工具拼接路径Root URL; the tool appends the path/v1beta/…

Base URL 是基础地址,不是完整请求地址。不要填控制台登录页、/api/v1 管理接口,或拼出 /v1/v1。各协议是否可用,以所选分组实际开放的能力为准。Use a base URL, not a complete request endpoint. Avoid login pages, /api/v1 management endpoints, and duplicate /v1/v1 paths. Available protocols depend on your access group.

已有安装,想更新或卸载?Already installed? Update or uninstall

选择工具,直接查看它的维护指南。更新、卸载和清理按需执行。Choose a tool to open its maintenance guide. Update, uninstall, or clean up only as needed.

桌面接入凭据清理Remove desktop credentials ↗
环境变量、缓存与通用排错Environment variables, caches, and troubleshooting
TOOL MAINTENANCE

持久化变量与缓存Persistent variables and caches

更新前先确认安装来源;卸载后按需处理登录、配置与缓存。多份安装或多个 Node.js 环境,需要分别检查。Check the installation source before updating. Handle login, settings and caches as needed after uninstalling. Check duplicate installations and separate Node.js environments individually.

卸载程序通常保留个人配置。退出登录、删除本机 Key 与撤销门户 Key 是不同操作;要让旧密钥停止调用,请在 API Keys 页面禁用或删除它。Uninstalling usually preserves personal settings. Signing out, removing a local key and revoking a portal key are separate actions. Disable or delete the key on the API Keys page to stop further calls. 管理 API KeyManage API keys ↗

命令与配置会随版本变化。先用工具的 --version 和 --help 核对当前能力;旧版缺少某个命令时,查阅对应版本文档或按原安装方式更新。不要将最新版示例整段覆盖旧配置。Commands and configuration change between versions. Check --version and --help first. If a command is unavailable, consult that release's documentation or update using the original installation method. Merge examples instead of replacing your entire configuration. Codex 版本与旧配置迁移Codex versions and configuration migration ↗

清除持久化环境变量Clear persistent environment variables

macOS / Linux

编辑自己实际使用的 ~/.zshrc、~/.zprofile、~/.bashrc 或 ~/.bash_profile,只移除对应工具的 export 行,再关闭旧终端重新打开。若 Key 写在工具配置、项目 .env 或系统服务中,也需逐项移除对应字段。不要清空整个配置文件。Edit the shell file you actually use: ~/.zshrc, ~/.zprofile, ~/.bashrc or ~/.bash_profile. Remove only the relevant export lines and reopen the terminal. Also remove matching key entries from tool settings, project .env or system services. Keep the rest of each configuration file.

Windows PowerShell

以下以 PORTAL_API_KEY 为例,清除当前用户保存的变量及当前终端变量。换成对应工具的变量名,退出旧终端和应用,重新登录系统后验证。机器级变量请在系统环境变量界面核对。This example removes PORTAL_API_KEY from saved user variables and the current terminal. Substitute the relevant variable name. Close old terminals and apps, then sign in again to verify. Check machine-level variables in System Environment Variables.

[Environment]::SetEnvironmentVariable("PORTAL_API_KEY", $null, "User")
Remove-Item Env:PORTAL_API_KEY -ErrorAction SilentlyContinue
工具Tool本教程使用的变量Variables used in this guide
Claude CodeANTHROPIC_BASE_URL
ANTHROPIC_AUTH_TOKEN
CodexPORTAL_API_KEY
Gemini CLIGEMINI_API_KEY
GOOGLE_GEMINI_BASE_URL
AiderOPENAI_API_BASE
OPENAI_API_KEY

OPENAI_API_KEY 等变量可能由多个工具共用,移除前确认其他工具是否仍需要。使用 nvm、fnm 或多个 Python 环境时,先切回原安装环境,再运行对应卸载命令。Variables such as OPENAI_API_KEY may be shared by multiple tools. Check before removing them. With nvm, fnm or multiple Python environments, switch to the original environment before uninstalling.

检查与清理 npm 缓存Check and clear npm caches

先检查缓存Check the cache first

适用于 npm 安装的 Claude Code、Codex、Gemini CLI。校验缓存并回收无用条目,通常先执行这一步。For npm installations of Claude Code, Codex and Gemini CLI. Verifies the cache and removes unused entries. Start here in most cases.

npm cache verify

可选:清空 npm 包缓存Optional: clear the npm package cache

仅在需要回收空间或排查缓存问题时执行。这会清理当前 npm 缓存位置的所有包缓存,影响其他 npm 工具的后续下载;不会卸载工具,也不会清除 CLI 会话和密钥。Use only to reclaim space or troubleshoot cache issues. Clears all packages in the current npm cache, affecting future downloads for other npm tools. Does not uninstall tools or clear CLI sessions and keys.

npm cache clean --force
npm 官方缓存说明Official npm cache documentation ↗
查看常见问题View common questions ↗