anthropic-sdk-guide

anthropic-sdk-guide is a skill for Claude Code from VersoXBT/claude-initial-setup. It costs 62 tokens per session (1,529 once invoked), scanned A, original, MIT.

A reference guide for using Anthropic’s Python and TypeScript software libraries to build applications with Claude, Anthropic’s AI models.

In plain words
What is it for?
Use it when setting up the Anthropic SDK, calling the Messages API, counting tokens, caching prompts, processing batches, or troubleshooting configuration and rate-limit errors.
Why use it?
It gives developers ready patterns for connecting to Claude, sending messages, receiving streamed replies, and handling API errors without piecing together scattered documentation.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the claude-initial-setup plugin — 75 skills, 15 commands, 14 agents, 2 hooks shipped together

Good fit Use it when setting up the Anthropic SDK, calling the Messages API, counting tokens, caching prompts, processing batches, or troubleshooting configuration and rate-limit errors.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/versoxbt/claude-initial-setup/anthropic-sdk-guide
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add VersoXBT/claude-initial-setup --skill anthropic-sdk-guide
Clone the repo
git clone --depth 1 https://github.com/VersoXBT/claude-initial-setup

Made for: Claude Code.

Or install claude-initial-setup, the plugin that ships this one along with the rest of its 75 skills, 15 commands, 14 agents, 2 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for anthropic-sdk-guide

README.md
[![agentmods](https://agentmods.dev/badge/skills/versoxbt/claude-initial-setup/anthropic-sdk-guide.svg)](https://agentmods.dev/skills/versoxbt/claude-initial-setup/anthropic-sdk-guide)
Your own site
<a href="https://agentmods.dev/skills/versoxbt/claude-initial-setup/anthropic-sdk-guide"><img src="https://agentmods.dev/badge/skills/versoxbt/claude-initial-setup/anthropic-sdk-guide.svg" alt="Measured on agentmods" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,529 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00062 $0.01529
Opus 5 $0.00031 $0.00764
Sonnet 5 $0.00012 $0.00306
Haiku 4.5 $0.00006 $0.00153

Measured 7d ago against content hash 5d3af666a33d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

anthropic-sdk-guide scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/claude-api/anthropic-sdk-guide/SKILL.md · 221 lines

How it starts

The opening of the file, as written. The whole thing — 221 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Anthropic SDK Guide

Comprehensive reference for building with the Anthropic Python and TypeScript SDKs. Covers initialization, messages API, streaming, prompt caching, batches, and error handling.

When to Use

  • User is setting up Anthropic SDK (Python or TypeScript)
  • User is calling the Messages API or needs streaming responses
  • User wants prompt caching, batch processing, or token counting
  • User is debugging API errors or rate limits
  • User asks about Claude model IDs or API configuration

Core Patterns

SDK Installation and Setup

# Python
pip install anthropic

# TypeScript
npm install @anthropic-ai/sdk
# Python - client initialization
import anthropic

client = anthropic.Anthropic()  # Uses ANTHROPIC_API_KEY env var
# Or explicit: anthropic.Anthropic(api_key="sk-ant-...")
// TypeScript - client initialization
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic();  // Uses ANTHROPIC_API_KEY env var

Messages API - Basic Usage

# Python - simple message
message = client.messages.create(
    model="claude-sonnet-4-6-20250514",
    max_tokens=1024,
    system="You are a helpful coding assistant.",
    messages=[
        {"role": "user", "content": "Explain async/await in Python."}
    ]
)
print(message.content[0].text)
// TypeScript - simple message
const message = await client.messages.create({
  model: "claude-sonnet-4-6-20250514",
  max_tokens: 1024,
  system: "You are a helpful coding assistant.",
  messages: [
    { role: "user", content: "Explain async/await in Python." }
  ],
});
console.log(message.content[0].text);

Streaming Responses

# Python - streaming with context manager
with client.messages.stream(
    model="claude-sonnet-4-6-20250514",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Write a short story."}]
) as stream:
    for text in stream.text_stream:
        print(text, end="", flush=True)

# Access final message after stream completes
final_message = stream.get_final_message()

Read the full file on GitHub · 221 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 221 lines · 62 tokens per session scan A 5d3af666a33d

Subscribe to this mod's changes

anthropic-sdk-guide is a skill published in the GitHub repository VersoXBT/claude-initial-setup (4 stars, last pushed 4mo ago), licensed MIT. It adds 62 tokens to every session and 1,529 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

spark-environment-setup

Set up a working ML training/inference environment on NVIDIA DGX Spark (GB10, aarch64, CUDA 13). Use when installing PyTorch/Unsloth/TRL/vLLM on DGX Spark, hitting libcudart or wheel-ABI errors on aarch64, or choosing between NGC containers and bare pip installs.

wshobson/agents · 76 tokens

spark-training-gotchas

Preflight and diagnose the ten known failure modes for ML training on NVIDIA DGX Spark. Use when a training run on DGX Spark fails to start, OOMs below the 128GB limit, slows down mid-run, or before any multi-hour training job on GB10.

wshobson/agents · 63 tokens

data-quality-frameworks

Implement data quality validation with Great Expectations, dbt tests, and data contracts. Use when building data quality pipelines, implementing validation rules, or establishing data contracts.

wshobson/agents · 37 tokens

foundations-information-theory

Information-theory primitives for AI systems, entropy, mutual information, KL, compression, channel limits, MDL, bottlenecks, and signal quality. Use when quantifying information.

vasilyu1983/AI-Agents-public · 43 tokens

software-ai-integration

Applies production AI integration patterns for chat, structured output, guardrails, provider routing, and AI UX. Use when adding LLM-powered features to an application.

vasilyu1983/AI-Agents-public · 38 tokens

data-lake-platform

Designs lakehouse platforms across Iceberg, Delta, Hudi, and Paimon. Use when choosing catalogs, CDC paths, query engines, governance, or cost controls.

vasilyu1983/AI-Agents-public · 41 tokens