Relay

接入文档

行为对齐 LiteLLM / New API:客户端永远走 OpenAI Chat Completions。Anthropic、Azure 等由网关转换。

Base URL

https://www.bycsc.com/v1

鉴权

Authorization: Bearer rk_live_…

兼容接口

  • POST /v1/chat/completions — 聊天,支持 stream
  • GET /v1/models — 当前账号已启用渠道上的模型
  • POST /v1/embeddings — 走同一套令牌和渠道

路由怎么走

  1. 若有路由规则,按优先级匹配模型名(精确 / 前缀* / *)。
  2. 主渠道失败且配置了 fallback,自动改走回退渠道。
  3. 没有规则时,落到声明了该模型的启用渠道;否则第一个启用渠道。
Python · openai SDK
from openai import OpenAI

client = OpenAI(
    api_key="rk_live_...",
    base_url="https://www.bycsc.com/v1",
)

for model in ["gpt-4o-mini", "claude-sonnet-4-5", "gemini-2.5-flash", "deepseek-chat"]:
    print(model, client.chat.completions.create(
        model=model,
        messages=[{"role":"user","content":"ping"}],
    ).choices[0].message.content)
Node.js · openai SDK
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "rk_live_...",
  baseURL: "https://www.bycsc.com/v1",
});

const r = await client.chat.completions.create({
  model: "deepseek-chat",
  messages: [{ role: "user", content: "hi" }],
});
console.log(r.choices[0].message.content);
curl
curl https://www.bycsc.com/v1/chat/completions \
  -H "Authorization: Bearer rk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"hi"}]}'