识图
POST
https://api.deerapi.com/v1/chat/completions
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.deerapi.com/v1/chat/completions' \
--header 'Authorization: Bearer {{api-key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-4.1",
"stream": false,
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "这张图片有什么"
},
{
"type": "image_url",
"image_url": {
"url": "https://github.com/dianping/cat/raw/master/cat-home/src/main/webapp/images/logo/cat_logo03.png"
}
}
]
}
],
"max_tokens": 400
}'
响应示例响应示例
{
"id": "chatcmpl-89DTTtIDEY6ymr6rWKpHXgf9hnJbU",
"object": "chat.completion",
"created": 1744700931,
"model": "gpt-4.1",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "In this image there is an abstract pattern of a cat in gradient blue and purple color with “CAT” written in capital letters. The whole design is simple and modern, with blue and purple colors. It looks like a logo."
},
"finish_reason": "stop"
}
],
"data": null,
"usage": {
"prompt_tokens": 1119,
"completion_tokens": 76,
"total_tokens": 1195,
"prompt_tokens_details": {
"CachedCreationTokens": 0,
"text_tokens": 92,
"cached_tokens_details": {}
},
"completion_tokens_details": {}
},
"error": {}
}
请求参数
Header 参数
Authorization
string
必需
示例值:
Bearer {{api-key}}
Body 参数application/json
返回响应
修改于 2025-04-15 07:08:38