{"id":15698661,"url":"https://github.com/unfunco/anthropic-sdk-go","last_synced_at":"2025-05-08T22:16:32.156Z","repository":{"id":234225827,"uuid":"787911526","full_name":"unfunco/anthropic-sdk-go","owner":"unfunco","description":"Go client library for interacting with the Anthropic safety-first language model REST APIs.","archived":false,"fork":false,"pushed_at":"2024-07-03T09:51:59.000Z","size":49,"stargazers_count":7,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-08T22:16:26.084Z","etag":null,"topics":["anthropic","anthropic-claude","api-client","api-client-go","claude","claude-3","claude-api","client-library","go","golang","sdk"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unfunco.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-17T12:21:12.000Z","updated_at":"2025-04-27T06:56:41.000Z","dependencies_parsed_at":"2024-10-24T05:39:34.280Z","dependency_job_id":null,"html_url":"https://github.com/unfunco/anthropic-sdk-go","commit_stats":null,"previous_names":["unfunco/anthropic-sdk-go"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unfunco%2Fanthropic-sdk-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unfunco%2Fanthropic-sdk-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unfunco%2Fanthropic-sdk-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unfunco%2Fanthropic-sdk-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unfunco","download_url":"https://codeload.github.com/unfunco/anthropic-sdk-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253154983,"owners_count":21862624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anthropic","anthropic-claude","api-client","api-client-go","claude","claude-3","claude-api","client-library","go","golang","sdk"],"created_at":"2024-10-03T19:31:53.554Z","updated_at":"2025-05-08T22:16:32.134Z","avatar_url":"https://github.com/unfunco.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Anthropic SDK for Go\n\n[![CI](https://github.com/unfunco/anthropic-sdk-go/actions/workflows/ci.yaml/badge.svg)](https://github.com/unfunco/anthropic-sdk-go/actions/workflows/ci.yaml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-purple.svg)](https://opensource.org/licenses/MIT)\n\n\u003e [!NOTE]\\\n\u003e This is not an official SDK, and I am not affiliated with [Anthropic].\\\n\u003e Official SDKs from Anthropic are available\n\u003e for [Python](https://github.com/anthropics/anthropic-sdk-python),\n\u003e and [TypeScript/JavaScript](https://github.com/anthropics/anthropic-sdk-typescript).\n\nClient library for interacting with the [Anthropic] safety-first language model\nREST APIs.\\\nDocumentation for the REST API can be found at [docs.anthropic.com].\n\n## Getting started\n\n### Requirements\n\n- [Claude API key]\n- [Go] 1.22+\n\n### Installation and usage\n\nImport the module and run the `go get` command without any arguments to resolve\nand add the SDK to your dependencies.\n\n```go\nimport \"github.com/unfunco/anthropic-sdk-go\"\n```\n\nConstruct a new REST API client with a `http.Client` derived from a Transport\ncontaining your [Claude API key]. The derived HTTP client will automatically add\nthe API key as a header to each request sent to the API.\n\n```go\ntransport := anthropic.NewTransport(os.Getenv(\"ANTHROPIC_API_KEY\"))\nclaude := anthropic.NewClient(transport.Client())\n```\n\nOnce constructed, you can use the client to interact with the REST API.\n\n```go\ndata, _, err := claude.Messages.Create(\n    context.Background(),\n    \u0026anthropic.CreateMessageInput{\n        MaxTokens: 1024,\n        Messages: []anthropic.Message{\n            {\n                Content: \"Hello, Claude!\",\n                Role:    \"user\",\n            },\n        },\n        Model: anthropic.Claude3Opus20240229,\n    },\n)\n```\n\n### Development and testing\n\nClone the repository and change into the `anthropic-sdk-go` directory.\n\n```bash\ngit clone git@github.com:unfunco/anthropic-sdk-go.git\ncd anthropic-sdk-go\n```\n\nRun the unit tests with coverage to ensure everything is working as expected.\n\n```bash\ngo test -cover -v ./...\n```\n\n## References\n\n- [Anthropic API](https://www.anthropic.com/api)\n\n## License\n\n© 2024 [Daniel Morris]\\\nMade available under the terms of the [MIT License].\n\n[anthropic]: https://www.anthropic.com\n[claude api key]: https://www.anthropic.com/api\n[daniel morris]: https://unfun.co\n[docs.anthropic.com]: https://docs.anthropic.com\n[go]: https://go.dev\n[mit license]: LICENSE.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funfunco%2Fanthropic-sdk-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funfunco%2Fanthropic-sdk-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funfunco%2Fanthropic-sdk-go/lists"}