Translate text

Returns JSON with your text translated between about 100 languages by Meta M2M100 1.2B on Workers AI, with the source and target languages used.

Use this when you need to translate text, a language translation of a sentence or paragraph between two languages.

Do not use for formatting that must be preserved, certified or legal translation, or speech (transcribe first).

Price: 0.012 USDC per call (x402, eip155:8453). Typical response time: 5000 ms (p95).

Call it over HTTP (x402)

POST https://x402-gateway.blackwoodstate8.workers.dev/v1/translate. A request without payment gets 402 Payment Required with the PAYMENT-REQUIRED header; any x402 client signs an EIP-3009 authorization and retries with PAYMENT-SIGNATURE (or X-PAYMENT). Invalid input is answered with 400 and not charged.

curl -i -X POST https://x402-gateway.blackwoodstate8.workers.dev/v1/translate -H 'content-type: application/json' -d '{"text":"Pay only for the requests you make.","from":"en","to":"pt"}'
Pay to0x60484D4842De2cd76B2175fcb82d680e7a2DFf30
Asset0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 (USDC)
Amount12000 atomic units (0.012 USDC)
Authorization window60 s

Call it over MCP

Streamable HTTP at https://x402-gateway.blackwoodstate8.workers.dev/mcp, tool blackwood_text_translate. Payment goes in _meta["x402/payment"]; without it the tool returns the payment requirements.

Input

FieldTypeMeaning
textstringText to translate, e.g. Pay only for the requests you make (up to 2000 characters)
tostringTarget language as an ISO 639-1 code, e.g. es, fr, pt, de, ja, zh
from (optional)stringSource language as an ISO 639-1 code (default en)

Example:

{
  "text": "Pay only for the requests you make.",
  "from": "en",
  "to": "pt"
}

Output

Real example:

{
  "translatedText": "Pague apenas pelos pedidos que você faz.",
  "from": "en",
  "to": "pt",
  "model": "@cf/meta/m2m100-1.2b"
}
JSON Schema
{
  "type": "object",
  "properties": {
    "translatedText": {
      "type": "string"
    },
    "from": {
      "type": "string"
    },
    "to": {
      "type": "string"
    },
    "model": {
      "type": "string"
    }
  },
  "required": [
    "translatedText",
    "from",
    "to",
    "model"
  ],
  "additionalProperties": false
}

More

Free schema and example: GET https://x402-gateway.blackwoodstate8.workers.dev/v1/translate. OpenAPI 3.1 · llms.txt · All services