Updated on 2025-07-28 GMT+08:00

Calling a DeepSeek Model

Obtaining the API Request URL of the Third-Party Model

The API request URL consists of the API domain name and API URI.

After the model is deployed, you can call the following API to call the third-party model.

Table 1 Text completion API (example)

API Type

API URI

Deepseek-xxx

{api-url}/generate

To obtain the API domain name, choose Model Development > Model Deployment on ModelArts Studio. The detailed procedure is as follows:

  1. Log in to ModelArts Studio and access the required workspace.
  2. In the navigation pane on the left, choose Model Development > Model Deployment. Click a model name and obtain the API domain name on the details page.

    Only models in the Running state can be called.

    Figure 1 Obtaining the API domain name of a DeepSeek model
  3. After obtaining the API domain name, combine it with the API URI to form a complete API request URL.

Obtaining a Token

Obtain the token by following the instructions provided in section "Calling REST APIs for Authentication" in API Reference.

Using APIs to Call a DeepSeek Model

  1. Create a POST request in Postman and enter the API request URL.
  2. Set two request header parameters by referring to Figure 2.
    • KEY: Content-Type; VALUE: application/json
    • KEY: X-Auth-Token; VALUE: the token value obtained in this section
      Figure 2 Entering a third-party model API
  3. Click Body, select raw, refer to the following code, and enter the request body.
    {
        "prompt": " Hello,"
        "temperature": 0,
        "max_tokens": 100
    }
    Figure 3 Entering the request body of the third-party model
  4. Click Send on Postman to send the request.