Skip to content
CAI
Software that uses CAICheck a score

alexrudall/ruby-openai

59.5

Adequate · 28 September 2026

854

lines of production code

Ruby

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is an official Ruby client library for the OpenAI API, providing a comprehensive interface for interacting with OpenAI services. It supports a wide range of capabilities including chat, audio, images, embeddings, and the Assistants API v2, along with asynchronous batch processing and real-time sessions. The library handles HTTP communication via Faraday, manages configuration and token estimation, and includes robust test coverage for API endpoints and error handling.

How it got here

2020 — Ruby SDK namespace standardization

6 changes.

The Ruby client library was refactored to standardize its module structure under the root-level OpenAI namespace, replacing the legacy Ruby::Openai structure. This period also involved updating the gem to version 8.3.0 with modern Ruby and dependency requirements, while cleaning up obsolete tests and adding comprehensive coverage for configuration and utility methods.

2021–2023 — Initial library release and API expansion

6 changes.

This period focused on the initial release of the OpenAI Ruby client library, establishing its core structure and integrating Faraday for HTTP communication. It involved expanding the API surface to support Assistants API v2, Responses, Realtime sessions, and Batches, while simultaneously building comprehensive test coverage and fixtures to validate these new features.

Features

Initial release of the OpenAI Ruby client library

This change introduces the core \lib/openai.rb\ file, establishing the foundational structure for the Ruby client. It defines the \OpenAI\ module with a configuration class that supports settings for access tokens, admin tokens, API versions, base URIs, timeouts, and error logging. The library integrates Faraday for HTTP communication and includes a \rough\_token\_count\ utility for estimating token usage. It also wires up a comprehensive set of API interaction modules, including Assistants, Threads, Messages, Runs, Vector Stores, Audio, Batches, and Realtime sessions, providing a complete interface for interacting with OpenAI services.

lib · high confidence

Introduce comprehensive Assistants API v2 and new API capabilities

This release adds full support for the OpenAI Assistants API v2, introducing dedicated client methods for managing assistants, threads, messages, runs, run steps, vector stores, vector store files, and vector store file batches. It also introduces new capabilities including the Responses API, Realtime session creation, Batches for async processing, and a Usage endpoint for organization-level cost tracking. The HTTP layer has been refactored to use Faraday, and the streaming implementation now supports any callable object rather than just Procs.

lib/openai · high confidence

Behavioural changes

Removal of legacy Ruby::Openai module and version file

The legacy \Ruby::Openai\ module and its associated \version.rb\ file have been removed from the library. This change eliminates the old nested namespace structure, aligning with the broader effort to standardize on the root-level \OpenAI::\ module prefix for cleaner and more consistent API usage.

lib/ruby/openai · high confidence

Standardize Ruby client under OpenAI module namespace

The Ruby client library has been refactored to standardize its module structure. The previous \Ruby::Openai\ namespace has been removed in favor of the root-level \OpenAI\ module, aligning with the broader SDK naming convention. This change simplifies the library's structure and ensures consistency across different language clients.

lib/ruby · high confidence

Updated console script to use the new gem name

The bin/console script now requires the 'openai' gem instead of 'ruby/openai', aligning the development environment with the gem's new name and module structure.

bin · high confidence

Test coverage

Added JSONL validation test fixture for missing quotes; Added VCR multipart request matcher; Added specs for OpenAI configuration and token counting; Added test fixtures for batch, training, and classification scenarios; Expanded test coverage for OpenAI client API endpoints; Removed obsolete Ruby test suite.

Dependencies

Update ruby-openai to v8.3.0 with Ruby 2.6+ support and Faraday dependencies

The ruby-openai gem has been updated to version 8.3.0, raising the minimum supported Ruby version from 2.3.0 to 2.6.0. The gem now explicitly depends on faraday (\>= 1), faraday-multipart (\>= 1), and event\_stream\_parser (\>= 0.3.0, \< 2.0.0). Development dependencies have been refreshed, including rubocop to 1.74.0, rspec to 3.13, and webmock to 3.25.1. The gemspec metadata has been completed with actual URLs for source code, changelog, bug tracker, and documentation, replacing previous TODO placeholders.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 58 → 59 (+1.1)
  • Rubric changed (rubric-2026.09.8 → rubric-2026.09.16) — scores are not directly comparable.

Lenses

  • Code Health 99 → 99 (+0.0)
  • Architecture 69 → 69 (+0.0)
  • Maturity 61 → 61 (+0.0)
  • Readiness 45 → 47 (+2.0)
  • Security 87 → 90 (+2.1)

New (2)

  • Inconsistent return types for namespace accessors: Client.admin() returns a configuration/admin object (implied by name and typical usage), while Client.beta(apis) returns a namespace handler object. This breaks the pattern where namespace methods (like Client.assistants(), Client.files()) return resource handlers.
  • Inconsistent token counting API: OpenAI.rough_token_count is a standalone utility method on the root module, whereas token counting is often expected to be part of the model-specific or client-level operations (like chat/completions) or a dedicated service. It lacks a clear domain association compared to other methods.

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

alexrudall/ruby-openai was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 28 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 62938e02bb83e9f243ad2447805bc461d5d126fe — the exact code this score is about.
  • Scored under rubric-2026.09.16 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-2d9048c36d26.