快速开始
AI Station 是基于 NewAPI 部署的模型统一网关,接口与 OpenAI API 格式兼容,并额外支持 Anthropic、Gemini、Midjourney 及各类视频/音频插件任务。
接入信息
| 项目 | 值 |
|---|---|
| Base URL | https://test.kailin.com.cn |
| 鉴权方式 | Authorization: Bearer sk-xxxx(请求头) |
| 协议 | HTTPS,REST + SSE 流式 + WebSocket(Realtime) |
获取 API Key
- 登录 控制台。
- 在「令牌 / API Keys」页面创建一个新令牌,形如
sk-xxxxxxxx。 - 令牌请妥善保管,不要提交到代码仓库或暴露在客户端代码中。
第一个请求
所有接口都通过 Authorization: Bearer <你的令牌> 头进行鉴权。以聊天补全为例:
curl https://test.kailin.com.cn/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-你的令牌" \
-d '{
"model": "deepseek-v4-1-flash-261017",
"messages": [
{ "role": "user", "content": "你好,介绍一下你自己" }
]
}'
请求REQUEST
POST
https://test.kailin.com.cn/v1/chat/completions响应RESPONSE
填写参数并发送请求,响应会显示在这里
Python / Node.js 客户端
由于接口与 OpenAI 格式兼容,可以直接使用官方 SDK,只需把 base_url 指向本站:
from openai import OpenAI
client = OpenAI(
api_key="sk-你的令牌",
base_url="https://test.kailin.com.cn/v1",
)
resp = client.chat.completions.create(
model="deepseek-v4-1-flash-261017",
messages=[{"role": "user", "content": "你好"}],
)
print(resp.choices[0].message.content)
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'sk-你的令牌',
baseURL: 'https://test.kailin.com.cn/v1',
});
const resp = await client.chat.completions.create({
model: 'deepseek-v4-1-flash-261017',
messages: [{ role: 'user', content: '你好' }],
});
console.log(resp.choices[0].message.content);
Anthropic SDK 同样可用(将 base_url 指向本站),详见 Anthropic Messages。
流式输出
大多数文本类接口支持 "stream": true,此时响应为 SSE(Server-Sent Events),格式为 text/event-stream