OpenAI adds support for 12-hour Responses API prompt caching to three SDKs
OpenAI's Python v3.45.0, Node.js v7.50.0, and Java v4.99.0 add support for the Responses API's 12-hour prompt cache setting and cache-write usage fields. These are updates to the three SDKs.
Use the longer cache for input that will be reused hours later
On supported models, set prompt_cache_options.ttl to 12h for stable material that appears repeatedly, such as shared instructions or a long reference document. The default remains 30m, which suits conversation context reused frequently over short periods.
Twelve hours is a minimum cache lifetime. It is neither a deletion deadline nor a guarantee of a cache hit. The request still needs a matching eligible input prefix. Earlier models use the separate prompt_cache_retention setting.
Compare write costs before choosing what to keep
According to OpenAI's prompt caching guide, 30-minute writes cost 1.25 times the normal input rate and 12-hour writes cost 2.5 times that rate. The cache-read rate is the same for both. For stable material likely to be reused multiple times after 30 minutes, compare the options using measured cache reads and writes.
