Common issues and solutions when using the DeepL CLI.
Cause: The API key is missing, invalid, or expired.
Solutions:
-
Verify your key is set:
deepl auth show
- With a key configured:
API Key: XXXX...XXXX(shows first 4 and last 4 characters) - Without a key:
No API key set
- With a key configured:
-
Set or update your key:
deepl auth set-key YOUR_API_KEY
-
Alternatively, use the environment variable:
export DEEPL_API_KEY="your-key-here"
-
Verify the key works:
deepl auth show
Notes:
- Free API keys end with
:fx. Pro keys do not. - The CLI auto-detects the API endpoint from the key suffix:
:fxkeys useapi-free.deepl.com, others useapi.deepl.com. Custom regional endpoints (e.g.api-jp.deepl.com) always take priority. - The stored config key takes precedence over the
DEEPL_API_KEYenvironment variable.
Cause: The deepl init wizard validates your API key by contacting the DeepL API. If the network is unreachable, validation will fail.
Solutions:
-
Check your internet connection and try again:
deepl init
-
If behind a proxy, set proxy environment variables before running init:
export HTTPS_PROXY=https://proxy.example.com:8443 deepl init
Cause: The key you entered is invalid, expired, or for a different API tier than expected.
Solutions:
-
Double-check your API key on the DeepL account page.
-
Ensure you're copying the full key, including the
:fxsuffix for free-tier keys. -
As a manual fallback, skip the wizard and set the key directly:
deepl auth set-key YOUR_API_KEY
Cause: Your DeepL account has reached its character translation limit.
Solutions:
-
Check your current usage:
deepl usage
-
For detailed breakdown:
deepl usage --format json
-
Wait for your quota to reset (monthly for most plans), or upgrade your DeepL plan.
Cause: Too many API requests in a short time period.
Solutions:
-
The CLI automatically retries rate-limited requests with exponential backoff. If you still see this error, reduce concurrency.
-
For batch/directory translation, the CLI uses concurrency control internally. Avoid running multiple CLI instances simultaneously on the same API key.
-
The CLI automatically retries with exponential backoff (1s, 2s, 4s, up to 10s, max 3 retries). If errors persist, wait and try again.
Cause: Cannot reach the DeepL API servers.
Solutions:
-
Check your internet connection.
-
Verify DeepL API is reachable:
curl -s https://api-free.deepl.com/v2/languages -H "Authorization: DeepL-Auth-Key YOUR_KEY" -
If behind a corporate proxy, configure it via environment variables:
export HTTPS_PROXY=https://proxy.example.com:8443 # or export HTTP_PROXY=http://proxy.example.com:8080
-
The CLI retries on transient network errors automatically with exponential backoff.
Cause: The DeepL API is temporarily overloaded or undergoing maintenance.
Solutions:
-
Wait a few minutes and retry your request.
-
Use
--no-cacheto bypass any stale cached error responses:deepl translate "Hello" --to es --no-cache -
The CLI automatically retries on 503 errors with exponential backoff. If the error persists, the API may be experiencing an extended outage.
Cause: This is expected behavior, not an error. Exit code 8 means deepl write --check found improvements for your text.
Details:
- Exit 0 — Text is clean, no improvements suggested.
- Exit 8 — Improvements were found and suggested.
This exit code is useful in CI/CD pipelines or scripts to detect when text could be improved:
deepl write --check "Your text" --lang en-US
if [ $? -eq 8 ]; then
echo "Text has suggested improvements"
fiCause: Voice API requires a DeepL Pro account with Voice API access enabled.
Solutions:
- Verify your account has Voice API access on the DeepL website.
- Voice API uses the same endpoint resolution as other commands (
:fxkeys useapi-free.deepl.com). - Check that your audio file format is supported (OGG, Opus, WebM, MKA, FLAC, MP3, PCM).
Cause: The WebSocket URL returned by the API failed validation.
Notes:
- The CLI validates that streaming URLs use
wss://scheme and*.deepl.comhostnames. - This is a security check to prevent connection to unauthorized servers.
- If you see this error, it may indicate an API issue. Try again later.
If the CLI cannot auto-detect your audio format from the file extension, specify it explicitly:
deepl voice audio.raw --to de --content-type 'audio/pcm;encoding=s16le;rate=16000'Supported formats: audio/ogg, audio/webm, audio/flac, audio/mpeg, audio/x-matroska, and PCM variants.
Cause: The Write API supports fewer language pairs than the Translate API. Not all combinations are available.
Solutions:
-
Check which languages Write API supports:
deepl write --help
-
Use
--verboseto see the API request and response details:deepl write "Your text" --lang en-US --verbose -
If your language pair is unsupported, use the translate command as a fallback.
Cause: The formality or style parameter may not be supported for the target language, or the text already matches the requested style.
Solutions:
-
Not all languages support formality settings. Check the DeepL API documentation for supported languages.
-
Verify you are using valid formality values:
deepl write --help
-
Use
--verboseto inspect the API response and confirm the style was applied.
Cause: The input text may already match the requested style, or the Write API determined no changes were needed.
Solutions:
-
Try a different style or formality level to see if changes are applied.
-
Use
--checkmode to compare the original with the improved version:deepl write "Your text" --lang en-US --check -
Check the verbose output for details:
deepl write "Your text" --lang en-US --verbose
Cause: The Write API has its own rate limits, separate from the Translate API.
Solutions:
-
The CLI automatically retries rate-limited requests with exponential backoff.
-
If processing multiple texts, consider adding delays between requests.
-
Check your current API usage:
deepl usage
Cause: The config file is corrupted or has invalid JSON.
The config file location depends on your setup (see Configuration Paths):
- XDG default:
~/.config/deepl-cli/config.json - Legacy:
~/.deepl-cli/config.json
Solutions:
-
View current config:
deepl config list
-
Reset a specific setting:
deepl config set <key> <value>
-
If the config file is corrupted, remove it and reconfigure:
rm ~/.config/deepl-cli/config.json # or ~/.deepl-cli/config.json deepl auth set-key YOUR_API_KEY
-
Use a custom config directory:
export DEEPL_CONFIG_DIR=/path/to/config
Common causes and fixes:
-
translate: Requires text or file path and
--tolanguage:deepl translate "Hello" --to es -
watch: Requires a path and
--to:deepl watch ./docs --to es,fr
-
completion: Requires a shell name:
deepl completion bash
Use deepl languages to see all supported languages:
deepl languages --source
deepl languages --targetIf you suspect cached translations are outdated:
# Clear the cache
deepl cache clear
# Check cache status
deepl cache statsIf the SQLite cache becomes corrupted:
# Disable cache temporarily
deepl cache disable
# Remove the cache file and re-enable
rm ~/.cache/deepl-cli/cache.db # or ~/.deepl-cli/cache.db for legacy installations
deepl cache enableCause: The better-sqlite3 native addon was compiled for a different Node.js version than the one currently running. This happens when you switch Node.js versions (e.g., via nvm use, fnm, or a system upgrade) without rebuilding native modules.
Solution:
npm rebuild better-sqlite3When translating a directory, you must specify --output:
deepl translate ./docs --to es --output ./docs-esSupported document formats: PDF, DOCX, DOC, PPTX, XLSX, TXT, HTML, HTM, XLF, XLIFF, SRT, JPG, JPEG, PNG. See docs/API.md for the complete list of supported formats.
deepl translate document.docx --to fr --output translated.docx-
List available glossaries:
deepl glossary list
-
Glossary names are case-sensitive. Use the exact name or ID.
-
Glossaries are tied to specific language pairs. Ensure your source/target language matches the glossary's language pair.
| Code | Meaning | Retryable? |
|---|---|---|
| 0 | Success | N/A |
| 1 | General error | No |
| 2 | Authentication error | No |
| 3 | Rate limit exceeded | Yes |
| 4 | Quota exceeded | No |
| 5 | Network error | Yes |
| 6 | Invalid input | No |
| 7 | Configuration error | No |
| 8 | Check found issues (write --check) | No |
| 9 | Voice API error | No |
Use exit codes in scripts for retry logic:
deepl translate "Hello" --to es
case $? in
0) echo "Success" ;;
3|5) echo "Transient error, retrying..." ;;
2) echo "Fix your API key" ;;
4) echo "Quota exceeded, wait for reset" ;;
*) echo "Error, check output" ;;
esac| Variable | Purpose |
|---|---|
DEEPL_API_KEY |
API key (fallback when no stored config key) |
DEEPL_CONFIG_DIR |
Override config and cache directory |
XDG_CONFIG_HOME |
Override XDG config base (default: ~/.config) |
XDG_CACHE_HOME |
Override XDG cache base (default: ~/.cache) |
HTTP_PROXY |
HTTP proxy URL |
HTTPS_PROXY |
HTTPS proxy URL (takes precedence over HTTP_PROXY) |
NO_COLOR |
Disable colored output when set to any value |
# General help
deepl --help
# Command-specific help
deepl translate --help
deepl voice --help
deepl glossary --help
# Check CLI version
deepl --versionIf you encounter an issue not covered here, check the DeepL API documentation.
If your problem isn't listed above, file a bug report with:
- The command you ran
- The full error output
- Your CLI version (
deepl --version) - Your OS and Node.js version