Individual skill
openrouter-caching-strategy
Implement caching for OpenRouter API responses to reduce cost and latency. Use when optimizing repeat queries, building RAG systems, or reducing API spend. Triggers: 'openrouter cache', 'cache llm responses', 'openrouter caching', 'reduce openrouter cost'.
skills/.curated/openrouter-caching-strategy/SKILL.md
Source commit 0500b275e963c027f6b410e8c49c0446945c574e
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- No
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Not checked yet
- Last checked
- Nov 12, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 2,916
- Repository last updated
- Nov 12, 2026
- License
- MIT
Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.
- ai Repository topic
- automation Repository topic
- claude-code Repository topic
- devops Repository topic
- mcp Repository topic
- ai-agents Repository topic
- anthropic Repository topic
- claude-code-plugins Repository topic
- developer-tools Repository topic
- llm Repository topic
- saas Declared skill tag
- openrouter Declared skill tag
- caching Declared skill tag
- cost-optimization Declared skill tag
- engineering Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
SKILL.mdcore · 9,549 bytesSKILL.mdcore · 9,549 bytesSKILL.mdcore · 9,549 bytesSKILL.mdcore · 9,549 bytesSKILL.mdcore · 9,549 bytesSKILL.mdcore · 9,549 bytesreferences/cache-invalidation.mddoc · 990 bytesreferences/caching-strategies.mddoc · 2,439 bytesreferences/cost-savings-analysis.mddoc · 1,484 bytesreferences/errors.mddoc · 478 bytesreferences/examples.mddoc · 4,328 bytesreferences/in-memory-caching.mddoc · 2,530 bytesreferences/redis-caching.mddoc · 2,081 bytesreferences/semantic-caching.mddoc · 1,614 bytes
Read excerpt
# OpenRouter Caching Strategy
## Overview
OpenRouter charges per token, so caching identical or similar requests can dramatically cut costs. Deterministic requests (`temperature=0`) with the same model and messages produce identical outputs -- these are safe to cache. This skill covers in-memory caching, persistent caching with TTL, and Anthropic prompt caching via OpenRouter.
## Prerequisites
- An OpenRouter API key (`sk-or-v1-...`) exported as `OPENROUTER_API_KEY` — see the `openrouter-install-auth` skill for setup
- Python 3.8+ with the OpenAI SDK, plus the `redis` client package for the persistent cache; Node.js 18+ with the OpenAI SDK for the TypeScript variant in the references
- A Redis server reachable at `localhost:6379` for Persistent Cache with Redis (the in-memory `LLMCache` needs no infrastructure)
- Deterministic request settings — caching is only safe at `temperature=0`
## Instructions