JavaScript is disabled. Some features may not work.
claude-api — ★ 154.3K GitHub Stars — Install Guide | SkillsNav
🇺🇸 English🇨🇳 中文
SkillsNav
Home

claude-api

★ 154K repomlSafeIntermediateClaude
🤖 AI Summary

This skill analyzes your project to detect its programming language, then retrieves the relevant Claude API documentation to help you select and implement the appropriate integration surface (e.g., Messages API, Streaming, Tool Use).

How to Install

Claude Code:
git clone --depth 1 https://github.com/anthropics/skills.git && cp skills/skills/claude-api ~/.claude/skills/claude-api -r

Building LLM-Powered Applications with Claude

This skill helps you build LLM-powered applications with Claude. Choose the right surface based on your needs, detect the project language, then read the relevant language-specific documentation.

When to Use

  • Use when building with the Claude API, Anthropic SDKs, or the Agent SDK.
  • Use when code imports anthropic, @anthropic-ai/sdk, or related Claude SDK packages.
  • Do not use for general coding work unrelated to Claude integrations.

Defaults

Unless the user requests otherwise:

For the Claude model version, please use Claude Opus 4.6, which you can access via the exact model string claude-opus-4-6. Please default to using adaptive thinking (thinking: {type: "adaptive"}) for anything remotely complicated. And finally, please default to streaming for any request that may involve long input, long output, or high max_tokens — it prevents hitting request timeouts. Use the SDK's .get_final_message() / .finalMessage() helper to get the complete response if you don't need to handle individual stream events


Language Detection

Before reading code examples, determine which language the user is working in:

  1. Look at project files to infer the language:

  2. *.py, requirements.txt, pyproject.toml, setup.py, PipfilePython — read from python/

  3. *.ts, *.tsx, package.json, tsconfig.jsonTypeScript — read from typescript/
  4. *.js, *.jsx (no .ts files present) → TypeScript — JS uses the same SDK, read from typescript/
  5. *.java, pom.xml, build.gradleJava — read from java/
  6. *.kt, *.kts, build.gradle.ktsJava — Kotlin uses the Java SDK, read from java/
  7. *.scala, build.sbtJava — Scala uses the Java SDK, read from java/
  8. *.go, go.modGo — read from go/
  9. *.rb, GemfileRuby — read from ruby/
  10. *.cs, *.csprojC# — read from csharp/
  11. *.php, composer.jsonPHP — read from php/

  12. If multiple languages detected (e.g., both Python and TypeScript files):

  13. Check which language the user's current file or question relates to

  14. If still ambiguous, ask: "I detected both Python and TypeScript files. Which language are you using for the Claude API integration?"

  15. If language can't be inferred (empty project, no source files, or unsupported language):

  16. Use AskUserQuestion with options: Python, TypeScript, Java, Go, Ruby, cURL/raw HTTP, C#, PHP

  17. If AskUserQuestion is unavailable, default to Python examples and note: "Showing Python examples. Let me know if you need a different language."

  18. If unsupported language detected (Rust, Swift, C++, Elixir, etc.):

  19. Suggest cURL/raw HTTP examples from curl/ and note that community SDKs may exist

  20. Offer to show Python or TypeScript examples as reference implementations

  21. If user needs cURL/raw HTTP examples, read from curl/.

Language-Specific Feature Support

Language Tool Runner Agent SDK Notes
Python Yes (beta) Yes Full support — @beta_tool decorator
TypeScript Yes (beta) Yes Full support — betaZodTool + Zod
Java Yes (beta) No Beta tool use with annotated classes
Go Yes (beta) No BetaToolRunner in toolrunner pkg
Ruby Yes (beta) No BaseTool + tool_runner in beta
cURL N/A N/A Raw HTTP, no SDK features
C# No No Official SDK
PHP No No Official SDK

Which Surface Should I Use?

Start simple. Default to the simplest tier that meets your needs. Single API calls and workflows handle most use cases — only reach for agents when the task genuinely requires open-ended, model-driven exploration.

Use Case Tier Recommended Surface Why
Classification, summarization, extraction, Q&A Single LLM call Claude API One request, one response
Batch processing or embeddings Single LLM call Claude API Specialized endpoints
Multi-step pipelines with code-controlled logic Workflow Claude API + tool use You orchestrate the loop
Custom agent with your own tools Agent Claude API + tool use Maximum flexibility
AI agent with file/web/terminal access Agent

Details

Category AI/ML → ml
Sourceanthropics/skills
SKILL.mdView on GitHub →
Repo Stars★ 154.3K
Est. per Skill~8.1K (shared across 19 skills from this repo)
DifficultyIntermediate
Risk LevelSafe

Related Skills

Works Well With

Skills from the same repository — often designed to work together