curl --location 'https://4sapi.com/messages' \
--header 'Authorization: {{YOUR API KEY}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "glm-5.2",
"max_tokens": 1024,
"tools": [
{
"name": "get_weather",
"description": "获取指定城市的天气信息",
"input_schema": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "城市名称"
}
},
"required": [
"city"
]
}
}
],
"messages": [
{
"role": "user",
"content": "杭州今天天气怎么样?"
}
]
}'{}