Skip to content
BENIBIX Learn

Anthropic SDK

Development🧬 AI EngineeringLLM APIs

Also known as Anthropic Client SDK, Claude Client SDK, anthropic Python package, @anthropic-ai/sdk

Anthropic's own code kit. Your code calls Claude with one short function.

Think of it like

It is like a phone with one number saved. You tap once, and the call goes through.

Example

Emma writes a short Python script with the anthropic package. It reads a support email and asks Claude for a one-line summary. The usage field in the reply shows the tokens it cost.

Why it matters

It is the quickest way to reach Claude from code. Typed fields let your editor catch a wrong name before you run it.

Definition

The Anthropic SDK is Anthropic's own code library for the Claude API. It comes in Python, TypeScript, Java, Go, Ruby, C# and PHP. In Python, you install a package called anthropic. You make a client, then call messages.create with a model and your messages. The library adds your key and the version header. It also tries again when a call fails.

Example code

python
import anthropic

client = anthropic.Anthropic()  # reads ANTHROPIC_API_KEY
message = client.messages.create(
    model="claude-sonnet-5-5",
    max_tokens=200,
    messages=[{"role": "user", "content": "Hello, Claude"}],
)
print(message.content[0].text)
The client reads your key from the environment. One call sends the chat and prints the reply.
The Anthropic SDK is the middle box when the API on the right is the Claude API.

Common mistake

Mixing it up with the Claude Agent SDK. This one sends one message and returns one reply. The Agent SDK runs a whole agent with tools.

Key takeaways

  1. 1
    Seven languages. Python, TypeScript, Go and more.
  2. 2
    Key from the environment. ANTHROPIC_API_KEY by default.
  3. 3
    Headers done for you. Version header and retries included.