ClaudeMap

Anthropic SDK for Go

Official Anthropic Go SDK for the Claude API.

SDKs & Toolingofficialsdkgoclaude-api

Idiomatic Go client for the Claude Messages API, Batch API, and token counting. Maintained by anthropics.

What it does

  • Idiomatic Go with net/http-style streaming — zero-allocation event parsing
  • Context-aware cancellation through context.Context — natural fit for Go servers
  • Full Messages, Batch, Files, Token Counting, Vision coverage
  • Tool use with strict schema validation via jsonschema tags
  • Used by Cloudflare Workers, Anthropic's own internal services, and many Go-first agent stacks

When to use it

Best for high-throughput Go backends (Cloudflare Workers, k8s controllers), CLI tools written in Go, and any production agent where net/http streaming + context cancellation are first-class requirements. Pairs well with cobra for CLIs and chi/gin for HTTP frontends.

Getting started

go get github.com/anthropics/anthropic-sdk-go

Set ANTHROPIC_API_KEY (and ANTHROPIC_BASE_URL for Bedrock/Vertex) via os.Setenv or a config loader.

Things to know

The Go SDK tracks the Python SDK closely — most features ship within weeks of parity. Pin major versions; the streaming API surface has stabilised since v1.0 but earlier 0.x versions had breaking changes.

Repository

anthropics/anthropic-sdk-go

Charted

Related on the map

  • E2B

    SDK / Tool

    Open-source secure sandboxes where AI agents run code — the de facto execution layer for agent apps.

    • sandbox
    • code-execution
    • sdk
    • agents
  • FastMCP

    SDK / Tool

    Pythonic framework for building MCP servers — decorators, type hints, and zero boilerplate.

    • framework
    • python
    • mcp
    • type-driven
  • Anthropic's official TypeScript SDK for building agentic applications.

    • official
    • sdk
    • typescript
    • anthropic