DeepL's API translates text and documents. Free-plan keys (ending in :fx) use https://api-free.deepl.com; Pro keys use https://api.deepl.com.
Copy your key from Account → API Keys and send it as Authorization: DeepL-Auth-Key <key>. In the examples it's written {{DEEPL_API_KEY}}.
Full reference: https://developers.deepl.com/docs
source_lang is optional; DeepL detects it.
curl -X POST https://api-free.deepl.com/v2/translate \
-H "Authorization: DeepL-Auth-Key {{DEEPL_API_KEY}}" \
-H "Content-Type: application/json" \
-d '{"text": ["Hello, world!"], "target_lang": "DE"}'
Characters used this billing period.
curl https://api-free.deepl.com/v2/usage \
-H "Authorization: DeepL-Auth-Key {{DEEPL_API_KEY}}"
curl "https://api-free.deepl.com/v2/languages?type=target" \
-H "Authorization: DeepL-Auth-Key {{DEEPL_API_KEY}}"