== Problem ==
Currently content translation exposes its own stand-alone API at [https://cxserver.wikimedia.org/](https://cxserver.wikimedia.org/v1/?doc). The routes for this API are defined in [this file](https://github.com/wikimedia/mediawiki-services-cxserver/blob/master/routes/v1.js):
```
GET /page/:language/:title
POST /mt/:from/:to/:provider?
GET /dictionary/:word/:from/:to/:provider?
GET /list/:tool/:from?/:to?
GET /languagepairs
GET /version
```
This domain is proxied through the Parsoid Varnish cluster, but no caching or other features are used. We are in the process of moving services off the Parsoid Varnishes, and @bblack in particular would like to eventually decommission those servers.
It might also be worth publicizing generally useful translation and dictionary end points more widely. One option of doing so would be to set up RESTBase API end points for machine translations and dictionaries. This would present translation and dictionary facilities as part of the wider [REST content API documentation](https://en.wikipedia.org/api/rest_v1/?doc). Going through RESTBase would also provide detailed request metrics, error logging, and potentially caching / storage, rate limiting and access controls.
== Public API ==
As CXServer does not depend on the domain the requests originate from (and its API is also decoupled from domains), the public translation API endpoints will be hosted on the global `wikimedia.org` domain. Concretely, these are the endpoints that are going to be exposed under the `/translate/` prefix:
- `POST /machine/{from}/{to}{/provider}`
- `GET /dictionary/{word}/{from}/{to}{/provider}`
- `GET /list/tool/{tool}`
- `GET /list/pair/{from}/{to}`
- `GET /list/languagepairs`
== Action Items ==
[x] @KartikMistry : Implement the changes in the API on the CXServer side (add `/list/pair/{from}/{to}` and `/list/languagepairs` - T162576
[] @mobrovac : Create the public API specification - [PR #796](https://github.com/wikimedia/restbase/pull/796)
[] @KartikMistry : Change the extension to use the new RB-provided public API instead of CXServer - T163203