Custom MT Rest API

Skip to first unread message

Yasmin Moslem

Nov 6, 2021, 10:25:37 AM11/6/21
to okapi-users

Please, is there an official way to add a custom MT engine, i.e. one internally developed with Flask or FastAPI?

As a workaround, I managed to do this by sort of hijacking the ModernMT's settings as it is the only one that allows a URL.

So it sends a GET request similar to this:

and expects a JSON response similar to this:
{ "status": 200, "data": { "translation": "some translation here" } }

In a quick test, this worked. However, as you can imagine, there is no way to customize this for adding credentials or other scenarios.

So I wonder if there is an official feature for achieving this. Thanks for your help!

Kind regards,

Yves Savourel

Nov 6, 2021, 10:52:24 AM11/6/21
to okapi-users

Hi Yasmin,


I’m afraid, currently the only way to add a standard MT connector to the framework is to create a class that implements IQuery or ITMQuery (which extends IQuery).

A workaround would be to use make your custom MT Rest AP match the calls of one of the existing connectors, just like you’ve illustrated below.



You received this message because you are subscribed to the Google Groups "okapi-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Yasmin Moslem

Nov 6, 2021, 3:18:01 PM11/6/21
to Yves Savourel, okapi-users
Hi Yves! Many thanks for your reply!--
Sent from my iPad
Reply all
Reply to author
0 new messages