Authenticating the Translate API
1. To issue a short-lived access token, run this command:
curl -X POST -F 'email=<your-email>' -F 'password=<your password>' \
2. A successful request will return an encoded access token as plain text in the response body. Save the valid token and send future requests with this valid token in the X-SINITIC-TOKEN header:
"company_id": "<default company id>",
"token": "<yourshort-lived token>",
"user_id": "<your user id>"
3. Short-lived tokens expire after 30 minutes. You can switch a short-lived token to a long-lived token with the following command:
curl -X POST -H 'X-SINITIC-TOKEN: <your short-lived token>' \
4. A successful request will return an encoded access token as plain text in the response body:
"token": "<your long-lived token"
Note: If you have lost your long-lived token you can issue a new token or obtain the old token as follows:
curl -X GET -H 'X-SINITIC-TOKEN: <your short-lived token>' \
Using the Translate API
You can utilize trained translation models via the Translate API with the following steps:
1. In order to to send the correct POST request you'll need to obtain the model ID.
2. Send a POST request to the following URL and set a valid access token in X-SINITIC-TOKEN header: https://api.staging.sinitic.ai/amt/model/<model_id>/inference
3. The POST request should be done with a JSON body in the following format:
"How are you?"
The response body is a JSON array with results for each text in the input array.
"source_text": "how are you?",
"target_text": "Hur mår du?"