claude-api
Anthropic Messages API (Claude API) for integrations, streaming, prompt caching, tool use, vision. Use for chatbots, assistants, or encountering rate limits, 429 errors.
npx skills add majiayu000/claude-skill-registry --skill claude-api-secondsky-claude-skills --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Claude API (Anthropic Messages API) **Status**: Production Ready | **SDK**: @anthropic-ai/sdk@0.70.1 --- ## Quick Start (5 Minutes) ### Node.js ```typescript import Anthropic from '@anthropic-ai/sdk'; const client = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY, }); const message = await client.messages.create({ model: 'claude-sonnet-4-5-20250929', max_tokens: 1024, messages: [ { role: 'user', content: 'Hello, Claude!' }, ], }); console.log(message.content[0].text); ``` ### Cloudflare Workers ```typescript const response = await fetch('https://api.anthropic.com/v1/messages', { method: 'POST', headers: { 'x-api-key': env.ANTHROPIC_API_KEY, 'anthropic-version': '2023-06-01', 'content-type': 'application/json', }, body: JSON.stringify({ model: 'claude-sonnet-4-5-20250929', max_tokens: 1024, messages: [{ role: 'user', content: 'Hello!' }], }), }); const data = await response.json(); console.log(data.content[0].text); ``` **Load `references/setup-guide.md` for complete setup with streaming, caching, and tools.** --- ## Critical Rules ### Always Do ✅ 1. **Use environment variables** for API keys (NEVER hardcode) 2. **Set max_tokens** explicitly (required parameter) 3. **Pin mod
- Quick Start (5 Minutes)
- Node.js
- Cloudflare Workers
- Critical Rules
- Always Do ✅
- Never Do ❌
- Top 3 Errors (Prevent 80% of Issues)
- Error #1: Rate Limit 429
- Error #2: Prompt Caching Not Activating
- Error #3: Tool Use Response Format Errors
- Common Use Cases (Quick Patterns)
- Streaming Responses
- Prompt Caching (90% Cost Savings)
- Tool Use (Function Calling)
What does the claude-api skill do?
Anthropic Messages API (Claude API) for integrations, streaming, prompt caching, tool use, vision. Use for chatbots, assistants, or encountering rate limits, 429 errors.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill claude-api-secondsky-claude-skills --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
