OneHop Codex Config
中文简要说明
这是一个用来管理 OneHop 模型配置的小工具,不需要手动改文件,也不需要记命令。
怎么开始用
第一步,先把你的 OneHop 地址和密钥发到聊天里。
格式可以直接这样写:
baseurl https://api.onehop.ai/v1
api-key 你的密钥
或者这样写也可以:
https://api.onehop.ai/v1 你的密钥
只有先提供 baseurl 和 api-key,这个 skill 才能去读取模型列表、同步配置、检测当前模型状态。
第二步,再告诉它你要做什么。
你可以在聊天里直接说:
list:看看 OneHop 支持哪些模型,也看看本地已经保存了哪些模型配置sync:把 OneHop 支持的模型同步到本地,每个模型生成一个配置文件,并自动备份当前默认配置switch 模型名:切换到你想用的模型status:查看当前正在使用哪个模型,并做一次真实连通测试
如果你是第一次用,可以按这个顺序:
- 先发送
baseurl和api-key - 再用
list看模型 - 然后用
sync同步配置 - 再用
switch 模型名切换模型 - 最后用
status检查是否生效
一个完整例子:
baseurl https://api.onehop.ai/v1
api-key xxxxx
list
sync
switch openai/gpt-5.5
status
整个过程都可以直接在聊天窗口里完成。
Use this skill when the user wants to manage OneHop-backed Codex model configs without manually editing files or running commands.
All operations must be performed interactively in the chat window. Do not ask the user to run shell commands or invoke scripts manually.
Chat modes
-
listBehavior:- Probe
{base_url}/models - Filter models that support
openai_responsesand text output - Show the compatible remote model list in chat
- Show the local saved config files under
~/.codex/onehop/
- Probe
-
syncBehavior:- Probe
{base_url}/models - Filter compatible models
- Generate one config file per compatible model under
~/.codex/onehop/<model-slug>.config.toml - Back up the current default config
~/.codex/config.tomlinto~/.codex/onehop/backup-config-MM-DD-HH-MM-SS-ffffff.toml - Report which files were created
- Probe
-
switchBehavior:- Find the saved config matching the requested model name
- Back up the current default config to
~/.codex/onehop/backup-config-MM-DD-HH-MM-SS-ffffff.toml - Copy the requested model config to
~/.codex/config.toml - Confirm which model is now active
-
statusBehavior:- Read the current default config
~/.codex/config.toml - Show the current model, provider, and configured base URL
- Run one live question against the current model using the provided
base_urlandapi_key - Report the response as a real connectivity and model-use check
- Read the current default config
Natural triggers
- If the user asks to “列出模型” or says
list, uselist - If the user asks to “同步配置” or says
sync, usesync - If the user directly gives a model name, treat that as
switch - If the user asks “现在在用什么模型” or says
status, usestatus
Default policy
- Prefer
minimax/minimax-m3 - If
minimax/minimax-m3is unavailable, fall back toopenai/gpt-5.4 - If neither exists, choose the first model that supports
openai_responsesand text output - Set
model_reasoning_effort = "high"
File layout
- Default Codex config:
~/.codex/config.toml - Managed OneHop model configs:
~/.codex/onehop/<model-slug>.config.toml - Default-config backups:
~/.codex/onehop/backup-config-MM-DD-HH-MM-SS-ffffff.toml
Internal implementation
The bundled Python script is only an internal implementation detail:
$CODEX_HOME/skills/onehop-codex-config/scripts/generate_onehop_codex_config.py
If CODEX_HOME is unavailable:
~/.codex/skills/onehop-codex-config/scripts/generate_onehop_codex_config.py
The user must never be told to run this script directly.
Output template
Generated config content should look like:
model_provider = "OneHop-MM-DD-HH-MM-SS-ffffff"
model = "<selected_model>"
model_reasoning_effort = "high"
disable_response_storage = true
[model_providers."OneHop-MM-DD-HH-MM-SS-ffffff"]
name = "OneHop"
base_url = "<base_url>"
wire_api = "responses"
requires_openai_auth = true
experimental_bearer_token = "<api_key>"
Notes
- Do not invent model support. Probe
/models. - For
list, show both remote-compatible models and local-saved configs. - For
sync, generate one local config per compatible model unless the user asks for a subset. - For
switch, overwrite only~/.codex/config.toml, and always back it up first. - For
status, include a real live model test, so status also covers the old “check” behavior. - Managed config filenames must use sanitized model slugs, for example
openai-gpt-5-4.config.toml. - Keep the config content timestamped inside the file by using
model_provider = "OneHop-MM-DD-HH-MM-SS-ffffff".
微信扫一扫