---
title: "Auto-translate single text"
method: POST
path: "/api/v1/auto-translate"
tags: ["Auto-translation"]
---

# Auto-translate single text

`POST /api/v1/auto-translate`

## Request

- Base URL: `https://api.simplelocalize.io`
- URL: `https://api.simplelocalize.io/api/v1/auto-translate`
- Auth: API key in header `X-SimpleLocalize-Token`
- TypeScript: <https://skmtc.dev/simplelocalize/apis/simplelocalize-api/docs/api/v1/auto-translate/post.ts> (a function with typed inputs; its response is checked against the schema)

Auto-translate single text for a project

## Headers

- `X-SimpleLocalize-Token` string, required

## Request body

- AutoTranslateSingleTextRequest
  - `targetLanguage` string, required: Provider target language key
  - `targetProjectLanguage` string: Project target language key (optional). It's required to load additional information about the target language (e.g. DeepL glossary).
  - `deeplFormality` 'default, more, less': DeepL formality
  - `description` string: Description that will be used as a context for translation. It's useful for better translation quality.
  - `translationProvider` 'GOOGLE_TRANSLATE' | 'DEEPL' | 'OPEN_AI' | 'OPEN_ROUTER' | 'CUSTOM_AI' | 'ANTHROPIC' | 'GEMINI', required: Provider for auto-translation
  - `sourceText` string, required: Source text to translate
  - `sourceProjectLanguage` string: Project source language key (optional). It's required to load additional information about the source language (e.g. DeepL glossary).
  - `sourceLanguage` string: Provider source language key (optional). If not provided, the source language will be detected automatically.

## Response `200`

OK

- object
  - `msg` string
  - `status` integer
  - `data` ApiSingleTranslateResponse
    - `translatedText` string

## Other responses

- `400`: Bad Request
- `402`: Payment Required
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `429`: Too Many Requests
- `500`: Internal Server Error

## Changes

- **2026-11-07** `67a25a25863a`: 4 info
  - added the new `ANTHROPIC` enum value to the request property `translationProvider`
  - added the new `CUSTOM_AI` enum value to the request property `translationProvider`
  - added the new `GEMINI` enum value to the request property `translationProvider`
  - added the new `OPEN_ROUTER` enum value to the request property `translationProvider`
- **2025-11-12** `0329534cd557`: 4 breaking, 17 info
  - removed the enum value `EXTERNAL_API` of the request property `translationProvider`
  - removed the enum value `SYSTRAN` of the request property `translationProvider`
  - the `sourceText` request property's minLength was increased from `0` to `1`
  - the `targetLanguage` request property's minLength was increased from `0` to `1`
  - …17 more
- **2025-04-19** `5475c7163be9`: 7 info
  - added the optional property `code` to the response with the `400` status
  - added the optional property `code` to the response with the `402` status
  - added the optional property `code` to the response with the `403` status
  - added the optional property `code` to the response with the `404` status
  - …3 more
- **2024-05-06** `26bd80894ce2`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/simplelocalize/apis/simplelocalize-api/changes/api/v1/auto-translate/post.md)

---

[API](https://skmtc.dev/simplelocalize/apis/simplelocalize-api.md) - [All operations](https://skmtc.dev/simplelocalize/apis/simplelocalize-api/llms.txt) - [OpenAPI document](https://skmtc.dev/simplelocalize/apis/simplelocalize-api/revisions/67a25a25863a?raw)
