Nebula Agent 对话补全

POST /chat/completions
CreateChatCompletion

一个兼容 OpenAI、无状态的 Nebula Agent 补全:每次发送完整对话。OpenAI SDK 可原样使用,model 会被忽略。按用量计费,最低 10 积分;usage.credits_used 会报告费用。stream: true 以服务器发送事件流式返回。MCP 上不可用。

此操作不支持钱包支付;请使用账号认证。x402 支付指南。

参数

此端点无参数。

cURL 示例

curl --request POST \
  --url 'https://nebula-api.hiddensystems.ai/api/v1/public/chat/completions' \
  --header 'X-API-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "messages": [
    {
      "content": "What changed in NVIDIA sentiment this week?",
      "role": "user"
    }
  ],
  "stream": false,
  "thinking_mode": "auto"
}'

响应

200 OK
400 错误请求
401 未授权
402 Credits 已用尽;响应中包含续期时间和已购买的 credit 余额
403 禁止访问
404 未找到
405 方法不被允许;Allow 响应头列出了支持的方法
429 请求过多
500 内部服务器错误
503 服务不可用

媒体类型 application/json

choices
array<object> 必填

生成的补全选项。

choices[].delta
object 可选

流式消息片段。

choices[].delta.content
string 可选

此流式片段中助手回复文本的部分内容。

choices[].delta.role
string 可选

此流式片段中输出时的对话角色。

choices[].finish_reason
string 可选

生成停止的原因(若可用)。

choices[].index
integer 必填

生成的补全选项的从零开始的索引。

choices[].message
object 可选

非流式响应中已完成的助手消息。

choices[].message.content
string 必填

已完成的助手回复文本。

choices[].message.role
string 必填

已完成消息的对话角色。

created
integer (int64) 必填

补全创建时的 Unix 时间戳。

id
string 必填

分配给该聊天补全的唯一标识符。

model
string 必填

Nebula 智能体模型标识符。

object
string 必填

OpenAI 兼容的对象类型。

usage
object 可选

此补全消耗的积分。

usage.credits_used
integer (int64) 必填

该请求消耗的 Nebula 积分。

{
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "NVIDIA sentiment strengthened this week as data-centre demand dominated discussion.",
        "role": "assistant"
      }
    }
  ],
  "created": 1786114800,
  "id": "chatcmpl_nebula_01",
  "model": "nebula-agent",
  "object": "chat.completion",
  "usage": {
    "credits_used": 10
  }
}