SpyBara
Go Premium

Documentation 2026-07-29 22:58 UTC to 2026-07-30 03:02 UTC

1 file changed +28 −0. View all changes and history on the product overview
2026
Thu 30 03:02 Wed 29 22:58 Tue 28 23:01 Mon 27 17:02 Sat 25 05:59 Fri 24 19:01 Thu 23 03:02 Wed 22 20:02 Tue 21 15:00 Mon 20 21:59 Sat 18 22:00 Fri 17 19:58 Thu 16 17:00 Wed 15 16:58 Tue 14 21:58 Mon 13 21:58 Sat 11 07:01 Fri 10 23:02 Thu 9 17:03 Wed 8 22:02 Mon 6 22:58 Sat 4 16:59
Details

8 8 

9This guide describes how Prompt Caching works in detail, so that you can optimize your prompts for lower latency and cost.9This guide describes how Prompt Caching works in detail, so that you can optimize your prompts for lower latency and cost.

10 10 

11## Caching behavior changes when migrating to GPT-5.6

12 

13GPT-5.6 models and later model families cache exact prompt prefixes at cache

14breakpoints. By default, the service places an implicit breakpoint at the latest

15user or tool message. Unlike earlier models, it does not automatically fall

16back to the longest matching unmarked prefix before that breakpoint.

17 

18For example, requests might share 4,000 tokens of instructions and other static

19content, followed by changing timestamps, tool-call history, or user input. If

20the implicit breakpoint includes that changing content, the full prefix at the

21breakpoint differs between requests. As a result, `cached_tokens` can be `0`

22even though the requests share thousands of identical tokens, and the service

23can repeatedly write the changing prefix to cache.

24 

25To reuse the shared content, add an explicit `prompt_cache_breakpoint` at the

26end of the stable prefix and set the same `prompt_cache_key` on requests that

27share it. Content after the breakpoint can then change without invalidating the

28cached prefix.

29 

30To avoid cache-write charges for the changing suffix, set

31`prompt_cache_options.mode` to `explicit`. This disables the implicit

32breakpoint, so only your explicit breakpoints are eligible for cache reads and

33writes. On GPT-5.6 models and later model families, cache writes cost 1.25× the

34uncached input token rate, so caching only the reusable prefix can reduce costs.

35 

36See [Prompt cache breakpoints](#prompt-cache-breakpoints) for request examples,

37supported content blocks, and cache policy options.

38 

11## Structuring prompts39## Structuring prompts

12 40 

13Cache hits are only possible for exact prefix matches within a prompt. To realize caching benefits, place static content like instructions and examples at the beginning of your prompt, and put variable content, such as user-specific information, at the end. This also applies to images and tools, which must be identical between requests.41Cache hits are only possible for exact prefix matches within a prompt. To realize caching benefits, place static content like instructions and examples at the beginning of your prompt, and put variable content, such as user-specific information, at the end. This also applies to images and tools, which must be identical between requests.