| 1834 | 1834 | } |
| 1835 | 1835 | |
| 1836 | 1836 | const cachingAtDepth = getConfigValue('claude.cachingAtDepth', -1, 'number'); |
| 1837 | 1837 | const isClaude3or4 = /anthropic\/claude-(3|opus-4|sonnet-4|haiku-4-5)/.test(request.body.model); |
| 1838 | 1838 | const cacheTTL = getConfigValue('claude.extendedTTL', false, 'boolean') ? '1h' : '5m'; |
| 1839 | 1839 | if (Array.isArray(request.body.messages) && Number.isInteger(cachingAtDepth) && cachingAtDepth >= 0 && isClaude3or4) { |
| 1840 | 1840 | cachingAtDepthForOpenRouterClaude(request.body.messages, cachingAtDepth, cacheTTL); |