图像识别
POST
https://api.gptacg.top/v1/messages
请求参数
Header 参数
x-api-key
string
可选
anthropic-version
string
可选
示例值:
2023-06-01
content-type
string
可选
示例值:
application/json
Body 参数application/json
object {0}
示例
{
"model": "claude-3-7-sonnet-20250219",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": [
{
"type": "image",
"source": {
"type": "base64",
"media_type": "image/jpeg",
"data": "/9j/4AAQSkZJRg...",
}
},
{
"type": "text",
"text": "What is in this image?"
}
]
}
]
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.gptacg.top/v1/messages' \
--header 'x-api-key;' \
--header 'anthropic-version: 2023-06-01' \
--header 'content-type: application/json' \
--data-raw '{
"model": "claude-3-7-sonnet-20250219",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": [
{
"type": "image",
"source": {
"type": "base64",
"media_type": "image/jpeg",
"data": "/9j/4AAQSkZJRg...",
}
},
{
"type": "text",
"text": "What is in this image?"
}
]
}
]
}'
返回响应
🟢200成功
application/json
Body
object {0}
示例
{}
修改于 2025-06-19 07:11:57