🌐
PyPI
pypi.org › project › anthropic
anthropic · PyPI
import json import rich from typing_extensions import Literal from anthropic import Anthropic, beta_tool client = Anthropic() @beta_tool def get_weather(location: str) -> str: """Lookup the weather for a given city in either celsius or fahrenheit Args: location: The city and state, e.g.
      » pip install anthropic
    
Published   Nov 24, 2025
Version   0.75.0
🌐
GitHub
github.com › anthropics › anthropic-sdk-python
GitHub - anthropics/anthropic-sdk-python
import json import rich from typing_extensions import Literal from anthropic import Anthropic, beta_tool client = Anthropic() @beta_tool def get_weather(location: str) -> str: """Lookup the weather for a given city in either celsius or fahrenheit Args: location: The city and state, e.g.
Starred by 2.5K users
Forked by 411 users
Languages   Python
🌐
GitHub
github.com › anthropics › anthropic-sdk-typescript
GitHub - anthropics/anthropic-sdk-typescript: Access to Anthropic's safety-first language model APIs in TypeScript
... The full API of this library can be found in api.md. import Anthropic from '@anthropic-ai/sdk'; const client = new Anthropic({ apiKey: process.env['ANTHROPIC_API_KEY'], // This is the default and can be omitted }); const message = await ...
Starred by 1.4K users
Forked by 181 users
Languages   TypeScript 96.8% | Shell 2.1% | JavaScript 1.1%
🌐
Anthropic
docs.anthropic.com › claude › reference › getting-started-with-the-api
API Overview - Claude Docs
from anthropic import Anthropic client = Anthropic() # Reads ANTHROPIC_API_KEY from environment message = client.messages.create( model="claude-sonnet-4-5", max_tokens=1024, messages=[{"role": "user", "content": "Hello, Claude"}] )
🌐
AI SDK
ai-sdk.dev › providers › ai-sdk-providers › anthropic
AI SDK Providers: Anthropic
The Anthropic provider is available in the @ai-sdk/anthropic module. You can install it with ... If you need a customized setup, you can import createAnthropic from @ai-sdk/anthropic and create a provider instance with your settings:
🌐
LlamaIndex
docs.llamaindex.ai › en › stable › examples › llm › anthropic
Anthropic - LlamaIndex
Anthropic supports direct tool/function calling through the API. Using LlamaIndex, we can implement some core agentic tool calling patterns. ... from llama_index.core.tools import FunctionTool from llama_index.core.llms import ChatMessage from llama_index.llms.anthropic import Anthropic from datetime import datetime llm = Anthropic(model="claude-sonnet-4-0") def get_current_time() -> dict: """Get the current time""" return {"time": datetime.now().strftime("%Y-%m-%d %H:%M:%S")} # uses the tool name, any type annotations, and docstring to describe the tool tool = FunctionTool.from_defaults(fn=get_current_time)
🌐
npm
npmjs.com › package › @anthropic-ai › sdk
anthropic-ai/sdk
Be aware that doing so may result in incorrect types and other unexpected or undefined behavior in the SDK. import Anthropic from '@anthropic-ai/sdk'; const client = new Anthropic(); const message = await client.messages.create( { max_tokens: ...
      » npm install @anthropic-ai/sdk
    
Published   Dec 06, 2025
Version   0.71.2
Author   Anthropic
🌐
LangChain
api.python.langchain.com › en › latest › llms › langchain_community.llms.anthropic.Anthropic.html
langchain_community.llms.anthropic.Anthropic — 🦜🔗 LangChain 0.2.17
To use, you should have the anthropic python package installed, and the environment variable ANTHROPIC_API_KEY set with your API key, or pass it as a named parameter to the constructor. ... import anthropic from langchain_community.llms import Anthropic model = Anthropic(model="<model_name>", ...
🌐
npm
npmjs.com › package › @ai-sdk › anthropic
@ai-sdk/anthropic - npm
You can install it with ... import { anthropic } from '@ai-sdk/anthropic'; import { generateText } from 'ai'; const { text } = await generateText({ model: anthropic('claude-3-haiku-20240307'), prompt: 'Write a vegetarian lasagna recipe for 4 ...
      » npm install @ai-sdk/anthropic
    
Published   Sep 14, 2025
Version   2.0.17
Find elsewhere
🌐
Claude
docs.claude.com › en › api › client-sdks
Client SDKs - Claude Docs
This page includes brief installation instructions and links to the open-source GitHub repositories for Anthropic’s Client SDKs.
🌐
DeepSeek
api-docs.deepseek.com › anthropic api
Anthropic API | DeepSeek API Docs
export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic export ANTHROPIC_API_KEY=${DEEPSEEK_API_KEY} Invoke the API · import anthropic client = anthropic.Anthropic() message = client.messages.create( model="deepseek-chat", max_tokens=1000, system="You are a helpful assistant.", messages=[ { "role": "user", "content": [ { "type": "text", "text": "Hi, how are you?"
🌐
Instructor
python.useinstructor.com › integrations › anthropic
Anthropic Claude Tutorial: Structured Outputs with Instructor - Instructor
Instructor makes it easy to analyse and extract semantic information from PDFs using Anthropic's Claude line of models. Let's see an example below with the sample PDF above where we'll load it in using our from_url method. Note that we support local files and base64 strings too with the from_path and the from_base64 class methods. from instructor.processing.multimodal import PDF from pydantic import BaseModel, Field import instructor from anthropic import Anthropic class Receipt(BaseModel): total: int items: list[str] client = instructor.from_provider("anthropic/claude-3-5-haiku-latest") url =
🌐
Cloudflare
developers.cloudflare.com › directory › ai gateway › using ai gateway › provider native › anthropic
Anthropic · Cloudflare AI Gateway docs
import Anthropic from "@anthropic-ai/sdk"; const baseURL = `https://gateway.ai.cloudflare.com/v1/{accountId}/{gatewayId}/anthropic`; const anthropic = new Anthropic({ baseURL, defaultHeaders: { Authorization: `Bearer {cf_api_token}`, }, }); ...
🌐
GitHub
github.com › geekan › MetaGPT › issues › 131
ImportError: cannot import name 'Anthropic' from 'anthropic' · ...
August 6, 2023 - Traceback (most recent call last): File "C:\metagpt\startup.py", line 7, in from metagpt.roles import Architect, Engineer, ProductManager, ProjectManager, QaEngineer File "C:\metagpt\metagpt\roles_init_.py", line 9, in from metagpt.roles.role import Role File "C:\metagpt\metagpt\roles\role.py", line 16, in from metagpt.actions import Action, ActionOutput File "C:\metagpt\metagpt\actions_init_.py", line 10, in from metagpt.actions.action import Action File "C:\metagpt\metagpt\actions\action.py", line 14, in from metagpt.llm import LLM File "C:\metagpt\metagpt\llm.py", line 9, in from metagpt.provider.anthropic_api import Claude2 as Claude File "C:\metagpt\metagpt\provider\anthropic_api.py", line 10, in from anthropic import Anthropic ImportError: cannot import name 'Anthropic' from 'anthropic' No one assigned ·
Published   Aug 06, 2023
🌐
Anthropic
docs.anthropic.com › claude › reference › client-sdks
Client SDKs - Claude - Anthropic
This page includes brief installation instructions and links to the open-source GitHub repositories for Anthropic's Client SDKs.
🌐
Zuplo
zuplo.com › zuplo learning center - articles on api development and best practices › apis › anthropic claude api: the ultimate guide
Anthropic Claude API: The Ultimate Guide | Zuplo Learning Center
April 9, 2025 - pip install anthropic · import anthropic client = anthropic.Anthropic(api_key='your_api_key_here') npm install @anthropic-ai/sdk ·
🌐
Bronsondunbar
bronsondunbar.com › post › getting-started-with-the-anthropic-api-using-node-js
Bronson Dunbar | Humble indie hacker trying to create products of value to make peoples life’s easier and better
const Anthropic = require('@anthropic-ai/sdk'); // Or using ES modules: // import Anthropic from '@anthropic-ai/sdk'; const anthropic = new Anthropic({ apiKey: 'your-api-key-here', // Replace with your actual API key });
🌐
LinkedIn
linkedin.com › pulse › getting-started-anthropic-api-minutes-olu-aganjuomo-z12wc
Getting Started with The Anthropic API in Minutes
March 5, 2024 - To start you need to import the packages we will need. Importing Anthropic is needed to talk to Claude or any of the models by Anthropic. Since we are using javascript we need to import dotenv to read our secret keys from the .env file.