New
Apps 854Makers 853This week 854
Promote your app−30%
3views in
the last 30 days

Anthropic SDK for Go

Go client library for interacting with the Anthropic safety-first language model REST APIs.

Built with Copilot coding agent

by unfunco · from GBUnited Kingdom · added Oct 29, 2026
no ratings0 comments

Anthropic SDK for Go

Note

This project predates Anthropic's official Go SDK. Use Anthropic's official Go SDK instead; this repository will no longer be developed.

Note

This is not an official SDK, and I am not affiliated with Anthropic.
Official SDKs from Anthropic are available for Python, and TypeScript/JavaScript.

Client library for interacting with the Anthropic safety-first language model REST APIs.
Documentation for the REST API can be found at docs.anthropic.com.

Getting started

Requirements

Installation and usage

Import the module and run the go get command without any arguments to resolve and add the SDK to your dependencies.

import "github.com/unfunco/anthropic-sdk-go"

Construct a new REST API client with a http.Client derived from a Transport containing your Claude API key. The derived HTTP client will automatically add the API key as a header to each request sent to the API.

transport := anthropic.NewTransport(os.Getenv("ANTHROPIC_API_KEY"))
claude := anthropic.NewClient(transport.Client())

Once constructed, you can use the client to interact with the REST API.

data, _, err := claude.Messages.Create(
    context.Background(),
    &anthropic.CreateMessageInput{
        MaxTokens: 1024,
        Messages: []anthropic.Message{
            {
                Content: "Hello, Claude!",
                Role:    "user",
            },
        },
        Model: anthropic.Claude3Opus20240229,
    },
)

Development and testing

Clone the repository and change into the anthropic-sdk-go directory.

git clone git@github.com:unfunco/anthropic-sdk-go.git
cd anthropic-sdk-go

Run the unit tests with coverage to ensure everything is working as expected.

go test -cover -v ./...

References

License

© 2024 Daniel Morris
Made available under the terms of the MIT License.

Description taken from the repository README.

Ratings

–
0 ratings
5 0
4 0
3 0
2 0
1 0

Rate this app

Sign in to rate

Comments 0

Sign in to comment

No comments yet.

Related apps

#go · #api · #api-client