Skip to content

Add support deepl pro api#716

Open
vladkryv wants to merge 1 commit into
FilipePS:masterfrom
vladkryv:master
Open

Add support deepl pro api#716
vladkryv wants to merge 1 commit into
FilipePS:masterfrom
vladkryv:master

Conversation

@vladkryv

Copy link
Copy Markdown

No description provided.

@FilipePS

Copy link
Copy Markdown
Owner

Adding a PRO API should not replace the FREE API.

@FilipePS FilipePS closed this Mar 10, 2025
@vladkryv

Copy link
Copy Markdown
Author

Adding a PRO API should not replace the FREE API.

The only difference is in the endpoint: all free API keys end with :fx, which can be used to determine which one to call. The main changes are in two lines:

  1. apiKey.endsWith(":fx") ? "https://api-free.deepl.com/v2/translate" : "https://api.deepl.com/v2/translate"
  2. apiKey.endsWith(":fx") ? "https://api-free.deepl.com/v2/usage" : "https://api.deepl.com/v2/usage"

The free API has not been removed; only the free prefix in the names was removed because, after the change, both free and pro will work. (But yes, this should have been done in separate commits.)

@FilipePS FilipePS reopened this Mar 10, 2025
@vladkryv

Copy link
Copy Markdown
Author

Also forgot to mention: with the current changes, users' previously entered deepl_freeapi key will not be preserved after the update, as it is now stored as deepl_api in the configuration. It might be worth adding a migration/renaming in the code that runs after the update and during settings import, but I'm not sure how to implement it properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants