Skip to content

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

Closed

Description

@ibelous

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

Activity

  1. ghost closed this as completedon Oct 21, 2021
  2. MystiqueMo commented on Apr 15, 2022

    @MystiqueMo

    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?

  3. NaomiH0C commented on Jun 17, 2022

    @NaomiH0C

    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..

  4. MystiqueMo commented on Jun 20, 2022

    @MystiqueMo

    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.

  5. stevermeister commented on Aug 24, 2023

    @stevermeister

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions