
Build a chatbot in Rails — Hotwire streaming
Turbo Streams + TokenRex for a Ruby-native chat UI.
Rails 7's Turbo Streams pair beautifully with LLM streaming. Broadcast chunks to a partial as they arrive.
ruby
client = OpenAI::Client.new(access_token: ENV["TOKENREX_API_KEY"], uri_base: "https://tokenrex.ai/api/public/v1")
client.chat(parameters: { model: "gpt-5.4-mini", messages: msgs, stream: ->(chunk) { broadcast(chunk) } })Models in this article
Review current prices, specifications and source-linked benchmarks.
Build this with TokenRex
TokenRex is an LLM marketplace by Asirex Labs. Choose an enabled model, create a private API key and use the supported endpoint shown in Docs. Check live prices before your first request.