canonical: https://jentic.com/apis/cloud.google.com/cloud-translation

# Google Cloud Translation API

Google Cloud Translation API v3 translates text and documents between more than 130 languages, detects the source language of input strings, and lists every language supported by the service. It exposes adaptive machine translation, batch translation for large jobs, romanisation of non-Latin scripts, and document translation that preserves layout for formats such as PDF and DOCX. The API runs under a Google Cloud project and is region-aware via the locationId path segment, so traffic can be pinned to a specific region for compliance.

## For AI agents

Translate text and documents between 130+ languages, detect input language, and run batch or adaptive translations through Google Cloud projects.

## Scope

Does not handle speech-to-text, text-to-speech, or general-purpose LLM generation - use for text and document translation between languages only.

## Capabilities

- Translate text strings between supported language pairs with optional glossary and model overrides
- Detect the source language of an input string before translation
- List every language supported by the service for a given target locale
- Translate document files such as PDF and DOCX while preserving layout
- Run batch translation jobs for large volumes of text or documents stored in Cloud Storage
- Romanise non-Latin script text into Latin characters for transliteration use cases
- Apply adaptive machine translation tuned to a customer dataset for domain-specific output

## Use cases

### Localising User-Generated Content

Translate forum posts, reviews, and support tickets on the fly so an English-speaking team can read content submitted in any of 130+ languages. The translateText endpoint accepts plain text or HTML, returns the detected source language, and can be wired into a moderation pipeline in under an hour. Quotas scale per project, so a small SaaS can ship translation without provisioning infrastructure.

Example prompt: Translate a 200-word product review from auto-detected source language to en-US using translateText and return the detected source language code

### Document Translation With Layout Preserved

Translate PDFs, DOCX files, and PPTX decks while keeping the original layout, fonts, and embedded images intact. The translateDocument endpoint accepts a base64 input or a Cloud Storage URI and returns the translated file, which removes the need to manually rebuild the document after translation. Useful for legal, regulatory, and sales-enablement teams that need translated artefacts that still look like the original.

Example prompt: Call translateDocument with a Cloud Storage PDF URI, source language es and target language en, and return the GCS URI of the translated PDF

### Batch Translation Pipelines

Translate large corpora of text or many documents in a single asynchronous job using batchTranslateText or batchTranslateDocument. The job reads input files from Cloud Storage, fans out across Google's translation backend, and writes output to a destination bucket, which is the standard pattern for catalogue localisation, knowledge-base translation, and corpus migrations. A single job can cover hundreds of thousands of segments without rate-limit babysitting.

Example prompt: Submit a batchTranslateText job that reads gs://input-bucket/strings.tsv, translates from en to fr/de/ja, and writes results to gs://output-bucket/

### Adaptive Translation With Custom Datasets

Use adaptiveMtTranslate with a customer-supplied parallel dataset to produce translations that match an organisation's tone, terminology, and product names. This is useful when generic NMT output mistranslates brand terms or industry jargon. The endpoint takes a dataset reference plus the input segments and returns translations adapted to the supplied examples without requiring full custom model training.

Example prompt: Call adaptiveMtTranslate with a dataset for medical terminology and translate a list of 20 clinical note snippets from en to es

### Agent-Driven Multilingual Workflows via Jentic

AI agents discover the Cloud Translation API through a single intent search on Jentic, load the input schema for the operation they need, and execute the call without writing OAuth boilerplate or copying spec snippets from Google's docs. Jentic isolates the OAuth token in its vault so the agent never handles raw Google Cloud credentials, which is essential for multi-tenant agent deployments. Integration time drops from a multi-day OAuth setup to a single search-load-execute call.

