claude-api
БесплатноЗапускает вложенные скриптыНе проверенBuild apps with the Claude API or Anthropic SDK. TRIGGER when: code imports `anthropic`/`@anthropic-ai/sdk`/`claude_agent_sdk`, or user asks to use Claude…
от oimiragieo★ 48 звёзд на GitHubОб этом скилле
Claude API & Agent SDK
Defaults
- Model:
claude-opus-4-6(unless user specifies otherwise) - Thinking:
thinking: {type: "adaptive"}for complex tasks (neverbudget_tokens— deprecated) - Streaming: Default for large inputs, large outputs, or high
max_tokens - Streaming completion: Use
.get_final_message()(Python) /.finalMessage()(TypeScript)
Language Detection
Infer language from project files. Support: Python, TypeScript/JavaScript, Java/Kotlin/Scala, Go, Ruby, C#, PHP, cURL. If multiple languages detected, clarify which is relevant.
Which Surface to Use
| Use Case | Surface |
|---|---|
| Single LLM call (classify, summarize, extract, Q&A) | Claude API direct |
| Multi-step pipelines with tool use | Claude API + tool use |
| Open-ended autonomous agents | Claude API agentic loop or Agent SDK |
| Built-in tools (files, web, terminal) | Agent SDK |
Current Models
| Model | ID | Context | Input $/1M | Output $/1M |
|---|---|---|---|---|
| Claude Opus 4.6 | claude-opus-4-6 |
200K (1M beta) | $5.00 | $25.00 |
| Claude Sonnet 4.6 | claude-sonnet-4-6 |
200K (1M beta) | $3.00 | $15.00 |
| Claude Haiku 4.5 | claude-haiku-4-5 |
200K | $1.00 | $5.00 |
Default to claude-opus-4-6 unless the user explicitly requests another model.
Thinking & Effort
# Python — adaptive thinking
response = client.messages.create(
model="claude-opus-4-6",
max_tokens=16000,
thinking={"type": "adaptive"},
messages=[{"role": "user", "content": "Explain quantum entanglement"}]
)
# Python — effort parameter
response = client.messages.create(
model="claude-opus-4-6",
max_tokens=16000,
output_config={"effort": "high"}, # low | medium | high | max
messages=[...]
)
// TypeScript — adaptive thinking
const response = await client.messages.create({
model: 'claude-opus-4-6',
max_tokens: 16000,
thinking: { type: 'adaptive' },
messages: [{ role: 'user', content: 'Explain quantum entanglement' }],
});
Single API Call (Most Common)
Python
import anthropic
client = anthropic.Anthropic() # Uses ANTHROPIC_API_KEY env var
response = client.messages.create(
model="claude-opus-4-6",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello, Claude!"}]
)
print(response.content[0].text)
TypeScript
import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic(); // Uses ANTHROPIC_API_KEY env var
const response = await client.messages.create({
model: 'claude-opus-4-6',
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello, Claude!' }],
});
console.log(response.content[0].text);
Streaming
Use streaming when max_tokens is large or inputs are long:
Python
with client.messages.stream(
model="claude-opus-4-6",
max_tokens=4096,
messages=[{"role": "user", "content": prompt}]
) as stream:
for text in stream.text_stream:
print(text, end="", flush=True)
# For complete response with metadata:
final = stream.get_final_message()
TypeScript
const stream = await client.messages.stream({
model: 'claude-opus-4-6',
max_tokens: 4096,
messages: [{ role: 'user', content: prompt }],
});
for await (const chunk of stream) {
if (chunk.type === 'content_block_delta' && chunk.delta.type === 'text_delta') {
process.stdout.write(chunk.delta.text);
}
}
const final = await stream.finalMessage();
Tool Use
Define Tools
tools = [
{
"name": "get_weather",
"description": "Get current weather for a location",
"input_schema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City and state, e.g. 'San Francisco, CA'"
}
},
"required": ["location"]
}
}
]
Agentic Loop (Python)
import json
messages = [{"role": "user", "content": "What's the weather in SF?"}]
while True:
response = client.messages.create(
model="claude-opus-4-6",
max_tokens=1024,
tools=tools,
messages=messages
)
if response.stop_reason == "end_turn":
print(response.content[0].text)
break
if response.stop_reason == "tool_use":
# Process tool calls
tool_results = []
for block in response.content:
if block.type == "tool_use":
result = call_tool(block.name, block
Установить claude-api в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBashGlobGrepWebFetchВложенные файлы
FAQ
Что делает скилл claude-api?
Build apps with the Claude API or Anthropic SDK. TRIGGER when: code imports `anthropic`/`@anthropic-ai/sdk`/`claude_agent_sdk`, or user asks to use Claude API, Anthropic SDKs, or Agent SDK. DO NOT TRIGGER when: code imports `openai`/other AI SDK, general programming, or ML/data-science tasks.
Как установить скилл claude-api?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл claude-api запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic