SpyBara
Go Premium

Reference 2026-08-17 22:57 UTC to 2026-08-18 04:58 UTC

1 file changed +27 −0. View all changes and history on the product overview
2026
Tue 18 04:58 Mon 17 22:57 Sun 16 16:58 Sat 15 02:02 Fri 14 23:57 Thu 13 22:00 Wed 12 16:01 Tue 11 22:59 Mon 10 22:00 Sat 8 00:59 Fri 7 21:59 Thu 6 18:59 Wed 5 02:01 Tue 4 22:59 Mon 3 21:58 Sat 1 01:00

ruby/index.md +27 −0

Details

50end50end

51```51```

52 52 

53### Realtime WebSockets

54 

55The SDK supports block-scoped, typed Realtime WebSocket sessions for

56server-side text workflows. Add the optional `async-websocket` gem, then use

57`client.realtime.connect`:

58 

59```ruby

60client.realtime.connect(model: "gpt-realtime-2.1") do |connection|

61 connection.session.update(type: :realtime, output_modalities: [:text])

62 connection.conversation.items.create(

63 type: :message,

64 role: :user,

65 content: [{type: :input_text, text: "Hello"}]

66 )

67 connection.response.create

68 

69 connection.each do |event|

70 print(event.delta) if event.is_a?(OpenAI::Realtime::ResponseTextDeltaEvent)

71 break if event.is_a?(OpenAI::Realtime::ResponseDoneEvent)

72 end

73end

74```

75 

76See the [Realtime WebSocket guide](realtime.md) and the runnable

77[text example](examples/realtime/README.md) for lifecycle, authentication,

78proxy, TLS, and custom transport details.

79 

53### Pagination80### Pagination

54 81 

55List methods in the OpenAI API are paginated.82List methods in the OpenAI API are paginated.