# General Translation Platform: Traducir contenido
URL: https://generaltranslation.com/es/docs/platform/openapi/reference/translation/translate-content.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Traduce cadenas, contenido estructurado o documentos Markdown y MDX. Requiere project:translations:generate; también se aceptan las claves de API de desarrollo existentes.

{/* Este archivo se ha generado con Fumadocs. No lo edites directamente. Para realizar cambios, vuelve a ejecutar el comando de generación. */}

## Endpoint

`POST https://api.gtx.dev/v2/projects/{projectId}/translate`

**Operation ID:** `translateContent`

**Tags:** `Translation`

**Summary:** Translate content

Translate strings, structured content, or Markdown and MDX documents. Requires `project:translations:generate`; existing development API keys are also accepted.

Authentication: required. Send an API key in the `Authorization: Bearer <key>` header when authenticating.

### Parameters

- `projectId` (path, string, required)
- `gt-api-version` (header, "2026-10-08.v1", required): API contract version. Must be `2026-10-08.v1` or later; requests without it or with an older version return 400.

### Request body (required)

Body (`application/json`, object):
- `requests` (object, required)
  - `<key>` (object, dynamic key)
    - `source` (object)
    - `metadata` (object) Default: `{"dataFormat":"STRING","actionType":"fast"}`.
      - `id` (string)
      - `hash` (string)
      - `context` (string)
      - `maxChars` (number)
      - `dataFormat` ("JSX" | "ICU" | "I18NEXT" | "STRING")
      - `fileFormat` ("MD" | "MDX"): Marks the source as a whole document in this file format. Send the document as a string.
      - `actionType` ("fast" | "standard") Default: `"fast"`.
      - `sourceCode` (object)
        - `<key>` (object[], dynamic key)
- `targetLocale` (string, required)
- `sourceLocale` (string, required)
- `metadata` (object, required)
  - `modelProvider` ("ANTHROPIC" | "OPENAI" | "XAI" | "GOOGLE" | "HYPERCLOVA")

### Responses

**200**: Translation results: one result per request key in `translations`. A request that could not be translated has `success: false` with its `error` and `code`, so inspect every result.
Response body (`application/json`, object):
- `translations` (object, required)
  - `<key>` (object | object, dynamic key)
- `generated` (boolean, required): Whether this request ran translation; false when every result came from cache or was rejected before translation.

**400**: The request is malformed or failed validation.
Response body (`application/json`, object):
- `error` (string, required)

Response body (`text/html`, string):

**401**: Authentication is missing or invalid.
Response body (`application/json`, object):
- `error` (string, required)

Response body (`text/html`, string):

**402**: The organization's billing account is blocked, or its plan usage limit, monthly spend limit, or credit balance does not cover this request.
Response body (`application/json`, object):
- `error` (string, required)

Response body (`text/html`, string):

**403**: The caller is authenticated but not allowed to perform this operation or access the requested resource.
Response body (`application/json`, object):
- `error` (string, required)

Response body (`text/html`, string):

**404**: The requested resource was not found.
Response body (`application/json`, object):
- `error` (string, required)

Response body (`text/html`, string):

**413**: The request, or the data it would return, exceeds a size or item limit.
Response body (`application/json`, object):
- `error` (string, required)

Response body (`text/html`, string):

**415**: The request body's Content-Type is missing or not supported. Send the body as application/json.
Response body (`application/json`, object):
- `error` (string, required)

Response body (`text/html`, string):

**429**: Too many requests. The rate limit was exceeded.
Response body (`application/json`, object):
- `error` (string, required)

Response body (`text/html`, string):

**500**: An unexpected server error occurred.
Response body (`application/json`, object):
- `error` (string, required)

Response body (`text/html`, string):

Complete OpenAPI 3.1 specification: https://generaltranslation.com/openapi.yaml

OpenAPI schema: [openapi.json](https://generaltranslation.com/openapi.json)

## Sitemap

See the full [sitemap](https://generaltranslation.com/sitemap.md) for all pages.
