Translate text

POSThttps://api-staging.talksign.co/v1/speech-to-speech

Translates text between spoken languages. Billed at $0.33 / min of spoken length.

Headers

AuthorizationstringRequired

Bearer authentication of the form Bearer <token>, where the token is your API key (sk-live-… or sk-test-…).

Idempotency-KeystringOptional

Any unique string (up to 255 characters). A retry with the same key and body returns the first answer and is never charged twice. See Idempotency.

Request body

This endpoint expects an object.

textstringRequired

Up to 5,000 characters.

toLangstringRequired

ISO 639-1 target, e.g. es.

fromLangstringOptional

ISO 639-1 source. Detected when left out.

modelenumOptional

Defaults to google-translate.

google-translate

Response

Returns data:

translatedTextstringOptional

The translation.

fromLangstringOptional

Source language, or null.

toLangstringOptional

Target language.

Errors

StatusNameWhen
400Bad requestA required field is missing or a value is not allowed (invalid_request).
401UnauthorizedThe API key is missing or not valid (invalid_api_key).
402Payment requiredYour wallet does not have enough funds for this request (insufficient_credits). Nothing is charged.
413Payload too largetext is longer than 5,000 characters (text_too_long). Nothing is charged.
429Too many requestsYou hit a rate limit. Wait for Retry-After seconds. See Rate limits.

Example request

curl https://api-staging.talksign.co/v1/speech-to-speech \
  -H "Authorization: Bearer $TALKSIGN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Where is the station?",
    "toLang": "es"
  }'

Example response

200
Response
{
  "success": true,
  "data": {
    "translatedText": "¿Dónde está la estación?",
    "fromLang": "en",
    "toLang": "es"
  }
}

Read more in the full reference: Speech to speech.

Was this page helpful?
Esc