---
title: "TRANSLATION — POST {text, target} and get the translation plus the detected source language"
method: POST
path: "/api/translate-text"
tags: ["AI Utilities"]
---

# TRANSLATION — POST {text, target} and get the translation plus the detected source language

`POST /api/translate-text`

## Request

- Base URL: `https://api.webbersites.com`
- URL: `https://api.webbersites.com/api/translate-text`
- Auth: API key in header `X-PAYMENT`

TRANSLATION — POST {text, target} and get the translation plus the detected source language. Any language pair; target as a name or ISO code ('spanish', 'de', 'ja'). Up to 8,000 chars per call; line breaks and markdown preserved; code, URLs, and proper names left alone. Optional {source} to pin the source language, {formality}: formal|informal. Fast cheap LLM under the hood; the x402 payment IS the auth.

Price: $0.01 per call, paid in USDC via the x402 protocol (see the x402 security scheme).

## Request body

- object
  - `text` string, required: The text to translate, up to 8,000 characters
  - `target` string, required: Target language — name or ISO code ('spanish', 'de', 'ja')
  - `source` string: Optional source language; auto-detected when omitted
  - `formality` string: formal or informal register (optional)

## Response `200`

Success

- object
  - `translation` string
  - `target` string
  - `source_language` string: detected (or provided) source language
  - `model` string
  - `usage` object

## Other responses

- `402`: Payment required — the response body lists accepted payment methods (amount, asset, network, pay-to address). Retry the request with a signed X-PAYMENT header.

---

[API](https://skmtc.dev/webbersites/apis/webbersites-x402-data-api.md) · [All operations](https://skmtc.dev/webbersites/apis/webbersites-x402-data-api/llms.txt) · [OpenAPI document](https://skmtc.dev/webbersites/apis/webbersites-x402-data-api/revisions/c14a76c67a94?raw)
