Skip to content
프로젝트

소개

Go를 통해 Anthropic의 안전성을 최우선으로 하는 언어 모델 API에 액세스

AI 및 머신러닝

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
+6
in 15 days
+11
in 1 month
+21

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Anthropic SDK for Go

Go Reference

The Anthropic SDK for Go provides access to the Claude API from Go applications.

Documentation

Full documentation is available at platform.claude.com/docs/en/api/sdks/go.

Installation

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

Or explicitly add the dependency:

go get -u 'github.com/anthropics/anthropic-sdk-go/[email protected]'

Getting started

package main

import (
	"context"
	"fmt"

	"github.com/anthropics/anthropic-sdk-go/v2"
	"github.com/anthropics/anthropic-sdk-go/v2/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.ModelClaudeOpus5_5,
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", message.Content)
}

Requirements

Go 1.25+

Contributing

See CONTRIBUTING.md.

License

This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details. Versions released before the change from the MIT License, and third-party contributions merged before it, remain under the MIT License. See LICENSE-MIT.

관련 프로젝트 살펴보기

불러오는 중…