(function () { window.DOCS_I18N = { zh: { lang: "zh-CN", localeLabel: "语言", viewDocs: "查看文档", goLogin: "登录", dashboard: "控制台", themeDark: "切换到深色模式", themeLight: "切换到浅色模式", titleSuffix: "大模型 API 接入文档", messages: { copy: "复制", copied: "已复制", copyFailed: "复制失败,请手动复制。", pasteApiKeyFirst: "请先粘贴 API Key。", tryingOpen: "正在尝试拉起 CC-Switch...", clientNotOpened: "没有拉起客户端。请先安装 CC-Switch,或检查协议处理程序是否已注册。", deepLinkCopied: "CC-Switch 深链已复制。", importFailed: "导入失败。", copyRootHost: "复制根 Host", copyV1: "复制 /v1", }, hero: { priority: "CC-Switch 优先", defaultHostLabel: "默认 Host:", docPathLabel: "文档路径:", title: "大模型 API 接入文档", copyHtml: '推荐流程:先进入 /keys 创建或复制 API Key,再优先点击 导入到 CCS 一键导入到 CC-Switch。其余客户端按对应协议接入:OpenAI SDK / HTTP 使用 /v1,Claude Code 使用根 Host,Gemini / OpenClaw / Hermes 按各自配置格式接入。', actions: ["进入 API 密钥", "下载 CC-Switch", "查看 Host 列表"], statLabels: ["默认主 Host", "站内取 Key 路径", "文档放置方式", "兼容协议"], keyPathHtml: "/keys -> 创建密钥 / 使用密钥 / 导入到 CCS", placement: "静态页,适合挂到文档链接或自定义菜单", protocols: "OpenAI / Claude / Gemini / Responses / OpenClaw / Hermes", }, sidebar: { title: "目录", links: [ "快速开始", "CC-Switch", "支持平台概览", "Host 列表", "HTTP 示例", "JavaScript SDK", "Python SDK", "Claude Code", "Gemini CLI", "Codex CLI", "OpenCode", "OpenClaw", "Hermes", "常见问题", ], }, quickstart: { title: "快速开始", descHtml: '默认推荐走 CC-Switch。它和站内 API 密钥 页面已经对齐,拿到 Key 后可以直接一键导入。', cards: [ { title: "获取 API Key", bodyHtml: '登录站点后进入 /keys。创建密钥后,列表行内可以直接看到 使用密钥导入到 CCS 两个动作。', }, { title: "优先一键导入", bodyHtml: '点击 导入到 CCS。OpenAI 分组会导入为 Codex,Anthropic 分组导入为 Claude Code,Gemini 分组导入为 Gemini CLI,Antigravity 会先让你选 Claude 或 Gemini。', }, { title: "按客户端使用", bodyHtml: "如果不使用 CC-Switch,按下方目录选择对应格式:HTTP、OpenAI SDK、Claude Code、Gemini CLI、Codex CLI、OpenClaw、Hermes。", }, ], noteHtml: '后台管理员如果隐藏了 导入到 CCS 按钮,用户仍然可以在本页使用“手动导入 CC-Switch”工具,或按下方 CLI / SDK 示例手动配置。', }, ccswitch: { title: "CC-Switch", descHtml: '站内默认推荐使用 CC-Switch。先在站内 /keys 获取 API Key,再导入到对应客户端配置。', cards: { download: { title: "下载安装索引", items: [ '官方 Releases:GitHub Releases', 'Windows:推荐 CC-Switch-*-Windows.msi;便携版可用 Windows-Portable.zip', 'macOS:推荐 macOS.zip;Homebrew 可用 brew tap farion1231/ccswitch + brew install --cask cc-switch', 'Linux:Debian/Ubuntu 用 .deb,Fedora/RHEL 用 .rpm,通用可用 .AppImage', ], actions: ["打开下载页", "去 API 密钥"], }, oneClick: { title: "站内一键导入位置", items: [ "路径:/keys", '拿到 Key 后,点击同一行的 导入到 CCS', 'Antigravity 分组会先选择导入到 Claude CodeGemini CLI', "导入完成后,在 CC-Switch 对应应用的 Provider 列表里查看", ], noteHtml: '如果点击导入后没有拉起客户端,通常是 CC-Switch 未安装,或系统还没有注册 ccswitch:// 协议。', }, importMap: { title: "导入映射", headers: ["站内分组", "导入应用", "CC-Switch Endpoint"], rows: [ ["OpenAI", "Codex", "HOST"], ["Anthropic / Claude", "Claude Code", "HOST"], ["Gemini", "Gemini CLI", "HOST"], [ "Antigravity", "Claude Code / Gemini CLI", "HOST/antigravity", ], ], }, manual: { title: "手动导入 CC-Switch", labels: ["Host", "导入类型", "Provider 名称", "API Key"], hostHelpHtml: '默认优先使用 https://re.94xy.cn。', apiKeyPlaceholder: "粘贴从 /keys 复制出来的 API Key", buttons: ["导入到 CC-Switch", "复制深链"], options: [ "OpenAI / Codex", "Claude Code", "Gemini CLI", "Antigravity -> Claude", "Antigravity -> Gemini", ], }, }, }, overview: { title: "支持平台概览", descHtml: '不同客户端读取 Host 的方式不一样。HTTP / OpenAI SDK 通常需要显式写 /v1;站内 CLI 配置模板大多使用根 Host。', headers: ["平台 / 客户端", "协议", "推荐写法", "说明"], rows: [ [ "HTTP / OpenAI SDK", "OpenAI Chat / Responses", 'https://re.94xy.cn/v1', "标准服务端与脚本最稳妥", ], [ "Claude Code", "Anthropic 兼容", 'https://re.94xy.cn', "使用 ANTHROPIC_BASE_URL", ], [ "Gemini CLI", "Gemini CLI 兼容", 'https://re.94xy.cn', "使用 GOOGLE_GEMINI_BASE_URL", ], [ "Codex CLI", "OpenAI Responses", 'https://re.94xy.cn', "按站内生成模板写入 ~/.codex", ], [ "OpenCode", "OpenAI / Anthropic / Google Provider", 'https://re.94xy.cn/v1', "OpenAI 分组按 baseURL 配置", ], [ "OpenClaw", "Custom Provider", 'https://re.94xy.cn/v1', '按 ~/.openclaw/openclaw.jsonmodels.providers', ], [ "Hermes", "Custom Endpoint", 'https://re.94xy.cn/v1', "当前版本使用 ~/.hermes/config.yaml", ], ], }, hosts: { title: "API 接口地址 Host 列表", descHtml: '默认主 Host 为 re.94xy.cn。如果后台配置了公开的 API Base URL 或自定义端点,下方会自动带出来。', noteHtml: 'HTTP / OpenAI SDK 通常写 HOST/v1;Gemini / OpenClaw / Hermes 的详细格式看各自章节。站内 API 密钥 页面也会展示管理员配置的可用 Host。', }, http: { title: "HTTP 示例", descHtml: '直接脚本、后端服务、第三方网关优先用 OpenAI 兼容格式。下方示例默认使用 https://re.94xy.cn/v1。', }, sdkJs: { title: "JavaScript SDK", descHtml: "只要 SDK 支持自定义 baseURL,大多数都能直接接入。", }, sdkPython: { title: "Python SDK", descHtml: 'Python 接入方式和 JavaScript 一样,关键是把 base_url 指向网关的 /v1。', }, claude: { title: "Claude Code", descHtml: 'Claude Code 按站内现有模板使用根 Host,不额外拼 /v1。', }, gemini: { title: "Gemini CLI", descHtml: "Gemini CLI 也使用根 Host。模型名按你当前可用权限调整。", }, codex: { title: "Codex CLI", descHtml: '站内 使用密钥 页面给 Codex CLI 生成的是 ~/.codex/config.tomlauth.json 两个文件。以下格式与站内模板一致。', }, opencode: { title: "OpenCode", descHtml: 'OpenCode 建议写入 opencode.json。OpenAI 分组的核心是 provider.openai.options.baseURLapiKey。', }, openclaw: { title: "OpenClaw", descHtml: 'OpenClaw 当前推荐按 ~/.openclaw/openclaw.jsonmodels.providers 写自定义 Provider。这里采用站内实际生成格式:OpenAI 分组使用 api: "openai-responses"。', noteHtml: '参考 OpenClaw 官方模型提供者文档:自定义 Provider 建议放在 models.providers 下,并按实际后端选择 openai-responses 或其他 API 类型。', }, hermes: { title: "Hermes", descHtml: 'Hermes 当前版本以 ~/.hermes/config.yaml 为准。官方文档已经明确:旧的 OPENAI_BASE_URL / LLM_MODEL 环境变量不再作为主配置来源。', interactiveTitle: "交互式配置", warningHtml: '当前 Hermes 的自定义端点以 config.yaml 为单一事实来源。不要再依赖旧版 .env 里的 OPENAI_BASE_URL。', }, faq: { title: "常见问题", headers: ["问题", "排查方向"], rows: [ [ "CC-Switch 一键导入没有拉起", '确认已安装 CC-Switch,且系统已注册 ccswitch:// 协议;否则先走安装。', ], [ "401 / invalid_api_key", '检查 Key 是否从 /keys 复制完整,确认没有多空格、换行或旧 Key。', ], [ "403", "密钥可能被禁用、触发 IP 限制,或当前分组不可用。", ], [ "404", '大多数是 Host 或路径写错。HTTP / SDK 常用 /v1;Claude / Gemini / Codex CLI 多数写根 Host。', ], [ "Hermes / OpenClaw 不工作", '先确认配置文件路径正确,再确认 Host 是否按当前客户端格式填写。OpenClaw 看 openclaw.json,Hermes 看 ~/.hermes/config.yaml。', ], ], }, footerHtml: '静态文档地址:/docs/api.html', codeTitles: { httpChat: "cURL /v1/chat/completions", httpModels: "cURL /v1/models", sdkJs: "openai npm", sdkPython: "openai python", claude: "macOS / Linux", gemini: "macOS / Linux", codexConfig: "~/.codex/config.toml", codexAuth: "~/.codex/auth.json", opencode: "opencode.json", openclaw: "~/.openclaw/openclaw.json", hermes: "~/.hermes/config.yaml", hermesInteractive: "交互式配置", }, codeSamples: { httpChat: `curl https://re.94xy.cn/v1/chat/completions \\ -H "Authorization: Bearer YOUR_API_KEY" \\ -H "Content-Type: application/json" \\ -d '{ "model": "gpt-5.4", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "请给我一份三点接入建议"} ] }'`, hermesInteractive: `hermes model # 选择 "Custom endpoint (self-hosted / VLLM / etc.)" # API base URL: https://re.94xy.cn/v1 # API key: YOUR_API_KEY # Model name: gpt-5.4`, }, hostCard: { fallbackDesc: "公开可访问的网关入口", labels: { root: "根 Host", openai: "OpenAI SDK / HTTP", gemini: "Gemini / OpenClaw / Hermes", antigravity: "Antigravity", }, builtin: { default: { name: "默认主 Host", description: "文档默认推荐值", }, current: { name: "当前访问地址", description: "当前浏览器访问的站点地址", }, apiBase: { name: "后台 API Base URL", description: "系统设置 -> 通用设置 中公开的 API Base URL", }, customPrefix: "自定义端点", customDescription: "后台公开的自定义 Host", }, }, }, en: { lang: "en", localeLabel: "Language", viewDocs: "Docs", goLogin: "Login", dashboard: "Dashboard", themeDark: "Switch to dark mode", themeLight: "Switch to light mode", titleSuffix: "API Integration Guide", messages: { copy: "Copy", copied: "Copied", copyFailed: "Copy failed. Please copy it manually.", pasteApiKeyFirst: "Paste an API key first.", tryingOpen: "Trying to open CC-Switch...", clientNotOpened: "The client was not opened. Install CC-Switch or check whether the protocol handler is registered.", deepLinkCopied: "CC-Switch deep link copied.", importFailed: "Import failed.", copyRootHost: "Copy root host", copyV1: "Copy /v1", }, hero: { priority: "CC-Switch First", defaultHostLabel: "Default Host:", docPathLabel: "Docs path:", title: "API Integration Guide", copyHtml: 'Recommended flow: go to /keys to create or copy an API key, then click Import to CCS to import it into CC-Switch in one step. For other clients, use the matching protocol: OpenAI SDK / HTTP uses /v1; Claude Code uses the root host; Gemini / OpenClaw / Hermes use their own config formats.', actions: ["Open API Keys", "Download CC-Switch", "View Host List"], statLabels: [ "Default host", "Where to get keys", "Recommended placement", "Supported protocols", ], keyPathHtml: "/keys -> create key / use key / import to CCS", placement: "Static page, suitable for the Docs link or a custom menu entry", protocols: "OpenAI / Claude / Gemini / Responses / OpenClaw / Hermes", }, sidebar: { title: "Contents", links: [ "Quick Start", "CC-Switch", "Platform Overview", "Host List", "HTTP Examples", "JavaScript SDK", "Python SDK", "Claude Code", "Gemini CLI", "Codex CLI", "OpenCode", "OpenClaw", "Hermes", "FAQ", ], }, quickstart: { title: "Quick Start", descHtml: 'CC-Switch is the default recommendation. It already matches the API Keys page on this site, so once you have a key you can import it directly.', cards: [ { title: "Get an API key", bodyHtml: 'After logging in, open /keys. Once a key is created, each row shows both Use Key and Import to CCS.', }, { title: "Prefer one-click import", bodyHtml: 'Click Import to CCS. OpenAI groups are imported as Codex, Anthropic groups as Claude Code, Gemini groups as Gemini CLI, and Antigravity lets you choose Claude or Gemini first.', }, { title: "Choose by client", bodyHtml: "If you do not use CC-Switch, pick the matching format below: HTTP, OpenAI SDK, Claude Code, Gemini CLI, Codex CLI, OpenClaw, or Hermes.", }, ], noteHtml: 'If the admin hides the Import to CCS button, users can still use the manual CC-Switch import tool on this page or configure the client manually with the CLI / SDK examples below.', }, ccswitch: { title: "CC-Switch", descHtml: 'CC-Switch is the default recommendation on this site. First get an API key from /keys, then import it into the target client.', cards: { download: { title: "Download Index", items: [ 'Official releases: GitHub Releases', 'Windows: use CC-Switch-*-Windows.msi; a portable build is available as Windows-Portable.zip', 'macOS: use macOS.zip; Homebrew is also available with brew tap farion1231/ccswitch + brew install --cask cc-switch', 'Linux: use .deb for Debian/Ubuntu, .rpm for Fedora/RHEL, or .AppImage for a generic build', ], actions: ["Open download page", "Open API Keys"], }, oneClick: { title: "Where one-click import lives", items: [ "Path: /keys", 'After you get the key, click Import to CCS on the same row', 'For Antigravity groups, choose either Claude Code or Gemini CLI first', "After import, check the provider list for that app inside CC-Switch", ], noteHtml: 'If clicking import does not open the client, CC-Switch is usually not installed yet, or the ccswitch:// protocol has not been registered on the system.', }, importMap: { title: "Import Mapping", headers: ["Site group", "Imported app", "CC-Switch endpoint"], rows: [ ["OpenAI", "Codex", "HOST"], ["Anthropic / Claude", "Claude Code", "HOST"], ["Gemini", "Gemini CLI", "HOST"], [ "Antigravity", "Claude Code / Gemini CLI", "HOST/antigravity", ], ], }, manual: { title: "Manual CC-Switch Import", labels: ["Host", "Import type", "Provider name", "API key"], hostHelpHtml: 'Default recommendation: https://re.94xy.cn.', apiKeyPlaceholder: "Paste the API key copied from /keys", buttons: ["Import to CC-Switch", "Copy deep link"], options: [ "OpenAI / Codex", "Claude Code", "Gemini CLI", "Antigravity -> Claude", "Antigravity -> Gemini", ], }, }, }, overview: { title: "Platform Overview", descHtml: 'Different clients read the host in different ways. HTTP / OpenAI SDK usually needs an explicit /v1; most CLI templates on this site use the root host.', headers: ["Platform / Client", "Protocol", "Recommended format", "Notes"], rows: [ [ "HTTP / OpenAI SDK", "OpenAI Chat / Responses", 'https://re.94xy.cn/v1', "Best default for servers and scripts", ], [ "Claude Code", "Anthropic compatible", 'https://re.94xy.cn', "Use ANTHROPIC_BASE_URL", ], [ "Gemini CLI", "Gemini CLI compatible", 'https://re.94xy.cn', "Use GOOGLE_GEMINI_BASE_URL", ], [ "Codex CLI", "OpenAI Responses", 'https://re.94xy.cn', "Write the template generated by this site into ~/.codex", ], [ "OpenCode", "OpenAI / Anthropic / Google Provider", 'https://re.94xy.cn/v1', "OpenAI groups use baseURL", ], [ "OpenClaw", "Custom Provider", 'https://re.94xy.cn/v1', 'Write models.providers in ~/.openclaw/openclaw.json', ], [ "Hermes", "Custom Endpoint", 'https://re.94xy.cn/v1', "Current releases use ~/.hermes/config.yaml", ], ], }, hosts: { title: "API Host List", descHtml: 'The default primary host is re.94xy.cn. If the admin configured a public API Base URL or custom endpoints, they will appear below automatically.', noteHtml: 'HTTP / OpenAI SDK usually uses HOST/v1; for Gemini / OpenClaw / Hermes, see each section for the exact format. The API Keys page on this site also shows the available hosts configured by the admin.', }, http: { title: "HTTP Examples", descHtml: 'For direct scripts, backend services, or third-party gateways, prefer the OpenAI-compatible format. The examples below use https://re.94xy.cn/v1.', }, sdkJs: { title: "JavaScript SDK", descHtml: "As long as the SDK supports a custom baseURL, most clients work directly.", }, sdkPython: { title: "Python SDK", descHtml: 'Python works the same way as JavaScript: point base_url at the gateway /v1.', }, claude: { title: "Claude Code", descHtml: 'Claude Code uses the root host from the current site templates and does not need an extra /v1.', }, gemini: { title: "Gemini CLI", descHtml: "Gemini CLI also uses the root host. Adjust the model name based on the access you currently have.", }, codex: { title: "Codex CLI", descHtml: 'The Use Key page on this site generates two files for Codex CLI: ~/.codex/config.toml and auth.json. The format below matches that template.', }, opencode: { title: "OpenCode", descHtml: 'OpenCode is best configured through opencode.json. For OpenAI groups, the key fields are provider.openai.options.baseURL and apiKey.', }, openclaw: { title: "OpenClaw", descHtml: 'For OpenClaw, the current recommendation is to define a custom provider in models.providers inside ~/.openclaw/openclaw.json. This page follows the format generated by the site: OpenAI groups use api: "openai-responses".', noteHtml: 'See the official OpenClaw provider docs as well: custom providers should live under models.providers, and the API type should match the backend, such as openai-responses.', }, hermes: { title: "Hermes", descHtml: 'Current Hermes releases use ~/.hermes/config.yaml. The official docs already make it clear that the older OPENAI_BASE_URL / LLM_MODEL environment variables are no longer the primary source of truth.', interactiveTitle: "Interactive setup", warningHtml: 'For Hermes, the custom endpoint should now be configured from config.yaml. Do not rely on the legacy OPENAI_BASE_URL value from older .env setups anymore.', }, faq: { title: "FAQ", headers: ["Issue", "What to check"], rows: [ [ "CC-Switch one-click import does not open", 'Confirm that CC-Switch is installed and the ccswitch:// protocol is registered on the system first.', ], [ "401 / invalid_api_key", 'Check whether the key was copied completely from /keys, without extra spaces, line breaks, or an older key value.', ], [ "403", "The key may have been disabled, failed an IP restriction, or the current group may not be available.", ], [ "404", 'Most of the time the host or path is wrong. HTTP / SDK usually uses /v1; Claude / Gemini / Codex CLI usually use the root host.', ], [ "Hermes / OpenClaw does not work", 'Check the config file path first, then verify the host format for the current client. OpenClaw uses openclaw.json; Hermes uses ~/.hermes/config.yaml.', ], ], }, footerHtml: 'Static docs path: /docs/api.html', codeTitles: { httpChat: "cURL /v1/chat/completions", httpModels: "cURL /v1/models", sdkJs: "openai npm", sdkPython: "openai python", claude: "macOS / Linux", gemini: "macOS / Linux", codexConfig: "~/.codex/config.toml", codexAuth: "~/.codex/auth.json", opencode: "opencode.json", openclaw: "~/.openclaw/openclaw.json", hermes: "~/.hermes/config.yaml", hermesInteractive: "Interactive setup", }, codeSamples: { httpChat: `curl https://re.94xy.cn/v1/chat/completions \\ -H "Authorization: Bearer YOUR_API_KEY" \\ -H "Content-Type: application/json" \\ -d '{ "model": "gpt-5.4", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Please give me three integration tips"} ] }'`, hermesInteractive: `hermes model # Choose "Custom endpoint (self-hosted / VLLM / etc.)" # API base URL: https://re.94xy.cn/v1 # API key: YOUR_API_KEY # Model name: gpt-5.4`, }, hostCard: { fallbackDesc: "Publicly accessible gateway entry", labels: { root: "Root host", openai: "OpenAI SDK / HTTP", gemini: "Gemini / OpenClaw / Hermes", antigravity: "Antigravity", }, builtin: { default: { name: "Default primary host", description: "Recommended default in this document", }, current: { name: "Current site origin", description: "The address currently opened in the browser", }, apiBase: { name: "Public API Base URL", description: "The public API Base URL exposed in Settings -> General", }, customPrefix: "Custom endpoint", customDescription: "Custom host exposed by the admin", }, }, }, }; })();