deeplcom/deepl-php
Official PHP client for the DeepL translation API. Send text and documents for high-quality translation from PHP 7.3+ applications, with full API support and simple Composer installation.
formality (less/more/prefer_*), glossary, style_id, and custom_instructions are product levers, not plumbing. They decide whether you can credibly launch in German (Sie/du), Japanese (keigo), and French B2B markets without a human review pass on every string. The prefer_* variants are specifically a "degrade gracefully on unsupported languages" decision you can make once and encode in config.billedCharacters and detectedSourceLang come back on every result, which means usage-based pricing, internal chargeback, quota enforcement, and margin forecasting can be built on real data instead of estimates. context is explicitly noted as not billed — a quality win that is free, worth exploiting before paying for more volume.model_type (quality_optimized vs. prefer_quality_optimized vs. latency-oriented) lets you differentiate surfaces: instant chat translation can trade quality for speed, while document and legal workflows take the slow, high-quality path. This is a UX promise decision, not an engineering one.translateDocument() wraps upload → poll → download. That means document translation belongs on a queue with progress states, not in a request/response endpoint. Decide now whether the product promises "instant" or "email when ready," because the SDK's shape forces the latter.rephraseText() with writing_style and tone is a writing-assistant MVP for the cost of one method call. Worth a spike before committing roadmap to a separate vendor.Adopt when:
Look elsewhere or plan extra work when:
For executives: This is the official, MIT-licensed PHP client for DeepL, maintained by DeepL. It removes the "do we integrate a translation vendor" question from the critical path: our engineers install one dependency instead of writing and owning an API client, which turns a multi-week integration into a short spike. It also unlocks a capability story we could not otherwise tell cheaply — controlled brand voice per market (formality, glossaries, style rules), document translation for contracts and manuals, and a rephrasing capability that is a plausible adjacent product. The cost model is transparent and metered per character, and the API returns billed-character counts per request, so we can build usage tiers and internal chargeback on real numbers rather than guesses. There is a free tier of 500k characters per month to validate demand before any contract.
For engineering: Standard Composer install, PHP 8.1+ recommended, no exotic runtime requirements. Expect to wrap it rather than use it raw — a service-provider binding, config for the auth key (never in source), retry/backoff, and queue-backed jobs for document translation, since that flow is upload → poll → download and must not run inside a web request. The SDK exposes typed result objects (translated text, detected source language, billed characters, model used) and a document-translation exception that preserves the document handle if a failure happens mid-flight — use those instead of re-parsing responses. Keep the client behind our own interface so a second provider is a swap, not a rewrite.
The ask: one sprint of engineering time for the wrapper plus a spike, and a decision on whether document translation is a synchronous-feeling feature or an asynchronous one — because the answer changes the UX and the infrastructure we provision.
How can I help you explore Laravel packages today?