跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.llmeasy.ru/llms.txt

Use this file to discover all available pages before exploring further.

在 Codex 中接入 LLMEasy,需要配置自定义模型提供商和 API Key。base_url 必须填写为 https://www.llmeasy.ru/v1,协议为 OpenAI Responses

前置条件

  • 已安装 Node.js
  • 已获取 LLMEasy API Key(注册并获取 (https://www.llmeasy.ru/register))
配置前请先清除 OpenAI 相关环境变量,避免它们覆盖 config.tomlauth.json 中的设置。需要清除的变量包括:
  • OPENAI_API_KEY
  • OPENAI_BASE_URL
macOS / Linux 执行:
unset OPENAI_API_KEY
unset OPENAI_BASE_URL
Windows PowerShell 执行:
Remove-Item Env:OPENAI_API_KEY -ErrorAction SilentlyContinue
Remove-Item Env:OPENAI_BASE_URL -ErrorAction SilentlyContinue
[Environment]::SetEnvironmentVariable("OPENAI_API_KEY", $null, "User")
[Environment]::SetEnvironmentVariable("OPENAI_BASE_URL", $null, "User")

安装 Codex

npm install -g @openai/codex

配置步骤

你可以直接运行 LLMEasy 提供的自动配置脚本。它只负责写入 LLMEasy provider 配置,不替代页面上方的安装前置条件。脚本需要 Node.js。如果你没有显式传入 API Key 或模型,脚本会按工具能力提示你交互输入。按你的操作系统执行对应步骤。你只需要执行其中一项。
1

如果你使用 macOS / Linux

curl -fsSL https://www.llmeasy.ru/install-codex-provider.sh | bash
2

如果你使用 Windows

iwr https://www.llmeasy.ru/install-codex-provider.ps1 -OutFile "$env:TEMP\install-codex-provider.ps1"; powershell -ExecutionPolicy Bypass -File "$env:TEMP\install-codex-provider.ps1"

验证配置

启动后,向 Codex 发送一条测试消息,确认收到正常回复即表示配置成功。 如遇到连接问题,请检查:
  1. base_url 是否填写为 https://www.llmeasy.ru/v1
  2. wire_api 是否保持为 responses
  3. model 是否为从模型广场 (https://www.llmeasy.ru/pricing)复制的 Codex 分组模型 ID
  4. ~/.codex/auth.json 中的 OPENAI_API_KEY 是否为你的 LLMEasy API Key
  5. 是否有旧的 OPENAI_API_KEYOPENAI_BASE_URL 环境变量在干扰配置