跳转到文档
打开控制台
本页内容

文本聊天

直接使用文本模型并跟踪实际输入、输出和缓存用量。

文本模型#

curl -X POST 'https://platform.tongai.io/v1/tools/tong_text_models/operations' \  -H "Authorization: Bearer $TONG_API_KEY" \  -H "Content-Type: application/json" \  -d '{  "input": {}}'
配置
curl --version

文本费率为展示上限。实际输入、输出和缓存用量分别计费。

获取文本消息报价#

curl -X POST 'https://platform.tongai.io/v1/tools/tong_text_quote/operations' \  -H "Authorization: Bearer $TONG_API_KEY" \  -H "Content-Type: application/json" \  -H "Idempotency-Key: 45be69f1-c266-4a09-a82c-bf3c6303eb03" \  -d '{  "input": {    "body": {      "model": "tong_5c5b990cb58f50dd87ef1ef6",      "prompt": "Write a short scene at blue hour.",      "maxOutputTokens": 1024    }  }}'
配置
curl --version

发送文本消息#

curl -X POST 'https://platform.tongai.io/v1/tools/tong_text_submit/operations' \  -H "Authorization: Bearer $TONG_API_KEY" \  -H "Content-Type: application/json" \  -H "Idempotency-Key: 45be69f1-c266-4a09-a82c-bf3c6303eb03" \  -d '{  "input": {    "body": {      "quoteId": "000000000000000000000002"    }  }}'
配置
curl --version

文本对话历史#

curl -X POST 'https://platform.tongai.io/v1/tools/tong_text_history/operations' \  -H "Authorization: Bearer $TONG_API_KEY" \  -H "Content-Type: application/json" \  -d '{  "input": {    "params": {      "id": "aaaaaaaaaaaaaaaaaaaaaaaa"    }  }}'
配置
curl --version

积分消耗和钱包扣款分开统计。文本聊天可以使用此前已充值的余额。