GPT-5-2 API ๆฏๆฐไธไปฃๅคๆจกๆๆจกๅ๏ผๅ ทๅคๅ่ถ็ๆจ็่ฝๅ๏ผๆฏๆๆๆฌๅๅพๅ่พๅ ฅ๏ผๆไพ่็ฝๆ็ดขๅขๅผบๅ่ฝๅนถๆฏๆ่ฐ่ๆจ็ๅๅบฆใ
| ็นๆง | ๆ่ฟฐ |
|---|---|
| ๅคๆจกๆ | ๆฏๆๆๆฌๅๅพๅ่พๅ ฅ |
| ๅฎๆถๆ็ดข | ๅฏ็จ่็ฝๆ็ดขๅขๅผบ |
| ๆจ็ๅๅบฆ | ๅฏ่ฐ่ๆจ็ๅๅบฆ็บงๅซ |
| ็ตๆดป่ง่ฒ | ๆฏๆๅค็งๆถๆฏ่ง่ฒ |
messages ๅๆฐ็ content ๆฐ็ปไธญ๏ผ็ฎๅไป
ๆฏๆๅพๅใๆๆๅพๅๆไปถไฝฟ็จ็ธๅ็ๆ ผๅผ็ปๆ๏ผtype ๅญๆฎตๅง็ปไธบ "image_url"image_url ๅญๆฎตๅ็งฐไฟๆไธๅurl ๅผ๏ผๅฎๆๅ็ธๅบ็ๅพๅๅฐๅ{ type: 'image_url', image_url: { url: '...' } } ็ปๆใtools ๅๆฐๆฏไธไธชๅฏ้ๆฐ็ป๏ผๅ
่ฎธๆจๅฏ็จ่็ฝๆ็ดขๅขๅผบใ{
"type": "function",
"function": {
"name": "web_search"
}
}{
"id": "chatcmpl-example-123",
"object": "chat.completion",
"created": 1741569952,
"model": "gpt-5-2",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "ไฝ ๅฅฝ๏ผๆไปไนๅฏไปฅๅธฎไฝ ็ๅ๏ผ",
"refusal": null,
"annotations": []
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 50,
"total_tokens": 60
}
}curl --location 'https://api.emix.ai/gpt-5-2/v1/chat/completions' \
--header 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What is in this image?"
},
{
"type": "image_url",
"image_url": {
"url": "https://file.aiquickdraw.com/custom-page/akr/section-images/1759055072437dqlsclj2.png"
}
}
]
}
],
"tools": [
{
"type": "function",
"function": {
"name": "web_search"
}
}
],
"reasoning_effort": "high"
}'{
"id": "chatcmpl-example-123",
"object": "chat.completion",
"created": 1677652288,
"model": "gpt-5-2",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "string"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 50,
"total_tokens": 60
}
}