| name | anth-hello-world |
| description | Create a minimal working Anthropic Claude Messages API example.
Use when starting a new Claude integration, testing your setup,
or learning basic Messages API patterns for text, vision, and streaming.
Trigger with phrases like "anthropic hello world", "claude api example",
"anthropic quick start", "simple claude code", "first messages api call".
|
| allowed-tools | Read, Write, Edit |
| version | 1.6.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","ai","anthropic"] |
| compatibility | Designed for Claude Code |
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
ANTHROPIC_API_KEY in environment
- Python 3.8+ with
anthropic package or Node.js 18+ with @anthropic-ai/sdk
Instructions
Example 1: Basic Text Message (Python)
import 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."}
]
)
print(message.content[0].text)
print(f"ID: {message.id}")
print(f"Model: {message.model}")
print(f"Stop: {message.stop_reason}")
print(f"Usage: {message.usage.input_tokens}in / {message.usage.output_tokens}out")
Example 2: Vision — Analyze an Image (TypeScript)
import Anthropic from '@anthropic-ai/sdk';
import * as fs from ;
client = ();
imageData = fs.().();
message = client..({
: ,
: ,
: [{
: ,
: [
{
: ,
: {
: ,
: ,
: imageData,
},
},
{ : , : },
],
}],
});
.(message.[]. === ? message.[]. : );