Server-side conversation state.
When a provider holds your conversation and you send it a pointer instead of a transcript, three things you thought you owned become API calls: replaying a step, deleting a user's data, and moving to another model. OpenAI's Responses API stores by default — store "defaults to true when omitted", and stored response data is kept "for at least 30 days" — so the custody decision is one you make by not making it. Treat server-side state as a cache you rent, and keep the authoritative copy yourself.
Step 1Two API shapes, and only one of them forgets.
A stateless chat API has no memory of your conversation at all. Every request carries the full message list; the provider processes it and discards it. Anthropic's Messages API works this way, which is why an agent loop re-sends its whole transcript on every step and why agent cost grows roughly with the square of the step count.
A stateful API inverts the default. With OpenAI's Responses API you pass previous_response_id, documented as "the unique ID of the previous response to the model… use this to create multi-turn conversations", or you attach a conversation, whose items "are prepended to input_items for this response request" and to which the request's inputs and outputs "are automatically added… after this response completes". The two are mutually exclusive. What you send is a handle; what the model sees is assembled on the other side of the wire.
- The storage is the default, not the feature.
storedefaults to true even when you never use a pointer, so an ordinary one-shot call retains the response unless you opt out. - The retention is a floor, not a ceiling. "At least 30 days" is the documented commitment, subject to data-retention exceptions — which is a different shape of promise from the one your own database makes.
- Statelessness becomes a mode you select. The SDK's documentation for
includedescribes reasoning items being used "statelessly (like when thestoreparameter is set tofalse…)", which tells you which path is the exception.
Step 2What you actually gain, stated honestly.
The usual pitch is smaller requests, and that is real but smaller than it sounds — the provider still bills for the tokens the model reads, whether you sent them or it fetched them. Two of the gains are worth more than the bandwidth.
- Opaque artefacts survive the turn. Every major reasoning API now returns its internal reasoning in a form you cannot read or reconstruct, and carrying it across tool calls is the difference between a model resuming its chain and restarting it. Server-side state is the path where that happens for free; the stateless path means handling the encrypted blob yourself, byte-exact, which reasoning summaries and encrypted traces works through in detail.
- The prefix is assembled where the cache lives. You stop being able to accidentally break a cache entry by re-ordering your own message array, because you are not building the array. That is a real reliability gain over hand-rolled prompt caching, and it is the one argument for the stateful shape that has nothing to do with convenience.
Notice what is not on the list: this is not memory. A conversation handle is a transcript the provider is holding for you, not a store that learns, retrieves or forgets on purpose. Agent memory is a thing you build; this is a thing you stop carrying.
Step 3Four capabilities that quietly become somebody else's API.
The cost is not privacy in the abstract. It is that four concrete operations you were going to perform against your own database now require a request to a system you do not run.
- Replay. Your trace records the pointer you sent, not the messages the model was given. A replay test needs the resolved input, and "resolve this handle to the exact array the model saw" is a capability you have only as far as the provider offers it — and only for as long as the retention window lasts. A trajectory that cannot be re-materialised is a log, not an eval fixture.
- Erasure. A deletion request now has a second system in scope, with its own clock. Erasure against agent memory is already hard when you own every copy; it gets harder when one copy expires on a schedule you did not set.
- Portability. A response ID is vendor-shaped. Migrating a live conversation to another provider means rebuilding the message array from your own records — which means you had to keep your own records anyway, so the "we do not need to store the transcript" saving was never available. See prompt portability and model deprecation and migration.
- The regulated path. Organisations under a zero-data-retention arrangement cannot use the stored path at all, so your most compliance-sensitive customer forces the stateless shape on you. If you built only the stateful one, that customer is a rewrite rather than a configuration flag — the same trap zero data retention describes.
The failure mode is specific and common: a team adopts previous_response_id because it shortens the code, stops writing full transcripts to its own store, and discovers the gap at the worst moment — during an incident review of a run whose response IDs are now older than the retention window. The pointer resolved last week. There is nothing to read now, and nothing to re-run.
Step 4Rent the cache, own the record.
The resolution is not to refuse server-side state. It is to be explicit about which copy is authoritative, and to make that your own one in every case.
- Log the resolved input, not the handle. Whatever your observability captures, it must be re-runnable without the provider. If you send a pointer, write the message array you believe it stands for alongside the span.
- Decide
storedeliberately, per environment. It defaults to true. Set it in code where you want retention and set it to false where you do not, so the answer to "is this conversation on someone else's disk?" is in your repository rather than in a default. - Keep the stateless path exercised. Run at least one tier of your product — or one CI suite — without server-side state. A path that has never run is not a path you have.
- Use the handle for what only it can do. Carrying encrypted reasoning across tool calls is the strong case. Saving bandwidth is the weak one, and it is the one that quietly moves your custody.
Write the one-line rule into your client wrapper: the provider's copy is a cache, your copy is the record. Concretely, that means every agent step persists the full resolved input and output to storage you control before it returns, and store is set explicitly on every call. You give up nothing — you can still use previous_response_id for the reasoning continuity it uniquely provides — and you keep replay, erasure and the ability to change vendor on a Tuesday.
Related: context windows for the ceiling the transcript grows into, data residency and sovereignty for where that stored copy physically sits, and short vs long-term memory for the thing this is often mistaken for.