claude-api-cost-optimization SKILL.md skillA
claude-api-cost-optimization from louishin/claude-api-cost-optimization is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add louishin/claude-api-cost-optimization/claude-api-cost-optimization@git:20260129.19e06c4Pins git:20260129.19e06c4 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- louishin/claude-api-cost-optimization
- Path
SKILL.md- Versions recorded
- 1
- Latest version
- git:20260129.19e06c4, committed Jan 29, 2026
- Size
- 3,422 bytes
- Repository stars
- 4
- License
- MIT
Save 50-90% on Claude API costs with Batch API, Prompt Caching & Extended Thinking. Official techniques, verified.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# Claude API Cost Optimization
> Save 50-90% on Claude API costs with three officially verified techniques
## Quick Reference
| Technique | Savings | Use When |
|-----------|---------|----------|
| **Batch API** | 50% | Tasks can wait up to 24h |
| **Prompt Caching** | 90% | Repeated system prompts (>1K tokens) |
| **Extended Thinking** | ~80% | Complex reasoning tasks |
| **Batch + Cache** | ~95% | Bulk tasks with shared context |
---
## 1. Batch API (50% Off)
### When to Use
- Bulk translations
- Daily content generation
- Overnight report processing
- NOT for real-time chat
### Code Example
```python
import anthropic
client = anthropic.Anthropic()
batch = client.messages.batches.create(
requests=[
{
"custom_id": "task-001",
"params": {
"model": "claude-sonnet-4-5",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Task 1"}]
}
}
]
)
# Results available within 24h (usually <1h)
for result in client.messages.batches.results(batch.id):
print(f"{result.custom_id}: {result.result.message.content[0].text}")
```
### Key Finding: Bigger Batches = Faster!
…Read the whole file at its exact version.
How to install
mdr add louishin/claude-api-cost-optimization/claude-api-cost-optimization@sha256:3cb1abb89c3c86d2The line at the top of this page pins the label git:20260129.19e06c4, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_pmpk5lt5cq54zrcv)
2 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 1 version of this file, committed on Jan 29, 2026.
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (3422 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
louishin/claude-api-cost-optimization · 4 stars · license MIT · pushed 2026-10-12 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_pmpk5lt5cq54zrcv GET https://markdownregistry.com/api/v1/resolve?ref=louishin/claude-api-cost-optimization/claude-api-cost-optimization GET https://markdownregistry.com/api/v1/blob/3cb1abb89c3c86d2d6d17881870734bef144f9152bb2ec1b2a1b5b5bd13914c6
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.