https://github.com/anthropics/anthropic-sdk-ruby
https://github.com/anthropics/anthropic-sdk-ruby
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/anthropics/anthropic-sdk-ruby
- Owner: anthropics
- License: mit
- Created: 2025-03-07T01:48:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-04-30T17:30:46.000Z (2 months ago)
- Last Synced: 2026-05-01T03:05:24.740Z (2 months ago)
- Language: Ruby
- Size: 5.43 MB
- Stars: 328
- Watchers: 15
- Forks: 53
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-claude - anthropic-sdk-ruby
- fucking-awesome-ruby - anthropic-sdk-ruby - The official Ruby SDK for the Anthropic API, for building applications with Claude. (AI and LLMs)
- awesome-ruby - anthropic-sdk-ruby - The official Ruby SDK for the Anthropic API, for building applications with Claude. (AI and LLMs)
README
# Claude SDK for Ruby
[](https://rubygems.org/gems/anthropic)
The Claude SDK for Ruby provides access to the [Claude API](https://docs.anthropic.com/en/api/) from Ruby applications.
## Documentation
Full documentation is available at **[platform.claude.com/docs/en/api/sdks/ruby](https://platform.claude.com/docs/en/api/sdks/ruby)**.
## Installation
Add to your application's Gemfile:
```ruby
gem "anthropic", "~> 1.38.0"
```
## Getting started
```ruby
require "bundler/setup"
require "anthropic"
anthropic = Anthropic::Client.new(
api_key: ENV["ANTHROPIC_API_KEY"] # This is the default and can be omitted
)
message = anthropic.messages.create(
max_tokens: 1024,
messages: [{role: "user", content: "Hello, Claude"}],
model: "claude-opus-4-6"
)
puts(message.content)
```
## Requirements
Ruby 3.2.0+
## Contributing
See [CONTRIBUTING.md](./CONTRIBUTING.md).
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## Acknowledgements
Thank you [@alexrudall](https://github.com/alexrudall) for giving feedback, donating the anthropic Ruby Gem name, and paving the way by building the first Anthropic Ruby SDK.