Skip to content

Protocol conversion

This page documents the Codex route used by Codex Desktop and Codex CLI. VS Code is supported too, and more agents are being added; each route follows the same conversion model.

The Nexus Composer local proxy converts Codex requests to the protocol the selected upstream provider speaks. Conversion is transparent — Codex keeps speaking its native API and needs no provider-specific request code.

Composer routes each request to one upstream provider, based on the active route and selected model. Switching providers changes the destination for subsequent requests — it never fans out, mirrors, or compares the same request across OpenAI Official and OneNexus.

The proxy listens locally for Codex and speaks the selected upstream’s format:

  • OpenAI Responses/v1/responses, preserving reasoning items and encrypted reasoning state so sessions can resume.
  • OpenAI Chat Completions — the upstream format for OneNexus-hosted models; Codex Responses requests convert to it, with tool calls mapped both ways.
  • Codex — the store and previous_response_id fields are tracked in one shared session store, so a conversation can continue on either backend regardless of where it started; switching provider does not strand the session or force you to re-send its history.

A Codex Responses request, converted to the Chat Completions format before being sent upstream:

{
"model": "glm-5.3",
"max_tokens": 65536,
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "Refactor the retry loop to use backoff." }
]
}