OpenAI has recently published a detailed architecture description of the Codex App Server, a bidirectional protocol that decouples the Codex coding agent's core logic from its various client surfaces.
Tip: If the request depends on cookies/session, you must run the script on the same origin you captured it from so the browser sends the right credentials.