I can open the Audio MIDI Setup app programatically like this:
NSWorkspace.shared.launchApplication("Audio MIDI Setup")
But how can I open the Bluetooth Configuration window inside the app?
I've seen other apps having a menu item which opens up this dialog directly.

Apple provides a window controller for developers to use called
CABTLEMIDIWindowController. The documentation is pretty sparse, but there is a bit more information in the code comments:Usage is surprisingly straightforward:
NOTE:
Your app must have bluetooth configured and approved otherwise the window controller will appear like this:
You must select Bluetooth from the App Sandbox settings and add the
NSBluetoothAlwaysUsageDescriptionkey to your Info.plist:FULL EXAMPLE:
BONUS:
Found this while snooping around. Saves users a lot of clicks by opening System Preferences -> Security & Privacy -> Privacy -> Bluetooth: