Use command api to request an API frontend when opening a SSH exec channel session. See [API] for packets format.
api
Wiki: API