Everything you need to integrate DILO into your application. Choose your language and get started in minutes.
npm install @dilo/sdk1import { Dilo } from '@dilo/sdk';23const dilo = new Dilo({4 apiKey: process.env.DILO_API_KEY,5});67const result = await dilo.translate({8 text: "What's up?",9 targetLanguage: "es",10 locale: "mx", // Mexican Spanish11 tone: "casual",12 vulgarity: "none",13});1415console.log(result.best);16// Output: "¿Qué onda?"
All API requests require an API key passed in the Authorization header.
/v1/translateTranslate text with cultural context/v1/languagesList all supported languages and locales/v1/usageGet current usage and billing info| Parameter | Type | Required | Description |
|---|---|---|---|
| text | string | Required | The text to translate (max 2,000 chars). Billed per 200 chars* |
| targetLanguage | string | Required | Target language code (see Target Languages below)esptfrdeitjakozharhirunlpltrsv |
| locale | string | Optional | Regional dialect (see Locales section below) |
| tone | enum | Optional | Formality levelcasualneutralformal |
| vulgarity | enum | Optional | Profanity levelnonemildfull |
| relationship | enum | Optional | Speaker relationshipstrangercolleaguefriendpartnerrival |
| familiarForm | boolean | Optional | Use familiar 'you' (tú/vos, tu, du, ты) instead of formal (usted, vous, Sie, вы). See T-V Distinction below. |
| stream | boolean | Optional | Enable streaming response |
Supported values for targetLanguage
esptfrdeitjakozharhirunlpltrsvOptional locale for regional dialect. First locale is default if not specified.
esmxarcoesclptbrptfrfrcabededeatchititchjajpkokrzhcntwararegaefamiliarForm)Many languages distinguish between familiar and formal "you". Set familiarForm: true to use the familiar form. The specific variant (e.g., tú vs vos) is determined by locale.
estú (most regions) vs vos (Argentina, Uruguay, Central America) — set by locale
frvous doubles as plural; tu for close relationships
deSie always capitalized; du for friends/family
ptvocê is standard in Brazil; tu in Portugal
itLei takes 3rd person verbs; tu for peers
ruвы also plural; ты for intimates
nlu increasingly rare; jij standard
plPan (m) / Pani (f) for strangers/elders
svdu-reform made du nearly universal
Languages like Japanese and Korean use speech levels/honorifics instead of pronoun changes — controlled via the tone parameter.
Invalid parameters or malformed request
Invalid or missing API key
Usage limit exceeded, upgrade plan
Rate limit exceeded, slow down
Something went wrong on our end
text chars = 1 unit** Billing note: Every 200 characters in your text input counts as 1 translation toward your monthly limit. Example: a 400-char text = 2 translations. Partial units round up (250 chars = 2 translations).
Rate limits are per API key. Need higher limits? Contact us for Enterprise pricing.
Can't find what you're looking for? We're here to help.