{
"model": "deepseek-v4-flash-0731",
"messages": [
{
"content": "You are a helpful assistant",
"role": "system"
},
{
"content": "Hi,今天广州天气怎么样",
"role": "user"
}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get weather of a location, the user should supply a location first.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA",
}
},
"required": [
"location"
]
}
}
}
]
}curl --location '/v1/chat/completions' \
--header 'Accept: application/json' \
--header 'Authorization: sk-xxx' \
--header 'Content-Type: application/json' \
--data '{
"model": "deepseek-v4-flash-0731",
"messages": [
{
"content": "You are a helpful assistant",
"role": "system"
},
{
"content": "Hi,今天广州天气怎么样",
"role": "user"
}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get weather of a location, the user should supply a location first.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA",
}
},
"required": [
"location"
]
}
}
}
]
}'{
"id": "xxx",
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "Hello! How can I help you today?",
"role": "assistant"
}
}
],
"created": 1705651092,
"model": "deepseek-v4-flash",
"object": "chat.completion",
"usage": {
"completion_tokens": 10,
"prompt_tokens": 16,
"total_tokens": 26
}
}