Compare commits

...
1 Commits
Author SHA1 Message Date
opencode-agent cff6f1ba79 docs(providers): positive-only prompt cache batch 13
Positive-only cache headers for 7 providers with documented cache behavior.
Skipped opencode-go, openreason, ovhcloud, perplexity (no positive cache evidence).

- openai: automatic prefix cache with `prompt_cache_key` accounting
- openrouter: `session_id` body + `x-session-id` header sticky routing
- orcarouter: `X-OrcaRouter-Session-Id` affinity with `prompt_cache_key` fallback
- opper: `cache_control` top-level/per-block on Anthropic models
- opencode: automatic prefix cache with cached-read billing
- pendra: engine prefix reuse with cached_tokens reporting
- perplexity-agent: per-model cache-read billing
2026-09-11 17:12:46 -05:00
7 changed files with 35 additions and 0 deletions

No files matched your search

+5
View File
@@ -1,3 +1,8 @@
# Cache key (chat): automatic prefix cache with `prompt_cache_key` for separate cache accounting
# Use headers: repeat the stable prefix with identical model and params
# Use body: `prompt_cache_key` plus `prompt_cache_options` and `prompt_cache_breakpoint` for explicit control
# Cache policy: stable prefix + same model; keep reusable content first byte-identical and append-only
# Docs: https://platform.openai.com/docs/guides/prompt-caching
name = "OpenAI"
env = ["OPENAI_API_KEY"]
npm = "@ai-sdk/openai"
+5
View File
@@ -1,3 +1,8 @@
# Cache key (chat): automatic prefix cache with per-model cached-read billing
# Use headers: repeat the stable prefix with identical model and params
# Use body: repeat the stable prefix with identical model and params
# Cache policy: stable prefix + same model; keep reusable context at the start byte-identical and append-only
# Docs: https://opencode.ai/docs/zen
name = "OpenCode Zen"
env = ["OPENCODE_API_KEY"]
npm = "@ai-sdk/openai-compatible"
+5
View File
@@ -1,3 +1,8 @@
# Cache key (chat): automatic prefix cache with sticky routing keyed on session
# Use headers: `x-session-id` with a stable session identifier routes repeats toward the warm provider
# Use body: `session_id` with the same stable value; `prompt_cache_key` also pins routing
# Cache policy: stable prefix + same model; reuse one session value per conversation sharing a prefix
# Docs: https://openrouter.ai/docs/features/prompt-caching
name = "OpenRouter"
env = ["OPENROUTER_API_KEY"]
npm = "@openrouter/ai-sdk-provider"
+5
View File
@@ -1,3 +1,8 @@
# Cache key (chat): explicit Anthropic prefix cache with moving or per-block breakpoints
# Use headers: repeat the stable prefix with identical model and params
# Use body: `cache_control` top-level for automatic placement or per-block for up to 4 explicit breakpoints
# Cache policy: stable prefix + same Anthropic model; reuse the large stable prefix across back-to-back calls
# Docs: https://docs.opper.ai/build/gateway/prompt-caching
name = "Opper"
env = ["OPPER_API_KEY"]
npm = "@ai-sdk/openai-compatible"
+5
View File
@@ -1,3 +1,8 @@
# Cache key (chat): session affinity toward the warm upstream deployment with automatic prefix reuse
# Use headers: `X-OrcaRouter-Session-Id` with a stable conversation value pins model and deployment
# Use body: `prompt_cache_key` sharing a cacheable prefix resolves the session fallback
# Cache policy: stable prefix + same model; reuse one session value per conversation
# Docs: https://docs.orcarouter.ai/routing/session-affinity
name = "OrcaRouter"
env = ["ORCAROUTER_API_KEY"]
npm = "@ai-sdk/openai-compatible"
+5
View File
@@ -1,3 +1,8 @@
# Cache key (chat): automatic engine prefix reuse with `cached_tokens` usage reporting
# Use headers: repeat the stable prefix with identical model and params
# Use body: repeat the stable prefix with identical model and params
# Cache policy: stable prefix + same model; send follow-up turns with the full conversation for prefix reuse
# Docs: https://pendra.ai/docs/api/chat-completions
# Reasoning HTTP format (accessed 2026-08-24):
# Pendra exposes an OpenAI-compatible surface and forwards chat-completions
# request fields to the in-process engine, so `reasoning_effort` on
+5
View File
@@ -1,3 +1,8 @@
# Cache key (chat): automatic prefix cache with per-model cache-read billing
# Use headers: repeat the stable prefix with identical model and params
# Use body: repeat the stable prefix with identical model and params
# Cache policy: stable prefix + same model; keep reusable context at the start byte-identical and append-only
# Docs: https://docs.perplexity.ai/docs/agent-api/models
name = "Perplexity Agent"
env = ["PERPLEXITY_API_KEY"]
npm = "@ai-sdk/openai"