Example prompt: Search Jentic for 'translate text with google cloud', load the translateText operation, and execute it for the user-supplied string and target language

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/projects/{projectId}/locations/{locationId}:translateText` | Translate text between languages |
| POST | `/projects/{projectId}/locations/{locationId}:detectLanguage` | Detect source language of text |
| GET | `/projects/{projectId}/locations/{locationId}/supportedLanguages` | List supported languages |
| POST | `/projects/{projectId}/locations/{locationId}:translateDocument` | Translate a document file |
| POST | `/projects/{projectId}/locations/{locationId}:batchTranslateText` | Submit a batch text translation job |
| POST | `/projects/{projectId}/locations/{locationId}:adaptiveMtTranslate` | Adaptive translation with a dataset |
| POST | `/projects/{projectId}/locations/{locationId}:romanizeText` | Romanise non-Latin text |

## Key resources

- **translateText** — Translate plain text or HTML between supported language pairs
- **detectLanguage** — Identify the source language of an input string
- **supportedLanguages** — List every language code the service can translate to or from
- **translateDocument** — Translate document files while preserving layout
- **batchTranslate** — Asynchronous batch jobs for large text and document corpora
- **adaptiveMtTranslate** — Translation adapted to a customer dataset for domain-specific output
- **romanizeText** — Romanise non-Latin script text into Latin characters

## Why Jentic

- **Setup:** Wiring Google Cloud Translation by hand means running the OAuth 2.0 flow, refreshing access tokens, mapping its project-and-location-scoped translate endpoints, and handling retries yourself against translate.googleapis.com/v3. Through Jentic you install once, import the Cloud Translation API from the API Directory, store the OAuth credentials once, and your agent calls it.
- **Permission scoping:** Cloud Translation puts the project and location in the URL path (`/projects/{projectId}/locations/{locationId}`:...), so a rule can pin your agent to one project: it can translate text within that project and nothing else. You choose the operations it may call, so batch translation or adaptive translation are not included unless you add them.
- **Credential handling:** Your Google Cloud OAuth 2.0 client secret and refresh token are stored once, encrypted, by your own Jentic One instance, which injects a short-lived scoped access token per call. The raw Google credentials never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'translate text' or 'detect language', and Jentic returns the matching Cloud Translation operation with its input schema, so the agent calls the right endpoint without browsing Google's REST reference.

## Related APIs

- **Microsoft Translator** — Microsoft's translation service covering similar language pairs with its own dictionary lookup features.
- **Smartling** — Translation management platform that orchestrates human and machine translation workflows.
- **FunTranslations** — Novelty translation API for fictional languages and stylised translations rather than production localisation.

## FAQ

### What authentication does the Cloud Translation API use?

The Cloud Translation API uses OAuth 2.0 authorization-code flow with the scopes https://www.googleapis.com/auth/cloud-translation or https://www.googleapis.com/auth/cloud-platform. When called through Jentic, the OAuth token is held in your Jentic One instance and a scoped access token is issued per request, so the agent never sees the raw refresh token or client secret.

### Can I translate documents while keeping their formatting with this API?

Yes. The translateDocument endpoint accepts PDF, DOCX, PPTX, and XLSX inputs as base64 content or a Cloud Storage URI and returns the translated file with the original layout, fonts, and inline images preserved.

### What are the rate limits for the Cloud Translation API?

Google enforces per-project quotas measured in characters translated per minute and requests per minute. Default limits are typically 6,000,000 characters per minute and 6,000 requests per minute, and they can be raised through the Google Cloud Console quota request flow.

### How do I translate a piece of text with this API through Jentic?

Search Jentic for 'translate text with google cloud', load the translateText operation, then execute with sourceLanguageCode, targetLanguageCode, and contents populated. The call hits POST `/projects/{projectId}/locations/{locationId}`:translateText and returns the translated string plus the detected source language. Run pip install jentic to start.

### Is the Cloud Translation API free?

The first 500,000 characters per month are free under Google Cloud's standard tier. Beyond that, text translation is billed per character and document translation is billed per page, with adaptive translation priced separately. Pricing is set in the Google Cloud Translation pricing page.

### Does this API support batch translation of many files at once?

Yes. The batchTranslateText and batchTranslateDocument endpoints submit asynchronous long-running operations that read inputs from Cloud Storage and write results back to a destination bucket, which is the recommended path for jobs above a few thousand segments.

### Can I limit what my agent is allowed to do with the Cloud Translation API?

Yes. Because you run Jentic One yourself, your own rules decide which Cloud Translation operations and credentials the agent may use. Since the project and location live in the URL path (`/projects/{projectId}/locations/{locationId}`:...), a rule can pin the agent to a single Google Cloud project so it translates only within that project. You can also allow just translateText and detectLanguage while withholding heavier operations such as batchTranslateText, translateDocument, or adaptiveMtTranslate unless you explicitly grant them.
