LLM placeholder / LLM 接口预留
curl --request POST \
--url https://apistable.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "nova-chat-4",
"messages": [
{
"role": "user",
"content": "Hello"
}
],
"stream": true,
"fallback": false
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'nova-chat-4',
messages: [{role: 'user', content: 'Hello'}],
stream: true,
fallback: false
})
};
fetch('https://apistable.com/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apistable.com/v1/chat/completions"
payload = {
"model": "nova-chat-4",
"messages": [
{
"role": "user",
"content": "Hello"
}
],
"stream": True,
"fallback": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}接口参考
LLM 与流式输出
明确兼容范围与流式行为的 Chat Completions 接口。
POST
/
v1
/
chat
/
completions
LLM placeholder / LLM 接口预留
curl --request POST \
--url https://apistable.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "nova-chat-4",
"messages": [
{
"role": "user",
"content": "Hello"
}
],
"stream": true,
"fallback": false
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'nova-chat-4',
messages: [{role: 'user', content: 'Hello'}],
stream: true,
fallback: false
})
};
fetch('https://apistable.com/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apistable.com/v1/chat/completions"
payload = {
"model": "nova-chat-4",
"messages": [
{
"role": "user",
"content": "Hello"
}
],
"stream": True,
"fallback": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}当前为 API 预览。生成接口尚未接入供应商,成功认证后仍可能返回 503;不会创建任务或扣积分。
兼容能力按模型公布
计划提供 Chat Completions 兼容接口。应逐模型确认 messages、tools、结构化输出、视觉、上下文与 usage 支持,不能从端点名称推断完全兼容 OpenAI。 当前阶段尚未接入真实 LLM 供应商。示例说明预期请求,不应将虚构文本当作真实模型返回。流式输出影响恢复策略
- 尚未向客户端发送可见内容时,符合条件的明确失败可使用已授权 fallback。
- 发送文本、工具调用或其他可见 SSE 后,不能换供应商重启并拼接第二份答案。
- 客户端断开不自动免费;记录已知用量,未知计量按该模型已发布契约核对。
- 工具调用由你的应用执行;平台恢复流时不能重复触发工具动作。