Documentación

API Reference

Public REST API for image translation. Authenticate with a Bearer token, send a base64 image, get the translated image back.

Translate the text in an image, preserving the original layout, and render it back into the image.

Quick start

Get an API key

Generate one from the API Keys page.

Make your first call

curl -X POST https://api.imagetranslate.ai/translate/image \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "imageBase64": "iVBORw0KGgoAAAANSUhEUgAA...",
    "sourceLanguage": "ja",
    "targetLanguage": "en",
    "mode": "general",
    "translator": "Grok"
  }'

Use the response

response.resultImage is a base64-encoded PNG with a data:image/png;base64, prefix — not an HTTP URL. Render it directly in the browser with <img src={response.resultImage} />, or save to disk by stripping the prefix and base64-decoding.

Authentication

All requests must include your API key in the Authorization header as a Bearer token:

Authorization: Bearer YOUR_KEY

Keys are 32-byte random tokens prefixed with sk_imagetranslate_. Treat them like passwords — store them in a server-side secret manager, never commit them to source control, never expose them in client-side code.

Idempotency

If you retry a request after a network timeout, send the same Idempotency-Key header to avoid double-charging credits:

Idempotency-Key: <your-uuid>
  • First call with a given key: processed normally.
  • Subsequent call with the same key (per API key): returns 409 Conflict and the original recordId. The retry does not consume credit.
  • Different keys = different calls.

Generate the key on the client (UUIDv4 is fine). Without it, retries each consume a fresh credit and run Torii again.

Translate Image

Synchronous endpoint. Returns the translated image base64-encoded (with a data:image/png;base64, prefix).

Base URL

https://api.imagetranslate.ai

Request body

FieldTypeRequiredDescription
imageBase64stringyesBase64-encoded image. Accepts raw base64 or full data URL (e.g. data:image/png;base64,...). Max 20MB decoded.
sourceLanguagestringyesISO code, or auto for detection. See Language values.
targetLanguagestringyesISO code. See Language values.
modestringnoTranslation context. Default general. See Mode values.
translatorstringnoAI model. Default Grok. See Translator values.
customPromptstringnoExtra instructions for the translator. Max 1000 characters.

Response

FieldTypeDescription
successbooleantrue if the translation succeeded.
recordIdstringUnique log ID for this call. Save for support reference.
resultImagestringTranslated image, base64-encoded with a data:image/png;base64, prefix. Not an HTTP URL — render directly with <img src={...} /> or strip the prefix and base64-decode to save.
remainingCreditnumberAdvanced credit balance after this call.

Examples

curl -X POST https://api.imagetranslate.ai/translate/image \
  -H "Authorization: Bearer $IMAGETRANSLATE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "imageBase64": "YOUR_BASE64_IMAGE",
    "sourceLanguage": "ja",
    "targetLanguage": "en",
    "mode": "general",
    "translator": "Grok"
  }'

Example response

{
  "success": true,
  "recordId": "Z3l4abc...",
  "resultImage": "data:image/png;base64,iVBORw0KGgoAAAANSU...",
  "remainingCredit": 9990
}

Error codes

StatusMeaning
400Invalid request body or imageBase64 is not valid base64.
401Missing or invalid API key. Generate one from the API Keys page.
402Insufficient advanced credits. Top up via the pricing page. The call did not consume credit.
403Account plan does not include API access. Upgrade to Professional or above on the pricing page.
409Idempotency-Key already used. Returns { "error": "idempotency_replay", "recordId": "<id>" }. Credit was not charged.
413Image exceeds 20MB after base64 decoding. Compress or downscale.
422Request body failed validation (missing/invalid field). Body contains a detail array with the error location.
429Rate limit exceeded for your plan. No credit charged.
500Translation failed. Credit was automatically refunded.

Error response format

  • 4xx / 500: { "detail": "<message>" }
  • 422: { "detail": [{ "loc": [...], "msg": "...", "type": "..." }] }
  • 409: { "error": "idempotency_replay", "recordId": "<id>", "message": "..." }

