OpenGL doesn't have any way to do this except sometimes via vendor specific extensions. Basically how OpenGL works is it creates the graphics context on whichever device the system hands it. So you can configure the GPU used by OpenGL on the system level but not at the application level.
FYI, setting `NvOptimusEnablement` and `AmdPowerXpressRequestHighPerformance` have been the canonical way on Windows, `__NV_PRIME_RENDER_OFFLOAD` + `__GLX_VENDOR_LIBRARY_NAME` on Linux. Though not an OpenGL feature per se, as you mentioned.
I believe if you plug your monitor into your motherboard then OpenGL will use your integrated graphics rather than your card. I think with Vulkan it doesn't matter what port you plug it in, it can coordinate it?
I remember this being a nice API in wgpu, being forced to specify settings through a builder, otherwise it would not compile. Forces you to think how you want this application to operate