diff --git a/.openclaw-sync/source.json b/.openclaw-sync/source.json index 00f705e8e..4e733d028 100644 --- a/.openclaw-sync/source.json +++ b/.openclaw-sync/source.json @@ -1,5 +1,5 @@ { "repository": "openclaw/openclaw", - "sha": "36c047c0264ef7124d957ac8791f0406d7b10fb1", - "syncedAt": "2026-05-03T23:51:38.109Z" + "sha": "34b3471f85539bcd937e8d3896cf3e01c0c7fe12", + "syncedAt": "2026-05-04T00:03:32.196Z" } diff --git a/docs/providers/openrouter.md b/docs/providers/openrouter.md index 1ef170b99..97c7b3b9d 100644 --- a/docs/providers/openrouter.md +++ b/docs/providers/openrouter.md @@ -153,6 +153,39 @@ does **not** inject those OpenRouter-specific headers or Anthropic cache markers ## Advanced configuration + + OpenRouter response caching is opt-in. Enable it per OpenRouter model with + model params: + + ```json5 + { + agents: { + defaults: { + models: { + "openrouter/auto": { + params: { + responseCache: true, + responseCacheTtlSeconds: 300, + }, + }, + }, + }, + }, + } + ``` + + OpenClaw sends `X-OpenRouter-Cache: true` and, when configured, + `X-OpenRouter-Cache-TTL`. `responseCacheClear: true` forces a refresh for + the current request and stores the replacement response. Snake_case aliases + (`response_cache`, `response_cache_ttl_seconds`, and + `response_cache_clear`) are also accepted. + + This is separate from provider prompt caching and from OpenRouter's + Anthropic `cache_control` markers. It is only applied on verified + `openrouter.ai` routes, not custom proxy base URLs. + + + On verified OpenRouter routes, Anthropic model refs keep the OpenRouter-specific Anthropic `cache_control` markers that OpenClaw uses for