How Codex carries on a conversation: responses kept for 30 days

Coding with AICodex CLI·· 8 views· 2 min read

Codex talks to our API in the Responses format. In this format, each response has an id and is kept on our side for 30 days. That is how Codex can carry on a conversation without sending everything again.

How it works

1 Each response comes with an id that starts with resp_.
2 In the next request, Codex can send that id in previous_response_id. That way it carries on the conversation without sending it again.
3 The response is kept for 30 days. After that, it no longer exists.

Who can see a response

Only the account that made it. You can read it with GET /v1/responses/{id}, using a key with ai:read. It comes back exactly as it was returned. After 30 days, the answer is 404.

curl "https://api.interweb.co.mz/v1/responses/resp_..." -H "Authorization: Bearer $INTERWEB_API_KEY"

In Windows PowerShell, use curl.exe and $env:INTERWEB_API_KEY.

Codex's own sessions

Codex also has its own sessions. To go back to one, the official documentation gives:

Command What it does
codex resume Continues an earlier session by its id, or the most recent one.
/resume Inside Codex, resumes a chat from the session list.
/new Starts a new chat in the same session, without the earlier context.

A response older than 30 days no longer exists on our side. To pick up old work, start with /new and give Codex the context it needs.

What is charged

Each request pays for the tokens counted in usage, at the model price, or in Coding Plan points for the models in the plan. The prices are in the Models tab.

An account key with ai:read can read the saved responses. If a key leaks, revoke it at once: see what to do, in the right order.

Want to code with AI in Codex? Visit the Coding with AI page.

See Coding with AI

SEE ALSO

Codex CLI with All in One AI: creating config.toml, the key and the model

wire_api = "responses" in Codex: what it means and why it stays in the file

Errors in Codex CLI: the OpenAI format and the code field

An API key or token has leaked: what to do, in the right order

Coding with AI in All in One AI

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from $5.36/mo (3-year plan, with coupon)

See plans
Was this answer helpful? Your answer helps us improve this article.