Skip to content

feat: set OpenAI prompt cache key per session#3086

Open
aisk wants to merge 1 commit into
charmbracelet:mainfrom
aisk:feat/openai-prompt-cache-key
Open

feat: set OpenAI prompt cache key per session#3086
aisk wants to merge 1 commit into
charmbracelet:mainfrom
aisk:feat/openai-prompt-cache-key

Conversation

@aisk

@aisk aisk commented Jun 5, 2026

Copy link
Copy Markdown
Contributor
  • I have read CONTRIBUTING.md.
  • I have created a discussion that was approved by a maintainer (for new features).

Set OpenAI prompt_cache_key to the Crush session ID so requests in the same session are routed more consistently for prompt caching and can get better cache hit rates.

Reference: https://developers.openai.com/api/docs/guides/prompt-caching#best-practices

This is only applied to the official OpenAI provider. Other OpenAI-compatible providers may not support prompt_cache_key even if they use an OpenAI-like API shape, so they are intentionally left unchanged.

@taciturnaxolotl taciturnaxolotl force-pushed the feat/openai-prompt-cache-key branch from 083574f to 61f3e2e Compare June 13, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant