Browse API documentation
Apply for API access

POST /v1/translate

Translate Persian to English as a separate layer.

The translation endpoint returns English for the submitted Persian passage while preserving the original input alongside it. Translation stays separate from reading marks and Pinglish so your product controls when meaning appears.

POSThttps://api.vowelmarks.com/v1/translate

Updated September 15, 2026 · API version 1

Request

Send one text field and no unknown fields. The input may contain mixed Persian and English, but it must include at least one Persian-script letter and may contain at most 6,000 Unicode code points. The complete serialized JSON body must be at most 32 KiB (32,768 bytes).

FieldTypeRequiredDescription
textstringYesPersian or mixed Persian-English text containing at least one Persian-script letter.
const response = await fetch("https://api.vowelmarks.com/v1/translate", {
  method: "POST",
  headers: {
    authorization: "Bearer " + process.env.VOWELMARKS_API_KEY,
    "content-type": "application/json",
    "idempotency-key": jobId,
  },
  body: JSON.stringify({ text: "من فارسی می‌خوانم" }),
});

Response

{
  "request_id": "95b…",
  "engine_version": "vowelmarks-api-v1.2026-08-10",
  "original": "من فارسی می‌خوانم",
  "translation": "I read Persian.",
  "source_language": "fa",
  "target_language": "en",
  "usage": {
    "meter": "text", "input_code_points": 17,
    "multiplier": 2, "units": 34,
    "additional_units": 0, "cache_hit": false
  }
}

Metering and failure behavior

Translation charges two text units for each submitted Unicode code point. The returned English text and response metadata are unmetered. A successful organization-isolated cache hit still charges the normal 2× amount; validation, provider, and failed-generation responses charge nothing.

  • Keep original visible if your product is meant to support Persian reading.
  • Do not parse undocumented provider or model details; they are deliberately absent.
  • Use request_id for support and Idempotency-Key for retries.
  • A retryable 503 means no configured path produced a valid result, not that a lower-quality translation was substituted.