claude-api
by anthropicsInstall and use claude-api to build apps with the Claude API, Anthropic SDKs, and Agent SDK patterns across multiple backend languages.
Overview
What claude-api helps you do
The claude-api skill is a practical reference for building LLM-powered applications with Claude using the Claude API, official Anthropic SDKs, and Agent SDK materials where available. It is organized by language so developers can quickly move from setup to working requests, streaming responses, tool use, and backend integration patterns.
This skill is especially useful when you already know you want to work with Claude and need implementation guidance rather than a general AI overview. The repository includes language-specific documentation for C#, Go, Java, PHP, Ruby, Python, and TypeScript, plus raw HTTP examples under curl/.
Who this skill is for
claude-api is a strong fit for:
- Backend developers integrating Claude into services, workers, and internal tools
- API developers choosing between direct HTTP calls and official SDKs
- Teams comparing language support before standardizing on Python, TypeScript, Go, Java, PHP, Ruby, or C#
- Developers who need examples for streaming, tool use, batching, files API usage, and error handling
- Agent builders using the Python or TypeScript Agent SDK materials
What problems it solves
Instead of forcing you to piece together scattered examples, claude-api gives you a structured starting point for common implementation decisions:
- Which SDK or API surface to use
- Which language folder to read first
- How to authenticate with
ANTHROPIC_API_KEY - How to send a first message request
- When to prefer streaming for long outputs
- Where to look for tool use, batches, files API, prompt caching, model references, and error codes
The skill also includes shared reference files such as shared/error-codes.md, shared/models.md, shared/prompt-caching.md, shared/live-sources.md, and shared/tool-use-concepts.md, which helps when you need backend behavior guidance beyond a minimal hello-world example.
Supported documentation surfaces in the repository
The repository evidence shows these main areas:
csharp/curl/go/java/php/python/agent-sdkpython/claude-apiruby/typescript/agent-sdktypescript/claude-apishared/
That makes claude-api more than a single-language snippet collection. It is best thought of as a multi-language backend integration skill for the Claude API ecosystem.
When claude-api is a good fit
Use claude-api when:
- Your codebase imports
anthropic,@anthropic-ai/sdk, orclaude_agent_sdk - You want official Anthropic SDK usage patterns
- You need practical examples for server-side Claude API integration
- You want language-specific install guidance before implementation
- You need to understand features like streaming, tool use, batches, or files API support
When claude-api is not the right fit
This skill is not the best choice when:
- Your project uses a different AI provider SDK such as
openai - You need generic programming help unrelated to Claude integration
- You are looking for frontend UI patterns rather than API and backend workflows
- You need a language not covered by the repository and do not want to use raw HTTP examples from
curl/
How to Use
Install the skill
Add claude-api from the Anthropic skills repository:
npx skills add https://github.com/anthropics/skills --skill claude-api
After installation, start with SKILL.md, then move into the language folder that matches your codebase.
Choose the right folder first
The fastest way to use claude-api well is to select the language-specific path before reading implementation details.
Useful starting points from the repository include:
SKILL.mdcsharp/claude-api.mdcurl/examples.mdgo/claude-api.mdjava/claude-api.mdphp/claude-api.mdruby/claude-api.mdpython/claude-api/README.mdtypescript/claude-api/README.mdpython/agent-sdk/README.mdtypescript/agent-sdk/README.md
If you are evaluating SDK support before choosing a stack, browse several language folders side by side. The repository clearly separates direct Claude API usage from Agent SDK guidance in Python and TypeScript.
Match the surface to your use case
Based on the repository structure, claude-api supports several practical paths:
- Use
curl/examples.mdfor raw HTTP requests or unsupported languages - Use language folders like
go/,java/,php/,ruby/, orcsharp/for official SDK patterns - Use
python/claude-api/ortypescript/claude-api/for deeper topic coverage such as streaming, tool use, batches, and files API - Use
python/agent-sdk/ortypescript/agent-sdk/if your project is centered on agent workflows rather than only direct message calls
This structure is useful for installation decisions because not every language has the same higher-level features. For example, the repository explicitly includes Agent SDK docs for Python and TypeScript, while other languages focus on Claude API SDK usage.
Set up authentication safely
Across the repository examples, the standard pattern is to use the ANTHROPIC_API_KEY environment variable instead of hardcoding secrets. That makes claude-api a good fit for production-minded backend workflows and CI environments.
Before testing examples, confirm your runtime can read ANTHROPIC_API_KEY.
Typical installation paths by language
The repository evidence includes these install examples:
- C#:
dotnet add package Anthropic - Go:
go get github.com/anthropics/anthropic-sdk-go - PHP:
composer require "anthropic-ai/sdk" - Ruby:
gem install anthropic - Java: dependency setup with
com.anthropic:anthropic-java - Raw HTTP: use
curlagainsthttps://api.anthropic.com/v1/messages
If you are deciding between SDK and HTTP, start with the SDK when your language is supported and switch to curl/ examples when you need low-level request control or are working in another language.
Start with a basic message request
Most language guides in claude-api begin with the same practical workflow:
- Initialize a client
- Read the API key from environment
- Send a message request with a Claude model
- Read text blocks from the response
This consistency is helpful when teams work across several backend languages. You can standardize the request pattern even if the code syntax changes.
Use streaming for long responses
The repository's SKILL.md explicitly recommends defaulting to streaming for requests that may involve long input, long output, or high max_tokens, because streaming helps prevent request timeouts. That guidance is one of the most important operational takeaways from claude-api.
If your application generates long answers, summaries, tool loops, or extended reasoning, review the streaming docs first:
python/claude-api/streaming.mdtypescript/claude-api/streaming.md- Streaming sections inside language-specific files such as
go/claude-api.md,java/claude-api.md,ruby/claude-api.md, andcsharp/claude-api.md
Explore advanced backend features
One reason to install claude-api instead of relying on a single quickstart is the deeper topic coverage in the repository. Relevant files include:
python/claude-api/tool-use.mdtypescript/claude-api/tool-use.mdpython/claude-api/batches.mdtypescript/claude-api/batches.mdpython/claude-api/files-api.mdtypescript/claude-api/files-api.mdshared/tool-use-concepts.mdshared/prompt-caching.mdshared/models.md
These are especially valuable for production backend workflows where you need more than a single request-response example.
Use shared references for troubleshooting
If your first integration fails, claude-api includes support material that helps with debugging and planning:
shared/error-codes.mdfor HTTP error meanings, retryability, and common causesshared/models.mdfor model-related referencesshared/live-sources.mdfor source-related guidance
The error code reference is particularly useful because it distinguishes between retryable conditions such as 429, 500, and 529 versus non-retryable request issues like 400 or authentication problems like 401.
Practical evaluation checklist before adopting claude-api
Before you commit to this skill in a project, ask:
- Do we need official SDK examples in one of the supported languages?
- Do we expect long outputs and therefore need streaming guidance?
- Do we need tool use, files API, or batch processing examples?
- Are we building agent workflows in Python or TypeScript?
- Do we want a fallback raw HTTP path using
curl?
If the answer to several of those is yes, claude-api is likely a strong match.
FAQ
What is claude-api in this repository?
claude-api is a skill in anthropics/skills that helps developers build applications with the Claude API, Anthropic SDKs, and Agent SDK resources. It is organized by language and supported by shared reference documents.
How do I install claude-api?
Use:
npx skills add https://github.com/anthropics/skills --skill claude-api
Then open SKILL.md and the language folder that matches your stack.
Which languages does claude-api cover?
Repository evidence shows documentation for C#, Go, Java, PHP, Ruby, Python, TypeScript, and raw HTTP examples with curl.
Does claude-api include Agent SDK guidance?
Yes, but based on the repository structure, Agent SDK materials are specifically present in python/agent-sdk/ and typescript/agent-sdk/. If you need agent workflow examples, those are the first folders to inspect.
Does claude-api help with streaming and tool use?
Yes. The repository includes streaming and tool use documentation, especially in the Python and TypeScript Claude API folders, and several language-specific guides also include streaming sections.
Is claude-api only for direct API calls?
No. It covers both direct Claude API usage and SDK-based integration patterns. It also includes raw HTTP examples in curl/examples.md for developers who do not want to use an SDK or are working in another language.
When should I use curl instead of an SDK?
Use curl when you need raw HTTP examples, when your language is not covered by an official SDK in this skill, or when you want to inspect request and response structure directly before adopting a client library.
Does claude-api include error-handling guidance?
Yes. shared/error-codes.md documents HTTP error codes, common causes, and which issues are retryable. That makes claude-api useful for production integration planning, not just initial setup.
Is claude-api a good fit for general coding help?
No. The repository description is focused on using Claude API and Anthropic SDKs. If your task is unrelated to Claude integration, this skill is too specialized.
What should I read first after installing claude-api?
Start with SKILL.md, then move to the file that matches your language and use case. For many teams, the best sequence is:
SKILL.md- Your language guide such as
go/claude-api.mdorphp/claude-api.md - Topic-specific docs like
streaming.md,tool-use.md,batches.md, orfiles-api.md - Shared references such as
shared/error-codes.md
