Skip to main content
POST
/
v1
/
translate
JavaScript
import Spitch from 'spitch';

const client = new Spitch({
  apiKey: 'My API Key',
});

const translation = await client.text.translate({ source: 'yo', target: 'yo' });

console.log(translation.request_id);
{
  "request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "text": "<string>",
  "due_date": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Translation task model.

Defines parameters for text translation between languages, including source/target languages, model selection, and optional custom instructions.

source
enum<string>
required
Available options:
yo,
en,
ha,
ig,
am
target
enum<string>
required
Available options:
yo,
en,
ha,
ig,
am
text
string | null
default:""
model
enum<string>
default:auto
Available options:
human,
auto
file_id
string<uuid> | null
instructions
string | null

Response

Successful Response

Translation result model.

Attributes: request_id (UUID): Unique ID for this request. text: translated text. due_date: used when model is human. the date you can expect the translation to be delivered

request_id
string<uuid>
required
text
string
required
due_date
string<date-time> | null