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

  • Harness Bridge

    SDK / Tool

    A local launcher that points Claude Code and seven other coding harnesses at any OpenAI-, Anthropic- or Responses-compatible endpoint — without editing a single config file.

    • launcher
    • local-models
    • cli
    • menu-bar
  • Claude for Siri

    SDK / Tool

    Answers macOS Spotlight and Siri prompts with your signed-in Claude Code account — an experimental macOS 27 model-delegation provider.

    • macos
    • siri
    • spotlight
    • model-delegation
  • Extract your own local chat history from ten AI coding assistants into one normalized JSONL — for fine-tuning, analytics, or backing up years of conversations. Standard library only.

    • cli
    • data-export
    • jsonl
    • backup