openai/openai-ruby

Official Ruby SDK for the OpenAI API

What it solves

This library provides a convenient, typed Ruby interface for interacting with the OpenAI REST API, allowing developers to integrate AI capabilities into Ruby 3.3.0+ applications without writing raw HTTP requests.

How it works

It acts as a wrapper around the OpenAI REST API using net/http for transport and the connection_pool gem for efficiency. The library supports various interaction patterns including standard request-response, Server-Sent Events (SSE) for streaming, and block-scoped Realtime WebSocket sessions for voice and text. It also includes specialized helpers for paginated lists, file uploads, and polling for asynchronous processing (such as vector store ingestion).

Who it’s for

Ruby developers building AI-powered applications who need a robust, typed SDK for OpenAI services, including those using Microsoft Azure OpenAI or Amazon Bedrock providers.

Highlights

  • Multi-Provider Support: Native integration for OpenAI, Microsoft Azure OpenAI, and Amazon Bedrock.
  • Advanced Transport: Support for Realtime WebSockets, streaming responses, and custom HTTP clients for advanced requirements like mutual TLS (mTLS).
  • ** uma Typed Interface**: Comprehensive types and docstrings provided via Yard, RBS, and RBI, with Sorbet support.
  • Enterprise Authentication: Support for workload identity authentication (Kubernetes, Azure, GCP) and X.509 certificates for secure, keyless access.
  • Developer Utilities: Built-in auto-paginating iterators and polling helpers for file processing and vector store ingestion.

関連

  • プロジェクト
  • プロジェクト
  • プロジェクト
  • プロジェクト
  • プロジェクト