OpenAI Responses API `user` Migration: Split Safety from Prompt Caching
dev.to·
OpenAI’s Responses API update introduces an architectural separation between user safety tracking and prompt caching. Previously, user identification could collide with prompt caching strategies, but the new specification splits raw subject identity into a dedicated safety_identifier while reserving the prompt_cache_key strictly for reusable prompt structure (such as versioned prompt contracts like 12_support-flow_2_v3). By validating fourteen specific invariants through local JSON checks—such as ensuring raw identity is omitted, the safety identifier remains stable per subject, and matching prompt contracts share cache keys across users—developers can maintain high cache hit rates without compromising safety boundaries. For backend engineers and systems architects, understanding this pattern is essential for optimizing LLM latency and token costs while adhering to strict privacy and tenant isolation constraints.