/anthropic-pack:anth-hello-worldfrom anthropic-pack
Provides minimal working examples of the Anthropic Claude Messages API for text, vision, and streaming. Useful for starting integrations, testing setup, or learning API patterns.
Ships in anthropic-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Three minimal examples covering the Claude Messages API core surfaces: basic text completion, vision (image analysis), and streaming responses.
anth-install-auth setupANTHROPIC_API_KEY in environmentanthropic package or Node.js 18+ with @anthropic-ai/sdkimport anthropic
client = anthropic.Anthropic()
message = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
messages=[
{"role": "user", "content": "Explain quantum computing in 3 sentences."}
]
)
# Response structure
print(message.content[0].text) # The actual text response
print(f"ID: {message.id}") # msg_01XFDUDYJgAACzvnptvVoYEL
print(f"Model: {message.model}") # claude-sonnet-4-20250514
print(f"Stop: {message.stop_reason}")# end_turn
print(f"Usage: {message.usage.input_tokens}in / {message.usage.output_tokens}out")
import Anthropic from '@anthropic-ai/sdk';
import * as fs from 'fs';
const client = new Anthropic();
// From file (base64)
const imageData = fs.readFileSync('chart.png').toString('base64');
const message = await client.messages.create({
model: 'claude-sonnet-4-20250514',
max_tokens: 1024,
messages: [{
role: 'user',
content: [
{
type: 'image',
source: {
type: 'base64',
media_type: 'image/png',
data: imageData,
},
},
{ type: 'text', text: 'Describe what this chart shows.' },
],
}],
});
console.log(message.content[0].type === 'text' ? message.content[0].text : '');
import anthropic
client = anthropic.Anthropic()
with client.messages.stream(
model="claude-sonnet-4-20250514",
max_tokens=1024,
messages=[{"role": "user", "content": "Write a haiku about APIs."}]
) as stream:
for text in stream.text_stream:
print(text, end="", flush=True)
# Get final message with full metadata
final = stream.get_final_message()
print(f"\nTokens used: {final.usage.input_tokens}+{final.usage.output_tokens}")
| Error | HTTP Code | Cause | Solution |
|---|---|---|---|
authentication_error | 401 | Invalid API key | Check ANTHROPIC_API_KEY |
invalid_request_error | 400 | Bad params (e.g., empty messages) | Validate request body |
rate_limit_error | 429 | Too many requests | Implement backoff (see anth-rate-limits) |
overloaded_error | 529 | API temporarily overloaded | Retry after 30-60s |
api_error | 500 | Server error | Retry with exponential backoff |
| Parameter | Required | Description |
|---|---|---|
model | Yes | Model ID: claude-sonnet-4-20250514, claude-haiku-4-20250514, claude-opus-4-20250514 |
max_tokens | 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 |
top_p | No | Nucleus sampling (use temperature OR top_p) |
stop_sequences | No | Array of strings that stop generation |
stream | No | Enable SSE streaming |
Proceed to anth-local-dev-loop for development workflow setup.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
anthropic, claude-api, hello-world, messages-api, quickstart, api-example
npx claudepluginhub flight505/skill-forge --plugin anthropic-pack30 skills in this plugin
/anth-advanced-troubleshootingDebug complex Claude API issues including context window overflow,
tool use failures, streaming corruption, and response quality problems.
Trigger with phrases like "anthropic advanced debug", "claude complex issue",
"claude tool use failing", "claude context overflow".
/anth-architecture-variantsChoose and implement Claude API architecture patterns for different scales:
serverless, microservice, event-driven, and edge deployment.
Trigger with phrases like "anthropic architecture", "claude serverless",
"claude microservice design", "edge claude deployment".
/anth-Other plugins' skills for the same job