Skip to content
Back to skills

Anthropic Claude Api

ASecurity

Build on the Anthropic Claude API: Messages API, tool use, streaming, extended thinking, prompt caching, batches, files and citations, with the official SDKs.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
ai-agentsrustapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned December 2, 2026

npx -y skills add karthikrshet/saarthi --skill anthropic-claude-api --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Anthropic Claude Api?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Anthropic Claude Api
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/karthikrshet-anthropic-claude-api/badge)](https://www.skillsdirectory.com/skills/karthikrshet-anthropic-claude-api)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: anthropic-claude-api
description: "Build on the Anthropic Claude API: Messages API, tool use, streaming, extended thinking, prompt caching, batches, files and citations, with the official SDKs."
tags: [ai-agents]
---

# Anthropic Claude Api

## When to use

- Any feature calling Claude models directly

## Procedure

1. Use the official SDK (@anthropic-ai/sdk or anthropic)
2. Read the model ID from config, never hardcode in many places
3. Use tool use or JSON schema for structured output
4. Add cache_control breakpoints on stable prefixes
5. Use the Batches API for offline bulk work
6. Handle 429/529 with retries and backoff
7. Log usage fields for cost tracking

## Example

```ts
import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic(); // reads ANTHROPIC_API_KEY
const msg = await client.messages.create({
  model: process.env.CLAUDE_MODEL!, max_tokens: 1024,
  system: [{ type: 'text', text: SYSTEM_PROMPT, cache_control: { type: 'ephemeral' } }],
  messages: [{ role: 'user', content: question }],
});
```

## Checklist

- [ ] API key from env
- [ ] Max tokens set deliberately
- [ ] Usage logged

## Anti-patterns

- Concatenating untrusted content into the system prompt
- Ignoring stop_reason

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.