Rate limits

Per-key per-minute limits based on your account plan.

PlanLimit
Freenot eligible
Starternot eligible
Professional60 req/min
Enterprise300 req/min

Need a higher limit? Email [email protected].

Pricing

10 advanced credits per translation call. See pricing for plan details and credit packages.

Appendix

Language values

sourceLanguage accepts an ISO 639-1 / BCP-47 code, or auto for automatic detection. targetLanguage accepts the same codes (no auto).

Common codes:

CodeLanguageCodeLanguage
autoAuto-detect (source only)ptPortuguese
enEnglishruRussian
zhChinesearArabic
zh-cnSimplified ChinesehiHindi
zh-twTraditional ChinesethThai
jaJapaneseviVietnamese
koKoreanidIndonesian
esSpanishtrTurkish
frFrenchitItalian
deGermannlDutch
Full list — 130+ languages by region

East Asia

CodeLanguage
zhChinese
zh-cnSimplified Chinese
zh-twTraditional Chinese
jaJapanese
koKorean
mnMongolian
jvJavanese
suSundanese

Southeast Asia

CodeLanguage
viVietnamese
thThai
idIndonesian
msMalay
myBurmese
kmKhmer
loLao
filFilipino
cebCebuano
iloIloko

South Asia

CodeLanguageCodeLanguage
hiHindineNepali
bnBengalisiSinhala
urUrduasAssamese
taTamilbhoBhojpuri
teTelugudvDivehi
mlMalayalamdoiDogri
guGujaratigomKonkani
knKannadamaiMaithili
mrMarathilusMizo
orOdiapaPunjabi
saSanskritsdSindhi

Africa

CodeLanguageCodeLanguage
amAmharickriKrio
swSwahililnLingala
haHausansoNorthern Sotho
yoYorubaomOromo
zuZulustSesotho
xhXhosasnShona
afAfrikaanstiTigrinya
mgMalagasytsTsonga
soSomaliakTwi
bmBambaraeeEwe
nyChichewalgGanda
igIgborwKinyarwanda

Europe

CodeLanguageCodeLanguage
frFrenchltLithuanian
deGermanlvLatvian
esSpanishetEstonian
itItalianisIcelandic
ruRussiansqAlbanian
plPolishhyArmenian
ukUkrainianazAzerbaijani
nlDutcheuBasque
ptPortuguesebeBelarusian
elGreekbsBosnian
csCzechcaCatalan
huHungariancoCorsican
svSwedishfyFrisian
daDanishglGalician
fiFinnishkaGeorgian
noNorwegiankkKazakh
roRomaniankyKyrgyz
bgBulgarianlbLuxembourgish
hrCroatianmkMacedonian
skSlovakmtMaltese
slSloveniansrSerbian
tgTajikttTatar
tkTurkmenugUyghur
uzUzbek

Middle East

CodeLanguage
arArabic
faPersian
trTurkish
heHebrew
kuKurdish
ckbSorani
psPashto

Americas & Oceania

CodeLanguage
ayAymara
gnGuarani
htHaitian Creole
hawHawaiian
quQuechua
smSamoan
miMaori

Others

CodeLanguage
eoEsperanto
laLatin
cyWelsh
gaIrish
gdScots Gaelic
hmnHmong
yiYiddish

Mode values

The mode field tunes the rendering style for different content types. Pick the one that best matches your image.

ValueDescription
general (default)Default translation without mode-specific styling.
mangaPreserving the original text layout with text strokes.
e-commercePreserving the original text layout without text strokes.
light-novelOverlays translated text on the image.

Translator values

The translator field selects which AI model performs the translation. All cost 10 credits per call.

  • Grok (default)
  • Gemini
  • Deepseek
  • ChatGPT
  • Claude

Get started

Ready to integrate? Create your first API key →

En esta página