← Peter Zou Translation · Internal API Reference

Trilingual Translation API — Key-Based Access

Chinese · English · Arabic, English-pivot, terminology-consistent. This is an internal service: every endpoint requires an API key issued per partner system (portal, SFDA registration, product catalogs, suppliers).

API key required One key per partner / system Revocable individually EN→AR · EN→ZH · ZH→AR · AR→ZH · ZH→EN · AR→EN
Contents: Quick StartKey ManagementEndpointsBatch APIErrorsLanguages & ModesQuality & TermsContact
Status: LIVE. Verified 2026-09-20 — service online, translation engine (DeepSeek primary + OpenAI automatic failover) healthy. All endpoints require X-API-Key.

Quick Start

All calls carry your issued key in the X-API-Key header:

curl -X POST https://translate.peterzou.com/v1/translate/batch \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sourceLang":"en","targetLang":"ar","mode":"product","items":[{"id":"p1","text":"White gold-bead midi dress with embroidery"}]}'

Key Management

How keys work

Endpoints

EndpointAuthPurpose
GET /healthznoneService health check
POST /v1/translate/batchX-API-KeyBatch translation ≤50 items — production use
POST /v1/chat/completionsX-API-KeyOpenAI-compatible chat endpoint (model=translate-v1)
POST /api/translateX-API-KeySingle-text endpoint (≤6000 chars) — also powers the website preview tool

Batch API (production)

POST/v1/translate/batchX-API-Key required
Translate up to 50 items per call. Item-level ok/error results; the overall call returns HTTP 200 even when some items fail.
{
  "sourceLang": "en",       // en | zh | ar | auto
  "targetLang": "ar",       // en | zh | ar
  "mode":       "product",   // product | contract | marketing | general | medical
  "items": [
    { "id": "p1", "text": "Embroidered chiffon wedding dress" },
    { "id": "p2", "text": "White satin midi dress with gold beads" }
  ]
}

Response:

{
  "results": [
    { "id": "p1", "ok": true,  "translation": "فستان زفاف شيفون مطرز" },
    { "id": "p2", "ok": false, "error": { "code": "empty_text", "message": "text is empty" } }
  ],
  "meta": { "latencyMs": 1345 }
}

Error Codes

HTTPCodeWhen
400invalid_requestMissing/invalid fields, unsupported targetLang, invalid JSON, >50 items
400empty_textAn item has empty text
401unauthorizedMissing or invalid X-API-Key — request a key from [email protected]
413text_too_longText exceeds the length limit (preview 6000)
503upstream_unavailableTranslation engine temporarily unavailable (auto-failover already tried; retry shortly)

Languages & Modes

DirectionRouteNotes
EN → ARdirectNative Saudi copywriting register, Arabic-Indic numerals (٢٢٠)
EN → ZHdirectSimplified Chinese
ZH → ARvia EN pivotEnglish middle state returned as en_middle for verification
AR → EN / AR → ZHdirect / pivotArabic source supported
ZH → ENdirectFor Chinese suppliers exporting to the Gulf

Modes: product (e-commerce/catalog), contract (legal register), marketing, general, medical (SFDA/PIL/labeling — via preview endpoint, DRAFT until reviewed).

Quality, Terminology & Audit

Contact

Request an API key or a medical/SFDA pilot: [email protected] — English, 中文, العربية all welcome. Please state your system name and expected monthly volume.
Peter Zou Translation · translate.peterzou.com · Riyadh · ZH / EN / AR
API reference v2.0 · 2026-09-20 · Key-based internal access