Authorization: Bearer ********************
{
"model": "GLM-4-Flash",
"messages": [
{
"role": "system",
"content": "你是一个有帮助的助手"
},
{
"role": "user",
"content": "你好,请介绍一下你自己"
}
],
"temperature": 0.7,
"top_p": 0.9,
"stream": false
}
curl --location --request POST 'https://api.ecovai.cn/v1/chat/completions' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "GLM-4-Flash",
"messages": [
{
"role": "system",
"content": "你是一个有帮助的助手"
},
{
"role": "user",
"content": "你好,请介绍一下你自己"
}
],
"temperature": 0.7,
"top_p": 0.9,
"stream": false
}'
{
"id": "2024110712590918fafc6536764667",
"model": "",
"object": "chat.completion",
"created": 1730955551,
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我是一个人工智能助手,我的名字是 ChatGLM。我基于清华大学 KEG 实验室和智谱 AI 公司于 2024 年共同训练的语言模型 GLM-4 开发而成。我的任务是针对用户的问题和要求提供适当的答复和支持。由于我是一个计算机程序,所以我没有自我意识,但我会尽力帮助您解答问题或提供信息。有什么可以帮助您的吗?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 20,
"completion_tokens": 83,
"total_tokens": 103
}
}