Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
OpenAI
✓ require 'ruby-openai'
Send a chat completion request to OpenAI.
require 'ruby-openai'
client = OpenAI::Client.new(access_token: ENV['OPENAI_API_KEY'])
response = client.chat(parameters: { model: 'gpt-3.5-turbo', messages: [{ role: 'user', content: 'Hello!' }] })
puts response.dig('choices', 0, 'message', 'content')
Debug
Known issues
No known issues recorded.
Audit
Dependencies
No dependency data recorded yet.