clade-sdk-patterns

Featured

Production-ready Anthropic SDK patterns — client config, retries, timeouts, Use when working with sdk-patterns patterns. error handling, TypeScript types, and async patterns. Trigger with "anthropic sdk", "claude client setup", "anthropic typescript", "anthropic python patterns".

AI & Automation 2,266 stars 315 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Anthropic SDK Patterns ## Overview Production patterns for the `@claude-ai/sdk` (TypeScript) and `anthropic` (Python) SDKs. ## Client Configuration ## Instructions ### Step 1: TypeScript ```typescript import Anthropic from '@claude-ai/sdk'; // Default — reads ANTHROPIC_API_KEY from env const client = new Anthropic(); // Full configuration const client = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY, // default: env var maxRetries: 3, // default: 2 timeout: 60_000, // default: 10 minutes baseURL: 'https://api.anthropic.com', // override for proxies defaultHeaders: { // custom headers 'claude-beta': 'prompt-caching-2024-07-31', }, }); ``` ### Step 2: Python ```python import anthropic # Sync client client = anthropic.Anthropic() # Async client client = anthropic.AsyncAnthropic() # Full configuration client = anthropic.Anthropic( api_key=os.environ["ANTHROPIC_API_KEY"], max_retries=3, timeout=60.0, base_url="https://api.anthropic.com", default_headers={"claude-beta": "prompt-caching-2024-07-31"}, ) ``` ## Output - Properly configured client with retries, timeouts, and custom headers - Type-safe error handling with specific exception classes - Streaming implementation using your preferred pattern - Prompt caching enabled for repeated system prompts (90% cost savings) - Batch processing configured for bulk operations (50% cost savings) ## Error...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

anth-sdk-patterns

Apply production-ready Anthropic SDK patterns for TypeScript and Python. Use when implementing Claude integrations, building reusable wrappers, or establishing team coding standards for the Messages API. Trigger with phrases like "anthropic SDK patterns", "claude best practices", "anthropic code patterns", "production claude code".

2,266 Updated today
jeremylongshore
AI & Automation Featured

anth-install-auth

Install and configure Anthropic Claude SDK authentication for Python and TypeScript. Use when setting up a new Claude API integration, configuring API keys, or initializing the Anthropic SDK in your project. Trigger with phrases like "install anthropic", "setup claude api", "anthropic auth", "configure anthropic API key", "claude sdk setup".

2,266 Updated today
jeremylongshore
AI & Automation Featured

castai-sdk-patterns

Production-ready CAST AI REST API wrapper patterns in TypeScript and Python. Use when building reusable CAST AI clients, implementing retry logic, or wrapping the CAST AI API for team use. Trigger with phrases like "cast ai API patterns", "cast ai client wrapper", "cast ai TypeScript", "cast ai Python client".

2,266 Updated today
jeremylongshore
AI & Automation Featured

clade-install-auth

Install and configure the Anthropic SDK for Claude API access. Use when setting up Claude integration, configuring API keys, or initializing the Anthropic client in your project. Trigger with phrases like "install anthropic", "setup claude api", "anthropic auth", "configure anthropic API key".

2,266 Updated today
jeremylongshore
AI & Automation Listed

claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

0 Updated today
CodeWithBehnam