创建个人密钥
在控制台生成自己的 rk_ Key,供脚本或应用发起请求。
管理密钥 →从终端里的第一次请求开始,使用同一把密钥测试不同模型。
把下面的脚本保存为 call.py,在终端运行 python3 call.py,然后输入个人密钥。
from getpass import getpass
import json
from urllib.request import Request, urlopen
key = getpass("本站 rk_ Key: ").strip()
body = {"model": "qwen3.8-flash", "input": "请回复你好"}
request = Request(
"https://bailian-relay.onrender.com/v1/responses",
data=json.dumps(body).encode(),
headers={"Authorization": "Bearer " + key, "Content-Type": "application/json"},
)
with urlopen(request, timeout=190) as response:
print(json.load(response)["output"])https://bailian-relay.onrender.com/v1同一把个人密钥可以请求账户支持的模型,切换时修改请求里的 model 字段即可。
文本请求分别计算输入和输出 Token 的用量,再按对应费率结算。
登录后打开使用日志,按请求 ID 核对用量,再到钱包查看余额。