Getting gcode stream from API

I'm looking through the OctoPrint API docs and I can't seem to find an endpoint for the stream in the "Terminal" tab. How do I programmatically get access to this stream? Is there some sort of e.g. websocket endpoint?

There is indeed a websocket. Documentation is here:

Oh awesome this is exactly what I needed. Thanks!