AI EngineerGuide

prompt_cache_retention becomes prompt_cache_options.ttl on GPT-6

Behavior change Applies to gpt-6* on the OpenAI Chat Completions and OpenAI Responses API.

OpenAI's docs describe this behavior change but don't quote the exact message, so we don't either.

How to fix it

Replace prompt_cache_retention with prompt_cache_options.ttl. Check the allowed TTL values in the docs.

Before
{
  "messages": [
    {
      "content": "Summarize this ticket.",
      "role": "user"
    }
  ],
  "model": "gpt-4o-2024-08-06",
  "prompt_cache_retention": "24h"
}
After (GPT-6 Luna)
{
  "messages": [
    {
      "content": "Summarize this ticket.",
      "role": "user"
    }
  ],
  "model": "gpt-6-luna",
  "prompt_cache_options": {
    "ttl": "24h"
  }
}

Official source

replace prompt_cache_retention with prompt_cache_options.ttl

https://developers.openai.com/api/docs/guides/latest-model (last checked 2026-11-02)

Other changes for the same models

All migration errors

FAQ

How do I fix this when moving to gpt-6*?

Replace prompt_cache_retention with prompt_cache_options.ttl. Check the allowed TTL values in the docs.

Where is this documented?

In OpenAI’s official docs: https://developers.openai.com/api/docs/guides/latest-model, last checked 2026-11-02.