#3758 requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.deepseek.com/api

117.4* Posted at: 3 hours ago 👁8

401 Client Error: Unauthorized for url: https://api.deepseek.com/api:
Traceback (most recent call last):
File "videotrans\recognition\_base.py", line 143, in run
File "tenacity\__init__.py", line 338, in wrapped_f
File "tenacity\__init__.py", line 477, in call
File "tenacity\__init__.py", line 378, in iter
File "tenacity\__init__.py", line 421, in exc_check
tenacity.RetryError: RetryError[]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\util\TestSTT.py", line 17, in run
File "videotrans\recognition\__init__.py", line 230, in run
File "videotrans\recognition\_base.py", line 180, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\recognition\_stt.py", line 65, in _exec
File "requests\models.py", line 1026, in raise_for_status
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.deepseek.com/api


=
system:Windows-10-10.0.26200-SP0
version:v3.98
frozen:True
language:en
root_dir:G:/pyvideo

1 Replies

This error indicates that the API request to DeepSeek was unauthorized (401 error). The most common cause is an incorrect or missing API Key, or an incorrect API URL.

To resolve this issue, follow these steps:

  1. Verify your DeepSeek API Key and URL:

    • Go to the DeepSeek platform (platform.deepseek.com) and ensure your API Key is active and has sufficient balance.
    • In pyVideoTrans, navigate to Menu -> Translation Settings -> DeepSeek Settings.
    • Double-check that the API Key you entered is correct and has no extra spaces.
    • Ensure the API URL is set to https://api.deepseek.com. Do not add /v1 or /chat/completions to the end.
  2. Check the Model Name:

    • In the same DeepSeek settings panel, the Model Name field must be filled in. For DeepSeek, the correct model name is typically deepseek-chat. Enter this manually if the field is empty.
  3. Test the Connection:

    • After updating the settings, click the "Test" button in the DeepSeek settings panel to verify the connection and authentication.
  4. Network Proxy (if applicable):

    • If you are in a region that requires a proxy to access DeepSeek, ensure you have entered the correct proxy address (e.g., http://127.0.0.1:10809) in the main interface's "Network Proxy Address" field.

Please refer to the relevant documentation:

Post Your Reply