Skip to content

入门指南

快速开始

接入方式一览

按量计费Token PlanCoding Plan
API Keysk-sk-tp-sk-sp-
Base URL(OpenAI)https://api.scnet.cn/api/llm/v1https://api.scnet.cn/api/llm/v1https://api.scnet.cn/api/llm/v1
Base URL(Anthropic)https://api.scnet.cn/api/llm/anthropichttps://api.scnet.cn/api/llm/anthropichttps://api.scnet.cn/api/llm/anthropic
计费方式按 Token 用量扣费按月订阅,扣减 Credits 额度按月订阅,按调用次数扣减
适用场景灵活调用、全模型AI 编程包月AI 编程包月

重要提示

三种 API Key 完全独立,不可混用。混用会导致无法抵扣套餐额度,或产生按量计费费用。


按量计费

SCNet 平台提供的模型 API 接口兼容 OpenAI 与 Anthropic 接口规范,您仅需将 base_urlapi_keymodel 替换为对应配置,即可无缝接入。

1. 获取 API Key

请按 API Key 管理 说明步骤,创建通用 API Key(sk- 开头),或者购买订阅套餐后获得专属 API Key。

2. 选择模型

模型列表 中查看平台提供的模型名称,或通过 模型查询接口 获取(不消耗 Token,不产生费用)。

3. 调用模型 API(OpenAI 协议)

SCNet 平台提供的模型 API 接口兼容 OpenAI 接口规范,您仅需要将 base_urlapi_keymodel 替换为对应配置,即可无缝接入。

  • Base URLhttps://api.scnet.cn/api/llm/v1
  • 授权方式Authorization: Bearer <API Key>

路径中的 /v1 用于接口版本标识,与模型版本无关。

您可以根据实际业务或本地环境,选择 OpenAI SDK 或直接 HTTP 调用。下方示例为非流式输出,将 stream 设置为 true 即可使用流式输出。

shell
curl 'https://api.scnet.cn/api/llm/v1/chat/completions' \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <API Key>" \
  -d '{
        "model": "DeepSeek-R1-Distill-Qwen-7B",
        "messages": [
          {"role": "system", "content": "You are a helpful assistant."},
          {"role": "user", "content": "Hello!"}
        ],
        "stream": false
      }'
python
# 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)
go
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))
}
javascript
// Please install OpenAI SDK first: `npm install openai`

import OpenAI from "openai";

const openai = new OpenAI({
    baseURL: 'https://api.scnet.cn/api/llm/v1',
    apiKey: '<API Key>'
});

async function main() {
  const completion = await openai.chat.completions.create({
    messages: [{ role: "system", content: "You are a helpful assistant." }],
    model: "DeepSeek-R1-Distill-Qwen-7B",
  });

  console.log(completion.choices[0].message.content);
}

main();

4. 调用模型 API(Anthropic 协议)

SCNet 平台提供的模型接口兼容 Anthropic 标准,您只需按照以下配置进行替换,即可无缝接入。

  • Base URLhttps://api.scnet.cn/api/llm/anthropic
  • 授权方式Authorization: Bearer <API Key>

您可以根据环境选择 Anthropic SDK、HTTP 或 Node.js SDK 调用。

使用 Python SDK 时,请先安装依赖(pip install anthropic),并配置环境变量:

bash
export ANTHROPIC_BASE_URL=https://api.scnet.cn/api/llm/anthropic
export ANTHROPIC_API_KEY=<API Key>
powershell
setx ANTHROPIC_BASE_URL "https://api.scnet.cn/api/llm/anthropic"
setx ANTHROPIC_API_KEY "<API Key>"

设置后需重新打开终端窗口生效。若仍未生效,请重启电脑。

python
# pip install anthropic

import anthropic

client = anthropic.Anthropic()

message = client.messages.create(
    model="MiniMax-M2.5",
    max_tokens=1000,
    system="You are a helpful assistant.",
    messages=[
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "Hi, how are you?"
                }
            ]
        }
    ]
)

for block in message.content:
    if block.type == "thinking":
        print(f"Thinking:\n{block.thinking}\n")
    elif block.type == "text":
        print(f"Text:\n{block.text}\n")
shell
curl https://api.scnet.cn/api/llm/anthropic/v1/messages \
  -H "Content-Type: application/json" \
  -H "anthropic-version: 2023-06-01" \
  -H "Authorization: Bearer <API Key>" \
  -d '{
      "messages": [{"role": "user", "content": "你好"}],
      "model": "MiniMax-M2.5",
      "max_tokens": 1024,
      "stream": false
    }'
javascript
// npm install @anthropic-ai/sdk

import Anthropic from '@anthropic-ai/sdk';

const anthropic = new Anthropic({
  apiKey: '<API Key>',
  baseURL: 'https://api.scnet.cn/api/llm/anthropic',
  defaultHeaders: {
    'Authorization': 'Bearer <API Key>'
  }
});

async function main() {
  const message = await anthropic.messages.create({
    max_tokens: 1024,
    messages: [{ role: 'user', content: 'Hello, Claude' }],
    model: 'MiniMax-M2.5',
  });

  console.log(message.content[0].text);
}

main();

Token Plan

步骤一:订阅套餐

  1. 登录 超算互联网
  2. 进入控制台 → 模型服务 → Token Plan。
  3. 选择所需套餐(基础版 / 标准版 / 高级版)并完成支付。

步骤二:获取专属 API Key 与 Base URL

购买成功后,进入控制台 → 模型服务 → Token Plan → 我的订阅 / Token 用量 页面,可查看套餐状态、Credits 用量、专属 API Key 与 Base URL。

步骤三:选择模型并完成接入

配置项
API KeyToken Plan 专属 Key(sk-tp- 开头)
Base URLhttps://api.scnet.cn/api/llm/v1https://api.scnet.cn/api/llm/anthropic
Model套餐内可用模型(参见 Token Plan

各工具的详细配置步骤,请参见 接入工具。套餐规则请参见 Token Plan


Coding Plan

步骤一:订阅套餐

  1. 登录 超算互联网
  2. 进入控制台 → 模型服务 → Coding Plan。
  3. 选择所需套餐并完成支付。

步骤二:获取专属 API Key 与 Base URL

购买成功后,进入控制台 → 模型服务 → Coding Plan 页面,可查看套餐状态、用量进度、专属 API Key 与 Base URL。

步骤三:选择模型并完成接入

配置项
API KeyCoding Plan 专属 Key(sk-sp- 开头)
Base URLhttps://api.scnet.cn/api/llm/v1https://api.scnet.cn/api/llm/anthropic
Model套餐内可用模型(参见 Coding Plan

各工具的详细配置步骤,请参见 接入工具。套餐规则请参见 Coding Plan