# DeepL

> **You are on:** `https://beta-api.paywithlocus.com/api` | [llms.txt](https://beta.paywithlocus.com/llms.txt)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API |
> |---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com |
> | Beta | beta.paywithlocus.com | beta-api.paywithlocus.com |
> | Stage | stage.paywithlocus.com | stage-api.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Professional translation and text improvement — translate text between 30+ languages with industry-leading quality, or improve and rephrase text with DeepL Write.

**Category:** AI / Translation | **Website:** [www.deepl.com](https://www.deepl.com) | **Docs:** [developers.deepl.com](https://developers.deepl.com)

## Access Methods

| Method | Base URL | Auth |
|--------|----------|------|
| **MPP (Tempo)** | `https://deepl.mpp.paywithlocus.com/deepl/` | HTTP 402 auto-payment |
| **Wrapped API** | `https://beta-api.paywithlocus.com/api/wrapped/deepl/` | `Authorization: Bearer <LOCUS_API_KEY>` |

**OpenAPI discovery:** `GET https://deepl.mpp.paywithlocus.com/openapi.json`

## Endpoints

### Translate

Translate text between 30+ languages with DeepL's industry-leading neural machine translation. Supports formality control, context, and model selection.

**Estimated cost:** $0.025+ (scales with text length)

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `text` | array[string] | Yes | Text(s) to translate (up to 50 items) |
| `target_lang` | string | Yes | Target language code (e.g. "DE", "FR", "ES", "JA", "ZH") |
| `source_lang` | string | No | Source language code (auto-detected if omitted) |
| `formality` | string | No | "default", "more", "less", "prefer_more", "prefer_less" |
| `context` | string | No | Additional context to improve translation quality (not translated) |
| `model_type` | string | No | "quality_optimized", "latency_optimized", or "prefer_quality_optimized" |
| `split_sentences` | string | No | "0" (none), "1" (default), or "nonewlines" |
| `preserve_formatting` | boolean | No | Preserve original formatting (punctuation, case) |
| `tag_handling` | string | No | "xml" or "html" for markup-aware translation |

```bash
curl -X POST https://deepl.mpp.paywithlocus.com/deepl/translate \
  -H "Content-Type: application/json" \
  -d '{"text":"<array[string]>","target_lang":"<string>","source_lang":"<string>","formality":"<string>","context":"<string>","model_type":"<string>","split_sentences":"<string>","preserve_formatting":"<boolean>","tag_handling":"<string>"}'
```

### Rephrase (Write)

Improve and rephrase text with DeepL Write. Fix grammar, adjust tone, change writing style, and convert between language variants (e.g. US → British English).

**Estimated cost:** $0.025+ (scales with text length)

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `text` | array[string] | Yes | Text(s) to improve |
| `target_lang` | string | Yes | Language: "de", "en-US", "en-GB", "es", "fr", "it", "pt-BR", "pt-PT" |
| `writing_style` | string | No | "simple", "business", "academic", "casual", or "default" |
| `tone` | string | No | "enthusiastic", "friendly", "confident", "diplomatic", or "default" |

```bash
curl -X POST https://deepl.mpp.paywithlocus.com/deepl/rephrase \
  -H "Content-Type: application/json" \
  -d '{"text":"<array[string]>","target_lang":"<string>","writing_style":"<string>","tone":"<string>"}'
```

### Languages

List all supported source and target languages with formality support info.

**Estimated cost:** $0.005 fee only

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `type` | string | No | "source" (default) or "target" |

```bash
curl -X POST https://deepl.mpp.paywithlocus.com/deepl/languages \
  -H "Content-Type: application/json" \
  -d '{"type":"<string>"}'
```
