C++

All object instances (autopilots, windows, controllers and operations) are permanent until you reset KSP, so you can cache them and reuse them for multiple flights. This may be useful if your program switches between vessels during flight. When you enter the flight scene or switch between vessels, it is recommended to check whether the API is ready before you call other operations. Otherwise, the API may throw an exception.

Note: Credit goes to MechJeb2 wiki for most of the method description.

Autopilots

Windows

Controllers