Video #08 — Claude API in Go Series
Publish date: 2026-07-20
Type: Lightweight
Est. duration: ~16 min
- How prompt caching works and when it applies
- Adding
cache_control: ephemeralto system prompt blocks - Reading
CacheReadInputTokensfrom the usage object - Real token-count comparisons: cached vs uncached calls
- Caching conversation prefixes and large documents
- Go 1.23+
- An Anthropic API key
- Familiarity with episodes 01–02 (completions and system prompts)
cd 08-prompt-caching
export ANTHROPIC_API_KEY=your_key_here
go run main.go.
├── README.md
├── go.mod
├── go.sum
└── main.go