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 額度已用完;回應會包含續約時間與已購買的額度餘額
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 必填

所產生完成選項的索引(從 0 起算)。

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
  }
}