{
 "kind": "tool",
 "slug": "anthropic-ai",
 "path": "tools/anthropic-ai/",
 "name": "Anthropic SDK",
 "maker": null,
 "density": "profile",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Model SDKs",
   "tools/ai-sdks/"
  ]
 ],
 "lead": "Official TypeScript SDK for calling Claude API and building agent applications.",
 "chips": [
  {
   "label": "Model SDKs",
   "path": "tools/ai-sdks/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install @anthropic-ai/sdk"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/anthropics/anthropic-sdk-typescript"
  },
  {
   "label": "Website",
   "href": "https://github.com/anthropics/anthropic-sdk-typescript#readme"
  },
  {
   "label": "Its AgentGid profile",
   "path": "agents/claude-agent-sdk/"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "Apache-2.0",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": null,
   "note": "License from npm.",
   "src": "https://github.com/anthropics/anthropic-sdk-typescript"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 23, 2026",
   "note": "Latest GitHub release Nov 23, 2026. ",
   "src": "https://github.com/anthropics/anthropic-sdk-typescript"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "238 projects",
   "status": "info",
   "sub": "#4 of 92 in its category",
   "note": "Dependency in 238 public GitHub projects set up for AI coding agents that we scanned (3.8%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Docs for agents",
   "status": "yes",
   "sub": "llms.txt",
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": "https://docs.anthropic.com/llms.txt"
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What Anthropic SDK does",
   "parts": [
    {
     "t": "prose",
     "text": "This is Anthropic's own TypeScript client for the Claude API. It is built for server-side code across many JavaScript runtimes, and it refuses to run in a browser unless you set a flag literally named <code>dangerouslyAllowBrowser</code>."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "Anthropic SDK popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "74",
       "of": "/ 100",
       "l": "Gid Score, #241 overall"
      },
      {
       "n": "75M",
       "l": "downloads a week, npm"
      },
      {
       "n": "2,185",
       "l": "GitHub stars"
      },
      {
       "n": "238",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How Anthropic SDK is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "Anthropic SDK is a dependency in 238 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (4.9% of the 4,867 JavaScript/TypeScript ones), #4 of 92 in model sdks.",
      "Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 1,035; those are left out of every share on this page.",
      "The most used alternative in our scan is OpenAI (286 projects).",
      "Projects that use it most often also use OpenAI (37.0%), Zod (60.1%), Express (33.6%).",
      "It is more common in projects set up for OpenClaw (9.0%) than for GitHub Copilot (2.6%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "189 projects, 5.8%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "81 projects, 3.3%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "79 projects, 2.6%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "30 projects, 9.0%",
       "v": "OpenClaw",
       "path": "agents/openclaw/"
      },
      {
       "l": "20 projects, 4.2%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "19 projects, 6.8%",
       "v": "Devin Desktop",
       "path": "agents/devin-desktop/"
      },
      {
       "l": "18 projects, 3.8%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      },
      {
       "l": "11 projects, 3.2%",
       "v": "OpenCode",
       "path": "agents/opencode/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 37.0% of its projects",
       "v": "OpenAI",
       "path": "tools/openai-npm/"
      },
      {
       "l": "In 60.1% of its projects",
       "v": "Zod",
       "path": "tools/zod/"
      },
      {
       "l": "In 33.6% of its projects",
       "v": "Express",
       "path": "tools/express/"
      },
      {
       "l": "In 44.5% of its projects",
       "v": "tsx",
       "path": "tools/tsx/"
      },
      {
       "l": "In 84.0% of its projects",
       "v": "TypeScript",
       "path": "tools/typescript/"
      },
      {
       "l": "In 34.9% of its projects",
       "v": "Model Context Protocol SDK (JavaScript)",
       "path": "tools/modelcontextprotocol/"
      },
      {
       "l": "In 43.3% of its projects",
       "v": "dotenv",
       "path": "tools/dotenv/"
      },
      {
       "l": "In 24.8% of its projects",
       "v": "ws",
       "path": "tools/ws/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "Anthropic SDK in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Runs on server and edge runtimes",
       "v": "The README lists Node.js 20 LTS or later, Deno v1.28.0 or higher, Bun 1.0 or later, Cloudflare Workers, Vercel Edge Runtime and Nitro v2.6 or greater as supported."
      },
      {
       "l": "Hooks around every request",
       "v": "The platform docs describe SDK middleware that runs your code before each request and after each response. They also describe a client-side fallback middleware that retries refused requests on other models you name."
      },
      {
       "l": "Tracing built into the client",
       "v": "The docs say the Claude SDK emits OpenTelemetry spans in your application for each request and for each tool its tool runner runs."
      },
      {
       "l": "Browser and desktop toolsets",
       "v": "According to the docs, the TypeScript SDK includes classes that connect Claude's browser use or computer use tool to a browser or desktop you provide."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Browser use is off by default",
       "v": "The SDK will not run in a web browser unless you set <code>dangerouslyAllowBrowser</code> to <code>true</code>. The README says this default exists to avoid exposing secret API credentials. React Native is not supported."
      },
      {
       "l": "Jest needs the node environment",
       "v": "The README says Jest 28 or greater is supported only with the <code>\"node\"</code> environment. <code>\"jsdom\"</code> is not supported."
      },
      {
       "l": "Two Google Cloud clients",
       "v": "On Google Cloud, <code>AnthropicGoogleCloud</code> targets the Anthropic-managed offering and <code>AnthropicVertex</code> targets the Google-managed one. Calling api.anthropic.com with an API key uses neither offering."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Send a first message"
    },
    {
     "t": "tabs",
     "label": "Example",
     "items": [
      {
       "tab": "Js",
       "code": "import Anthropic from '@anthropic-ai/sdk';\n\nconst client = new Anthropic({\n  apiKey: process.env['ANTHROPIC_API_KEY'], // This is the default and can be omitted\n});\n\nconst message = await client.messages.create({\n  max_tokens: 1024,\n  messages: [{ role: 'user', content: 'Hello, Claude' }],\n  model: 'claude-opus-5-5',\n});\n\nconsole.log(message.content);"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about Anthropic SDK",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Head to head",
       "items": [
        {
         "text": "OpenAI vs Anthropic SDK",
         "note": "used together in 88 projects",
         "path": "tools/compare/openai-vs-anthropic-sdk/"
        },
        {
         "text": "Anthropic SDK vs Google Generative AI",
         "note": "used together in 42 projects",
         "path": "tools/compare/anthropic-sdk-vs-google-generative-ai/"
        }
       ]
      },
      {
       "title": "Packages around it",
       "items": [
        "@anthropic-ai/claude-agent-sdk: Claude Agent SDK",
        "@anthropic-ai/sandbox-runtime: Sandbox runtime",
        "@anthropic-ai/mcpb: MCP bundles",
        "@anthropic-ai/vertex-sdk: Vertex AI client",
        "@anthropic-ai/claude-code: Claude Code CLI",
        "@anthropic-ai/bedrock-sdk: Bedrock client"
       ]
      },
      {
       "title": "More in Model SDKs",
       "path": "tools/ai-sdks/",
       "items": [
        {
         "text": "AI SDK",
         "path": "tools/ai/"
        },
        {
         "text": "OpenAI Python Library",
         "path": "tools/openai-pypi/"
        },
        {
         "text": "Anthropic Python SDK",
         "path": "tools/anthropic/"
        },
        {
         "text": "Google GenAI Python SDK",
         "path": "tools/google-genai-pypi/"
        },
        {
         "text": "Hugging Face Hub",
         "path": "tools/huggingface-hub/"
        },
        {
         "text": "LiteLLM",
         "path": "tools/litellm/"
        },
        {
         "text": "Ollama",
         "path": "tools/ollama-pypi/"
        },
        {
         "text": "Transformers.js",
         "path": "tools/huggingface/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "Anthropic SDK",
       "me": true,
       "facts": [
        "Apache-2.0",
        "Gid 74",
        "75M/wk"
       ]
      },
      {
       "name": "OpenAI",
       "why": "Official TypeScript SDK for accessing OpenAI APIs including GPT and embeddings.",
       "path": "tools/openai-npm/",
       "facts": [
        "Apache-2.0",
        "Gid 81",
        "62.5M/wk"
       ]
      },
      {
       "name": "Google Generative AI",
       "why": "Official SDK for Google Gemini API to build AI-powered applications.",
       "path": "tools/google-genai-npm/",
       "facts": [
        "Apache-2.0",
        "Gid 69",
        "34.2M/wk"
       ]
      },
      {
       "name": "Ollama JavaScript Library",
       "why": "Official JavaScript client library for Ollama to run and interact with local language models.",
       "path": "tools/ollama-npm/",
       "facts": [
        "MIT",
        "Gid 57",
        "1.3M/wk"
       ]
      },
      {
       "name": "Groq SDK",
       "why": "Official TypeScript SDK for calling Groq's fast language models API.",
       "path": "tools/groq-sdk/",
       "facts": [
        "Apache-2.0",
        "Gid 47",
        "1.2M/wk"
       ]
      },
      {
       "name": "Mistral AI",
       "why": "Official TypeScript SDK for calling Mistral's language models and APIs.",
       "path": "tools/mistralai-mistralai/",
       "facts": [
        "Apache-2.0",
        "Gid 45",
        "6.7M/wk"
       ]
      },
      {
       "name": "Replicate",
       "why": "JavaScript client library for calling Replicate's AI model API.",
       "path": "tools/replicate-npm/",
       "facts": [
        "Apache-2.0",
        "Gid 41",
        "713K/wk"
       ]
      }
     ],
     "more": "Compare Anthropic SDK with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "npm install @anthropic-ai/sdk"
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## Anthropic SDK\n- Keep the client on the server. Read the key from `process.env['ANTHROPIC_API_KEY']`, which the client uses by default.\n- Do not set `dangerouslyAllowBrowser: true` unless the user explicitly accepts exposing the API key in a browser. Do not target React Native.\n- Assume TypeScript >= 5.0 and Node.js 20 LTS or later. Deno, Bun, Cloudflare Workers, Vercel Edge Runtime and Nitro are also supported.\n- Run Jest tests that touch the SDK in the `\"node\"` environment, not `\"jsdom\"`.\n- On Google Cloud, use `AnthropicGoogleCloud` for the Anthropic-managed offering and `AnthropicVertex` for the Google-managed one. Do not mix them.\n- Treat refusals as normal responses. Check `stop_reason` for `\"refusal\"` instead of relying only on caught errors.\n- Check current SDK versions at https://platform.claude.com/docs/sdk-versions.json, and query the docs MCP server at https://platform.claude.com/docs/mcp when unsure of an API.\n"
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm @anthropic-ai/sdk"
  ],
  [
   "Category",
   "Model SDKs"
  ],
  [
   "License",
   "Apache-2.0"
  ],
  [
   "Latest version",
   "sdk-v1.8.0, November 10, 2026"
  ],
  [
   "On GitHub since",
   "January 2023"
  ],
  [
   "Gid Score",
   "73.8"
  ],
  [
   "Rank in category",
   "#4 of 92"
  ],
  [
   "GitHub",
   "anthropics/anthropic-sdk-typescript"
  ],
  [
   "Last change",
   "Nov 23, 2026"
  ]
 ],
 "good": [],
 "checked_line": "From the package registry, GitHub and our scan of public agent projects; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/anthropics.png"
}