How can I create a plugin to integrate my own machine translation system into the trados?

I want to write a plugin tin order to call my own machine translation system when I want to  translate sentences in trados.

could anyone tell me which API should I use?