Description
Ruby OpenAI is a Ruby gem for using the OpenAI API from Ruby code. It covers the main parts of the API, including chat with streaming and vision, JSON mode, the Responses API with follow-up messages, tool calls and streaming, and image generation with DALL-E 2 and DALL-E 3. It also covers embeddings, moderation, Whisper for transcription and translation, speech, batches, files, fine-tuning, vector stores, assistants with threads, runs and file search, and realtime conversations over WebRTC. The README includes a quickstart with a token passed directly to a client, and a configuration approach for a robust setup, where API keys are kept in an initializer and loaded from environment variables with a tool such as dotenv rather than written into the code. Clients can override the global configuration when they are created, including custom timeouts, base URIs and extra headers. The gem can work with other providers through compatible endpoints, with sections in the README for Azure, Deepseek, Ollama, Groq and Gemini, and it explains how to count tokens and how to handle errors. The project is open source on GitHub under alexrudall/ruby-openai.…
Highlights
- OpenAI API client for Ruby
- Streaming chat and the Responses API
- Realtime conversations over WebRTC
- Images, Whisper, speech, embeddings and moderation
- Compatible endpoints for Azure, Ollama, Groq and Gemini
Ratings & Reviews
No ratings yet
Be the first to rate Ruby Openai.
People also visit
Ruby Openai FAQ
What is Ruby OpenAI?
A Ruby gem that gives Ruby code access to the OpenAI API.
Is it free?
The gem is open source and hosted on GitHub. You still pay OpenAI for API use.
How do I install it?
Add the gem to your Gemfile and run bundle install, or install it with gem install and require it.
Where do I put my API key?
The README says to keep keys out of the code, for example in an openai.rb initializer that reads them from the environment with a tool such as dotenv.
Does it support streaming?
Yes. Chat and the Responses API can stream responses.
Can I use it with other providers?
The README has sections for Azure, Deepseek, Ollama, Groq and Gemini.
Where can I see the full list?
The README contents list covers chat, images, speech, vector stores, assistants, runs and realtime.
What are the best Ruby Openai alternatives?
Popular alternatives to Ruby Openai include RubyLLM, Ask Chatgpt and Go Openai. See all Ruby Openai alternatives



