Run Open Models in Codex CLI Without Replacing Your Config
Switch the model behind Codex for one run at a time. TogetherLink handles the Responses protocol bridge while keeping provider and model settings scoped to that run.
By TogetherLink
tcodexInstall and add your key
curl -fsSL https://togetherlink.vercel.app/install.sh | bashtogetherlink configuretcodexInstall Codex first with the official Codex CLI setup. If togetherlink configure asks for an Exa key, press Enter to skip unless you want proxy-backed web search.
In automation, you can skip local storage and set TOGETHER_API_KEY through your secret manager instead.
How TogetherLink connects Codex
Codex expects an OpenAI Responses-style endpoint. TogetherLink starts a local proxy that accepts that protocol, preserves the tool loop it relies on, and sends each model request to Together AI.
That provider exists only inside the Codex process TogetherLink launches. A later plain codex command follows your normal Codex provider configuration.
Codex CLI
Creates a Responses request and runs tools.
Local proxy
Adapts the protocol on localhost.
Together API
Runs the selected serverless model.
Back to Codex
Streams model events into the normal UI.
Run Codex headlessly or in CI
The same temporary provider works for one-shot repository checks. The final session line reports the Together AI token cost, which is useful in automation logs.
export TOGETHER_API_KEY=••••••••
togetherlink --model Qwen/Qwen3.7-Max \
codex exec "Review the current diff"When this setup is useful
Compare models
Run the same Codex workflow against two Together models without maintaining separate Codex configs.
Long repositories
Choose a larger-context model for tasks that require Codex to work with more files or longer histories.
Keep Codex
Retain Codex tools, approvals, and exec workflow while changing only the model provider for that run.
Three details that prevent most mistakes
- Use a Together key.An OpenAI key or ChatGPT subscription cannot authorize Together model calls.
- Put the model first.Write
--model … codex, notcodex --model …. - Read the banner.It should say: TogetherLink is routing Codex to Together AI, followed by the selected model.
Choose another model after the first run
Start with tcodex. When the task needs a different model, use its exact Together ID before codex.
moonshotai/Kimi-K3Default · vision · reasoning · 1M context
zai-org/GLM-5.2text · reasoning · 512K context
deepseek-ai/DeepSeek-V4-Pro-0813text · reasoning · 1M context
Qwen/Qwen3.7-Maxvision · reasoning · 1M context
deepseek-ai/DeepSeek-V4-Flash-0731text · reasoning · 1M context
togetherlink --model deepseek-ai/DeepSeek-V4-Pro-0813 codexThese are provider model limits. Codex may compact earlier to account for tokenizer differences.
FAQ
Can I connect Codex CLI to Together AI?+
Yes. TogetherLink launches Codex with a temporary provider that points to a local Responses-compatible proxy. The proxy translates Codex requests into Together AI model calls.
Which Together AI model does Codex use by default?+
TogetherLink currently defaults to moonshotai/Kimi-K3 for Codex. You can select another curated model with --model before the codex command.
Where does the --model flag go?+
Put TogetherLink's --model flag before codex: togetherlink --model deepseek-ai/DeepSeek-V4-Pro-0813 codex. Other Codex arguments go after codex.
Will this overwrite ~/.codex/config.toml?+
TogetherLink does not rewrite an existing non-empty Codex config. If ~/.codex/config.toml is missing or empty, TogetherLink seeds on-request approvals, workspace-write sandboxing, and automatic approval review. Provider and model settings remain temporary.
Does my OpenAI API key get sent to Together AI?+
No. Together AI requests use the Together API key you configure. Your regular Codex login remains available for runs you launch without TogetherLink.
Can I use Together AI with codex exec in CI?+
Yes. Codex exec uses the same temporary provider. Provide TOGETHER_API_KEY through your CI secret store and launch togetherlink with the model flag before codex exec.