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.
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:
- Log in to ModelArts Studio and access the required workspace.
- 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 - 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
- Create a POST request in Postman and enter the API request URL.
- 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
- 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 - Click Send on Postman to send the request.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot