Keiki is not interchangeable with Kikai in most of the cases.
They have different meanings and different usages.
For example:
Byouki wo keiki ni undou wo hajimeta. (You can't say 'kikai')
Kono kikai ni takusan benkyo shite okou. (You can't say 'keiki')
'Keiki' is a reason to start something new.
You may begin to consider your health when you got sick. Thjs is 'keiki'.
'Kikai' is favorable conditions to do something.
And it may happen repeatedly.
You visit England, and study English utilizing the opportunity. In this case you should use 'kikai', because you would visit again, and utilize the opportunity again.
But if you want to say, because you visited England, you started learning English, you should use 'keiki'.
And keiki is only once. Kikai can repeat many times.