How to get cache hits
- Put what stays the same first. System prompt, tool definitions and reference documents go at the start; the part that changes goes at the end.
- Keep earlier turns unchanged. In a conversation, send the previous messages exactly as before and add the new ones at the end. Editing an early message makes everything after it uncached.
- Use the same API key for a conversation. fastrun sends the requests of one conversation (the same key, model, system prompt and first user message) to the same GPU server, where its earlier turns are cached.
Seeing cache hits
usage.prompt_tokens_details.cached_tokens tells you how many input tokens came from the cache:

