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两类接口使用的模型 ID
messagesarrayChat Completions 的消息列表
inputstring / arrayResponses 的文本或 Input Items
streamboolean启用流式响应
temperaturenumber调整生成随机性,支持范围取决于模型
previous_response_idstringResponses 用于继续已有响应状态

Chat Completions 使用 messages,Responses 使用 input。完整参数以对应 API Reference 为准;需要比较 Anthropic Messages、Gemini Generate Content 等入口时,请查看协议选择。

进一步了解

本页目录