---
title: Translate text
---

# Translate text
POST *https://api.turing.sh/text/translate*

## Parameters


- **text**
  - Type: string
  - Required: true
  - Description: Text to translate

- **from**
  - Type: string
  - Required: false
  - Description: Language code to translate from
  - Default: auto

- **to**
  - Type: string
  - Required: true
  - Description: Language code to translate to

- **ai**
  - Type: string
  - Required: true
  - Options: google, microsoft
  - Default: google

## Response

<Error>Response not defined yet</Error>


## Examples

<CodeGroup title="Translate text example">
  ```typescript
  import axios from "axios";
  (async () => {
    let response = await axios({
      method: "post",
      url: 'https://api.turing.sh/text/translate',
      headers: {
        "Content-Type": "application/json",
        Authorization: "Bearer YOUR_API_KEY",
        "x-captcha-token": "Captcha key"
      },
      data: {
  "text": "string",
  "from": "auto",
  "to": "string",
  "ai": "google"
},
    })
  })();
  ```
  ```python
  import requests
  import json
  response = requests.post(
    "https://api.turing.sh/text/translate",
    headers={
      "Content-Type": "application/json",
      "Authorization": "Bearer YOUR_API_KEY",
      "x-captcha-token": "Captcha key"
    },
    data=json.dumps({
  "text": "string",
  "from": "auto",
  "to": "string",
  "ai": "google"
}),
  )
  ```
</CodeGroup>