[Cycles Standalone] How to bake AO/lighting?


I’d like to use the standalone version of Cycles X for baking ambient occlusion as well as lighting (for lightmaps), but I haven’t found much information on how to do that.

I’ve set up everything for a normal scene render, which is working just fine. For baking, I also tell the bake manager which object it should use:

That on its own just results in an image with a single color, so I’m assuming other steps are required. An earlier version of Cycles used to have a “bake” method in the bake manager, but that was removed in an update and I don’t know how you would set it up now.
I also don’t know how I would specify the lightmap UV data for the objects when I’m baking lighting.

Any advice? I just need some hints on what to look for, I haven’t found much in the source code.