Go SDK
Description
<a href="https://pkg.go.dev/github.com/anthropics/anthropic-sdk-go"></a>
Installation
claude install-skill https://github.com/anthropics/anthropic-sdk-go README
Claude SDK for Go
The Claude SDK for Go provides access to the [Claude API](https://docs.anthropic.com/en/api/) from Go applications.
Documentation
Full documentation is available at **[platform.claude.com/docs/en/api/sdks/go](https://platform.claude.com/docs/en/api/sdks/go)**.
Installation
import (
"github.com/anthropics/anthropic-sdk-go" // imported as anthropic
)
Or explicitly add the dependency:
go get -u 'github.com/anthropics/anthropic-sdk-go@v1.28.0'
Getting started
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.ModelClaudeOpus4_6,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", message.Content)
}
Requirements
Go 1.22+
Contributing
See [CONTRIBUTING.md](./CONTRIBUTING.md).
License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
Related Skills
使用 Git Worktrees
创建孤立的 Git worktrees,带有智能目录选择与安全验证。
Git community Claude skills github
[Building agent skills blog](https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills)
Git community #148
, [#161](https://github.com/affaan-m/everything-claude-code/pull/161))
Git community GitHub MCP
| Token | Repos, issues, PRs, workflows |
Git community GitHub MCP Server
Official first-party server to read repos, manage issues/PRs, and automate workflows.
Git community mcp-server-github
GitHub API integration for repos, issues, PRs.
Git community