Agent skill · software engineering · jeremylongshore

anth-hello-world

Create a minimal working Anthropic Claude Messages API example.

Why this skill is useful

Provides specific code examples and error handling for the Claude Messages API that the AI wouldn't reliably generate on its own.

What it needs

Requires node, python installed locally. Requires anthropic account access. About 2k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

Anthropic Hello World Overview Three minimal examples covering the Claude Messages API core surfaces: basic text completion, vision (image analysis), and streaming responses. Prerequisites Completed anth-install-auth setup Valid ANTHROPICAPIKEY in environment Python 3.8+ with anthropic package or Node.js 18+ with @anthropic-ai/sdk Instructions Example 1: Basic Text Message (Python) Example 2: Vision — Analyze an Image (TypeScript) Example 3: Streaming Response (Python) Output Working code file with Claude client initialization Successful API response with text content Console output showing model response and usage metadata Examples Use the text example first when verifying credentials: send a fixed, short prompt and confirm that message.content[0].text is present before integrating the client into application code. Use the vision example only after that check passes and replace chart.png with a non-sensitive local fixture. For an interactive command-line feature, use the streaming example so text is emitted incrementally, then read the final message to capture token usage for logs or cost controls. Error Handling Error HTTP Code Cause Solution ------- ----------- ------- ---------- authenticationerror 401 Invalid API key Check ANTHROPICAPIKEY invalidrequesterror 400 Bad params (e.g., empty messages) Validate request body ratelimiterror 429 Too many requests Implement backoff (see anth-rate-limits) overloadederror 529 API temporarily overloaded Retry after 30-60s apierror 500 Server error Retry with exponential backoff Key API Parameters Parameter Required Description ----------- ---------- ------------- model Yes Model ID: claude-sonnet-4-20250514, claude-haiku-4-20250514, claude-opus-4-20250514 maxtokens Yes Maximum output tokens (model-dependent max) messages Yes Array of {role, content} objects system No System prompt (string or content blocks) temperature No 0.0-1.0, default 1.0 topp No Nucleus sampling (use temperature OR topp) stopsequences No Array of string …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/anth-hello-world

View the source on GitHub

Browse the @skills marketplace