AGTCloud API Docs
文件指南API Reference整合與資源更新與幫助

文字與對話

使用 Chat Completions 或 Responses 完成文字生成和多輪對話。

概述

AGTCloud 提供文字生成和多輪對話能力。選擇模型後,可以透過 Chat Completions、Responses 或模型支援的其他文字協議傳送請求。

核心能力

  • 文字生成:根據指示生成、改寫或補充內容。
  • 多輪對話:透過訊息歷史記錄或回應狀態延續上下文。
  • 摘要與分類:擷取重點,或依照指定類別整理內容。
  • 資訊擷取:從輸入文字中擷取所需欄位和結論。
  • 進階功能:Streaming、Tool Calling 和 Structured Output 的支援範圍取決於模型與協議。

API 串接

Base URL

https://api.agtcloud.cn/v1

Chat Completions

curl 'https://api.agtcloud.cn/v1/chat/completions' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer your-api-key' \
  --data '{
    "model": "MODEL_ID",
    "messages": [
      {"role": "system", "content": "請保持回答簡潔。"},
      {"role": "user", "content": "請用一句話介紹 AGTCloud。"}
    ]
  }'

Responses

curl 'https://api.agtcloud.cn/v1/responses' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer your-api-key' \
  --data '{
    "model": "MODEL_ID",
    "input": "請用一句話介紹 AGTCloud。"
  }'

常用參數

參數類型說明
modelstring兩種 API 使用的模型 ID
messagesarrayChat Completions 的訊息清單
inputstring / arrayResponses 的文字或 Input Items
streamboolean啟用串流回應
temperaturenumber調整生成隨機性,支援範圍取決於模型
previous_response_idstringResponses 用於延續既有回應狀態

Chat Completions 使用 messages,Responses 使用 input。完整參數請以對應的 API Reference 為準;如需比較 Anthropic Messages、Gemini Generate Content 等入口,請參閱協議選擇。

進一步了解

本頁目錄