DeepSeek-超算
其他 官方文档
通过超算互联网白嫖DeepSeek-R1满血版,100wtoken
基本说明:
接口地址:https://api.scnet.cn/api/llm/v1
返回格式:json
请求方式:post
请求示例:https://api.scnet.cn/api/llm/v1
请求参数说明:
名称 类型 必填 说明
- - - -
返回参数说明:
名称 类型 说明
- - -
JSON返回示例:
{}
服务级错误码参照
错误码 说明
- -
完整教学代码示例
# Please install OpenAI SDK first: `pip3 install openai`

from openai import OpenAI

client = OpenAI(api_key="<API Key>", base_url="https://api.scnet.cn/api/llm/v1")

response = client.chat.completions.create(
    model="DeepSeek-R1-Distill-Qwen-7B",
    messages=[
        {"role": "system", "content": "You are a helpful assistant"},
        {"role": "user", "content": "Hello"},
    ],
    stream=False
)

print(response.choices[0].message.content)
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
    "strings"
)

func main() {

    url := "https://api.scnet.cn/api/llm/v1/chat/completions"
    method := "POST"

    payload := strings.NewReader(`{
  "messages": [
    {
      "content": "You are a helpful assistant",
      "role": "system"
    },
    {
      "content": "Hi",
      "role": "user"
    }
  ],
  "model": "DeepSeek-R1-Distill-Qwen-7B",
  "stream": false
}`)
    client := &http.Client{}
    req, err := http.NewRequest(method, url, payload)

    if err != nil {
        fmt.Println(err)
        return
    }
    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("Authorization", "Bearer <API Key>")

    res, err := client.Do(req)
    if err != nil {
        fmt.Println(err)
        return
    }
    defer res.Body.Close()

    body, err := ioutil.ReadAll(res.Body)
    if err != nil {
        fmt.Println(err)
        return
    }
    fmt.Println(string(body))
}