HTTP SSE 接口(中文)
Bitseek 提供 OpenAI 风格的 HTTP SSE 接口:
- URL:
https://chat-proxy.bitseek.ai/v1/chat/completions - Method:
POST - Response:
text/event-stream
请求头
| Header | 必填 | 说明 |
|---|---|---|
Content-Type |
是 | application/json |
Authorization |
是 | Bearer <API-KEY-OR-TOKEN> |
Accept |
建议 | text/event-stream |
X-Conversation-Id |
否 | 继续已有会话 |
当前支持参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
messages |
Array<{ role, content }> |
是 | 对话消息 |
temperature |
number |
否 | 自动归一化到 0~2 |
tools |
OpenAI tool[] |
否 | 透传到兼容链路 |
enableWebSearch |
boolean 或 0/1 或 "true"/"false" |
否 | 搜索开关 |
webSearch.enabled |
同上 | 否 | 与 enableWebSearch 同义 |
webSearch.mode |
"auto" 或 "force" |
否 | 默认 auto |
webSearch.maxResults |
number |
否 | 归一化 1~8,默认 5 |
webSearch.freshness |
"day" 或 "week" 或 "month" 或 "any" |
否 | 默认 week |
webSearch.lang |
"zh" 或 "en" 或 "auto" |
否 | 默认 auto |
返回行为
- 返回为
data: {json}的流式事件。 choices[0].delta.content为文本增量。- 使用工具时可能出现
choices[0].delta.tool_calls。 - 结束时
finish_reason为stop或tool_calls。 - 不依赖
data: [DONE]。
English version: HTTP SSE API