Codex app-server Protocol Guide

Published March 2026 · 9 min

If you want your own Codex client, app-server is the integration surface. It gives you thread lifecycle, turn execution, streaming events, approvals, and model discovery over JSON-RPC.

Handshake first

Every connection must start with initialize followed by initialized. Skip that and requests fail.

{
  "method": "initialize",
  "id": 1,
  "params": { "clientInfo": { "name": "my_client", "version": "0.1.0" } }
}
{
  "method": "initialized",
  "params": {}
}

Core mental model

Minimum useful method set

Approvals are a product feature, not a side case

Your client must handle approval requests explicitly and render them clearly. In mobile contexts this is the difference between “it works in demo” and “it works in life.”

Tip: normalize message parsing for response shape variance (e.g., IDs nested under different result keys) and protect mobile clients from oversized history payloads.