Discover and explore top open-source AI tools and projects—updated daily.
anthropicsRuby SDK for Anthropic AI models
Top 94.9% on SourcePulse
This Ruby SDK provides a streamlined interface for integrating with the Anthropic REST API within Ruby 3.2.0+ applications. It simplifies access to powerful AI models like Claude, enabling developers to build AI-powered features efficiently.
How It Works
The library leverages Ruby's standard net/http for HTTP communication, enhanced with connection pooling via the connection_pool gem for performance. It offers robust type definitions (Yard, RBS, RBI) for enhanced developer experience and static analysis, particularly with Sorbet.
Quick Start & Requirements
Install via Bundler by adding gem "anthropic", "~> 1.16.0" to your Gemfile. Requires Ruby 3.2.0 or higher. API keys are typically sourced from the ANTHROPIC_API_KEY environment variable. Official documentation is available on RubyDoc and docs.anthropic.com.
Highlighted Details
Pathname, StringIO, and custom Anthropic::FilePart objects.APIError subclasses. Automatic retries (default 2) with exponential backoff are configured for transient network issues and server errors.Anthropic::BedrockClient) and Google Vertex AI (Anthropic::VertexClient) via additional gems.client.request. Anthropic::Client instances are thread-safe with connection pooling.Maintenance & Community
Feedback and bug reports are encouraged via GitHub issues. A pinned issue serves as a forum for smaller discussions. The project acknowledges early contributors like @alexrudall.
Licensing & Compatibility
The provided README does not specify a software license. This omission requires clarification regarding usage rights, particularly for commercial applications or integration into closed-source projects.
Limitations & Caveats
The library is currently at major version 0, indicating potential for breaking API changes. Anthropic::Client instances are not fork-safe during active HTTP requests. Use of undocumented parameters or endpoints carries a security warning.
20 hours ago
Inactive
AnswerDotAI