File tree Expand file tree Collapse file tree 5 files changed +61
-1
lines changed
Expand file tree Collapse file tree 5 files changed +61
-1
lines changed Original file line number Diff line number Diff line change @@ -190,3 +190,4 @@ See ecosystem-specific examples:
190190- ** TypeScript + fetch** : [ typescript/fetch/src/prompt-caching/] ( ../typescript/fetch/src/prompt-caching/ )
191191- ** AI SDK v5** (Vercel): [ typescript/ai-sdk-v5/src/prompt-caching/] ( ../typescript/ai-sdk-v5/src/prompt-caching/ )
192192- ** Effect AI** (@effect/ai ): [ typescript/effect-ai/src/prompt-caching/] ( ../typescript/effect-ai/src/prompt-caching/ )
193+ - ** OpenRouter SDK** (@openrouter/sdk ): [ typescript/openrouter-sdk/src/prompt-caching/] ( ../typescript/openrouter-sdk/src/prompt-caching/ )
Original file line number Diff line number Diff line change 1+ # OpenRouter TypeScript SDK Examples
2+
3+ Examples using the official @openrouter/sdk package.
4+
5+ ## Status
6+
7+ ** TODO** : Examples not yet implemented
8+
9+ ## Prerequisites
10+
11+ - Bun runtime: ` curl -fsSL https://bun.sh/install | bash `
12+ - ` OPENROUTER_API_KEY ` environment variable
13+
14+ ## Planned Features
15+
16+ - [ ] prompt-caching.ts - Anthropic caching with OpenRouter SDK
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " @openrouter-examples/openrouter-sdk" ,
3+ "version" : " 1.0.0" ,
4+ "private" : true ,
5+ "type" : " module" ,
6+ "scripts" : {
7+ "examples" : " echo 'TODO: OpenRouter SDK examples not yet implemented'"
8+ },
9+ "dependencies" : {
10+ "@openrouter-examples/shared" : " workspace:*"
11+ },
12+ "devDependencies" : {
13+ "@types/bun" : " latest"
14+ }
15+ }
Original file line number Diff line number Diff line change 1+ # Anthropic Prompt Caching Examples (OpenRouter SDK)
2+
3+ ** TODO** : Add prompt caching examples using the @openrouter/sdk package.
4+
5+ This directory will contain examples demonstrating Anthropic's prompt caching feature via the OpenRouter TypeScript SDK.
6+
7+ ## Placeholder
8+
9+ Examples will be added in a future commit.
10+
11+ ## Expected Structure
12+
13+ ```
14+ prompt-caching/
15+ ├── README.md # This file
16+ ├── system-message-cache.ts # TODO: Cache on system message
17+ ├── user-message-cache.ts # TODO: Cache on user message
18+ ├── multi-message-cache.ts # TODO: Cache in conversation
19+ └── no-cache-control.ts # TODO: Control scenario
20+ ```
21+
22+ ## Pattern (To Be Implemented)
23+
24+ The examples will use the official @openrouter/sdk package to demonstrate:
25+ - How to configure cache_control with the SDK
26+ - Where cache metrics appear in responses
27+ - Evidence-based verification of cache behavior
Original file line number Diff line number Diff line change 1313 " shared" ,
1414 " fetch" ,
1515 " ai-sdk-v5" ,
16- " effect-ai"
16+ " effect-ai" ,
17+ " openrouter-sdk"
1718 ],
1819 "devDependencies" : {
1920 "@types/bun" : " latest" ,
You can’t perform that action at this time.
0 commit comments