From: Anderson A. Giacomolli Date: Fri, 6 Nov 2026 17:19:03 +0000 (-0300) Subject: Send model calls to a Responses endpoint X-Git-Url: https://git.giacomolli.uk/onechat/commitdiff_plain/1c1771140063b1b4aa5d508ced1b285e773fce04?ds=sidebyside;hp=1c1771140063b1b4aa5d508ced1b285e773fce04 Send model calls to a Responses endpoint One client sends every model call of an agent. The ChatGPT backend and the OpenAI API take the same request body, so the client differs between them only in its URL and its credentials. Each request sets store to false and stream to true, sends the input as a list, asks for the encrypted reasoning, and carries the fixed cache key of the agent, so the turns and the compactions share one prompt cache. It never sends max_output_tokens or metadata, which the ChatGPT backend refuses. The client reads the event stream until the response completes and fails on a failed, incomplete, or cut stream. Each call, also a failed one, adds a line to usage.jsonl with the model, the input, cached, and output tokens, the HTTP status, and the x-codex-* quota headers. Issue: b14d537 ---