Message schema
Requests include method, params, and id:
json
{ "method": "thread/start", "id": 10, "params": { "model": "gpt-5.6-terra" } }Responses echo the id with either result or error:
json
{ "id": 10, "result": { "thread": { "id": "thr_123" } } }json
{ "id": 10, "error": { "code": 123, "message": "Something went wrong" } }Notifications omit id and use only method and params:
json
{ "method": "turn/started", "params": { "turn": { "id": "turn_456" } } }You can generate a TypeScript schema or a JSON Schema bundle from the CLI. Each output is specific to the Codex version you ran, so the generated artifacts match that version exactly:
bash
codex app-server generate-ts --out ./schemas
codex app-server generate-json-schema --out ./schemas