| 1851 | 1851 | const cachingAtDepth = getConfigValue('claude.cachingAtDepth', -1, 'number'); |
| 1852 | 1852 | const isClaude3or4 = /anthropic\/claude-(3|opus-4|sonnet-4)/.test(request.body.model); |
| 1853 | 1853 | const cacheTTL = getConfigValue('claude.extendedTTL', false, 'boolean') ? '1h' : '5m'; |
| 1854 | 1854 | if (Array.isArray(request.body.messages) && Number.isInteger(cachingAtDepth) && cachingAtDepth >= 0 && isClaude3or4) { |
| 1855 | 1855 | cachingAtDepthForOpenRouterClaude(request.body.messages, cachingAtDepth, cacheTTL); |
| 1856 | 1856 | } |
| 1857 | 1857 | |