Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong endpoint. Use https://api.deepl.com For Deepl PRO auth key #8

Closed
ibelous opened this issue Oct 18, 2021 · 7 comments
Closed

Wrong endpoint. Use https://api.deepl.com For Deepl PRO auth key #8

ibelous opened this issue Oct 18, 2021 · 7 comments

Comments

@ibelous
Copy link

ibelous commented Oct 18, 2021

Hi,
When I try to use api-free key to translate text it works fine, but when I try to use Pro-key I get following error:

translator.translate_text('abc', target_lang='en-us').text

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/home/.../venv3/lib/python3.6/site-packages/deepl/translator.py", line 685, in translate_text
    self._raise_for_status(status, content, json)
  File "/home/.../venv3/lib/python3.6/site-packages/deepl/translator.py", line 501, in _raise_for_status
    f"Authorization failure, check auth_key{message}"
deepl.exceptions.AuthorizationException: Authorization failure, check auth_key, message: Wrong endpoint. Use https://api.deepl.com

Translator calls v2 API and fails with this error. But when I tried to change api_call url from v2 to v1 it worked.
Is there any way to use my key with API v2 or change v2 call to v1 except for changing package source code?
I'm using python3.6.14 and requests==2.25.1

@daniel-jones-deepl
Copy link
Member

Hi @ibelous, thank you for reporting your problem.
This library is only intended to be used with DeepL API accounts; using keys from other kinds of accounts will not work.

@MystiqueMo
Copy link

MystiqueMo commented Apr 15, 2022

Hi @ibelous, thank you for reporting your problem. This library is only intended to be used with DeepL API accounts; using keys from other kinds of accounts will not work.

Sorry no offense, but I don't see how this response addressed the problem. The API he/she made a request to was that of a deepl account or did you make a typo in your response to the issue?

@daniel-jones-deepl
Copy link
Member

daniel-jones-deepl commented Apr 19, 2022

Hi @MystiqueMo, this is a fair question to ask, the naming of the different account types can be confusing.

DeepL has two main account types: DeepL Pro (for our other platforms) and DeepL API (for our API). DeepL API accounts are further differentiated into two sub-types DeepL API Free and DeepL API Pro (this last one might lead to confusion).

I figured out the original issue creator had a DeepL Pro account, rather than a DeepL API account. DeepL API accounts (both Free and Pro) include an authentication key for the API, and are supported by this client library, other account types are not.

@NaomiH0C
Copy link

when i try to use the api i get this error {“message”:“Wrong endpoint. Use https://api.deepl.com/”}
even though i use the correct endpoint..

@daniel-jones-deepl
Copy link
Member

daniel-jones-deepl commented Jun 20, 2022

Hi @NaomiH0C, thanks for reporting your problem. Do you use an DeepL API Free or DeepL API Pro account?
You shouldn't need to specify the endpoint using server_url; the correct endpoint is selected automatically for DeepL API accounts.
If you recently upgraded from Free to Pro, you could try regenerating your API key and trying with the new key.

@MystiqueMo
Copy link

Hi @MystiqueMo, this is a fair question to ask, the naming of the different account types can be confusing.

DeepL has two main account types: DeepL Pro (for our other platforms) and DeepL API (for our API). DeepL API accounts are further differentiated into two sub-types DeepL API Free and DeepL API Pro (this last one might lead to confusion).

I figured out the original issue creator had a DeepL Pro account, rather than a DeepL API account. DeepL API accounts (both Free and Pro) include an authentication key for the API, and are supported by this client library, other account types are not.

Okay, understood.

Thanks for clarifying @daniel-jones-deepl.

@stevermeister
Copy link

I'll resume for those who will have this issue in the future. (It was not that easy for me to figure out the issue based on this thread).

There are different plan types, if you select the wrong one your key will not work with API giving this strange error
Screenshot 2023-08-24 at 11 47 26

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

No branches or pull requests

5 participants