coder

Anthropic SDK Go — AI skill for Claude Code

AI community

Access to Anthropic's safety-first language model APIs via Go.

How to install Anthropic SDK Go

This entry records only its repository, not the path inside it, so there is no exact command to give. Open coder/anthropic-sdk-go and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Anthropic SDK Go does

Access to Anthropic's safety-first language model APIs via Go.

Alternatives in AI

  • Welcome — AI Research Skills — You now have access to 86 production-ready skills covering the entire AI research lifecycle: literature survey 5.4k ★
  • WindsurfAPI — Turn Windsurf / Devin Desktop's 100+ AI models (Claude, GPT, Gemini, DeepSeek, Kimi, GLM, SWE) into OpenAI-, A 3k ★
  • Gemini Skills — Skills for Gemini API, SDK and model interactions 2.3k ★

README

Anthropic Go API Library

Go Reference

The Anthropic Go library provides convenient access to the [Anthropic REST API](https://docs.anthropic.com/claude/reference/) from applications written in Go.

Installation

import (
	"github.com/anthropics/anthropic-sdk-go" // imported as anthropic
)

Or to pin the version:

go get -u 'github.com/anthropics/anthropic-sdk-go@v1.26.0'

Requirements

This library requires Go 1.22+.

Usage

The full API of this library can be found in [api.md](api.md).

package main

import (
	"context"
	"fmt"

	"github.com/anthropics/anthropic-sdk-go"
	"github.com/anthropics/anthropic-sdk-go/option"
)

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"), // defaults to os.LookupEnv("ANTHROPIC_API_KEY")
	)
	message, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
		MaxTokens: 1024,
		Messages: []anthropic.MessageParam{
			anthropic.NewUserMessage(anthropic.NewTextBlock("What is a quaternion?")),
		},
		Model: anthropic.ModelClaudeSonnet4_5_20250929,
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", message.Content)
}
Conversations
messages := []anthropic.MessageParam{
    anthropic.NewUserMessage(anthropic.NewTextBlock("What is my first name?")),
}

message, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
    Model:     anthropic.ModelClaudeSonnet4_5_20250929,
    Messages:  messages,
    MaxTokens: 1024,
})
if err != nil {
    panic(err)
}

fmt.Printf("%+v\n", message.Content)

messages = append(message