clade-hello-world
БесплатноБез исполняемых скриптовНе проверенSend your first message to Claude using the Anthropic SDK. Use when starting a new Claude integration, testing your setup, or learning the Messages API…
от jeremylongshore★ 2 961 звезда на GitHubОб этом скилле
Anthropic Hello World
Overview
Send your first message to Claude and get a response using the Messages API.
Prerequisites
- Completed
clade-install-authsetup ANTHROPIC_API_KEYenvironment variable set
Instructions
Step 1: Basic Message
import Anthropic from '@claude-ai/sdk';
const client = new Anthropic();
const message = await client.messages.create({
model: 'claude-sonnet-4-20250514',
max_tokens: 1024,
messages: [
{ role: 'user', content: 'What is the capital of France?' }
],
});
console.log(message.content[0].text);
// "The capital of France is Paris."
Step 2: Add a System Prompt
const message = await client.messages.create({
model: 'claude-sonnet-4-20250514',
max_tokens: 1024,
system: 'You are a helpful geography expert. Be concise.',
messages: [
{ role: 'user', content: 'What is the capital of France?' }
],
});
Step 3: Multi-Turn Conversation
const message = await client.messages.create({
model: 'claude-sonnet-4-20250514',
max_tokens: 1024,
messages: [
{ role: 'user', content: 'What is the capital of France?' },
{ role: 'assistant', content: 'The capital of France is Paris.' },
{ role: 'user', content: 'What is its population?' },
],
});
Python Example
import anthropic
client = anthropic.Anthropic()
message = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
messages=[
{"role": "user", "content": "What is the capital of France?"}
],
)
print(message.content[0].text)
Output
message.content[0].text— Claude's text responsemessage.model— model ID usedmessage.usage.input_tokens/message.usage.output_tokens— token countsmessage.stop_reason—end_turn,max_tokens, ortool_use
Error Handling
| Error | Cause | Solution |
|---|---|---|
authentication_error |
Bad API key | Check ANTHROPIC_API_KEY |
invalid_request_error |
Missing required field | Both messages and max_tokens are required |
not_found_error |
Invalid model ID | Use a valid model like claude-sonnet-4-20250514 |
Available Models
| Model | Best For | Context | Cost (input/output per MTok) |
|---|---|---|---|
claude-opus-4-20250514 |
Complex reasoning | 200K | $15 / $75 |
claude-sonnet-4-20250514 |
Balanced quality + speed | 200K | $3 / $15 |
claude-haiku-4-5-20251001 |
Fast, cheap tasks | 200K | $0.80 / $4 |
Examples
See Step 1 (basic message), Step 2 (system prompt), and Step 3 (multi-turn) above. Python example included in its own section.
Resources
Next Steps
Proceed to clade-model-inference for streaming and advanced patterns.
Установить clade-hello-world в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditВложенные файлы
FAQ
Что делает скилл clade-hello-world?
Send your first message to Claude using the Anthropic SDK. Use when starting a new Claude integration, testing your setup, or learning the Messages API basics. Trigger with phrases like "anthropic hello world", "claude api example", "first claude call", "anthropic quick start".
Как установить скилл clade-hello-world?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл clade-hello-world запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic