- 冰橙API概述
- 身份验证/获取token
- 文生文 对话生成
- 文生图 图像生成
- 文生音 音频生成
- 向量数据
- 其它
- 公众号服务接口
- 隐私政策
对话生成 GPT-4o-search 联网查询
开发环境
开发环境
POST
https://yewu.bcwhkj.cn/v1/chat/completions
token获取方式:#
请求参数
Header 参数
Content-Type
string
固定值
默认值:
application/json
Authorization
string
可选
默认值:
Bearer token
Body 参数application/json
messages
array [object {2}]
必需
role
enum<string>
必需
枚举值:
systemuserassistant
默认值:
user
content
string
提问的内容
model
enum<string>
必需
枚举值:
gpt-4ogpt-4-turbo-preview
默认值:
gpt-4o
stream
boolean
是否启用流式
默认值:
false
max_tokens
integer
回复的最大内容长度
默认值:
4000
示例
{
"messages": [
{
"role": "user",
"content": "2025年中国科技界发生了哪些大事?"
}
],
"model": "gpt-4o-search",
"max_tokens": 2000,
"stream": false
}
示例代码
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://yewu.bcwhkj.cn/v1/chat/completions' \
--header 'Authorization: Bearer token' \
--header 'Content-Type: application/json' \
--data-raw '{
"messages": [
{"role": "user", "content": "2025年中国科技界发生了哪些大事?"}
],
"model": "gpt-4o-search",
"max_tokens": 2000,
"stream": false
}'
返回响应
🟢200成功
application/json
Body
string
可选
示例
{
"id": "chatcmpl-b3e395e7-1cd8-4cd7-8d7a-b9155a23fd51",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "截至2025年4月28日,中国科技界已发生多项重大事件,以下是其中的几项:\n\n1. **神舟二十号载人飞船成功发射**:2025年4月24日17时17分,神舟二十号载人飞船在酒泉卫星发射中心成功发射升空。航天员陈冬、陈中瑞和王杰组成的乘组于当日23时49分与天宫空间站成功对接,开始为期约6个月的在轨驻留任务。 ([zh.wikipedia.org](https://zh.wikipedia.org/wiki/%E7%A5%9E%E8%88%9F%E4%BA%8C%E5%8D%81%E5%8F%B7?utm_source=openai))\n\n2. **神舟十九号任务圆满完成**:神舟十九号载人飞船于2024年10月30日发射,航天员蔡旭哲、宋令东和王浩泽在轨驻留约6个月,期间完成多项空间科学实验和技术试验。任务预计于2025年4月29日结束,航天员将返回地球。 ([zh.wikipedia.org](https://zh.wikipedia.org/wiki/%E7%A5%9E%E8%88%9F%E5%8D%81%E4%B9%9D%E5%8F%B7?utm_source=openai))\n\n3. **天问二号小行星探测任务即将启动**:中国计划于2025年5月29日发射天问二号探测器,执行对近地小行星2016 HO3的采样返回任务,并随后前往主带彗星P/2013 P5(又名311P)进行伴飞探测。整个任务预计持续约10年。 ([zh.wikipedia.org](https://zh.wikipedia.org/wiki/%E5%A4%A9%E5%95%8F%E4%BA%8C%E8%99%9F?utm_source=openai))\n\n4. **北斗系统升级技术攻关完成在即**:根据《北斗卫星导航系统2035年前发展规划》,中国计划在2025年完成北斗系统升级的技术攻关,为建设更先进、功能更强大的下一代北斗系统奠定基础。 ([ourchinastory.com](https://www.ourchinastory.com/cn/13848?utm_source=openai))\n\n5. **江门中微子实验项目即将投入运行**:位于地下700米的江门中微子实验(JUNO)探测设备预计于2025年8月完成全部灌注任务,开始正式运行。该项目将用于测量中微子质量顺序、超新星中微子、地球中微子等多项前沿研究。 ([ourchinastory.com](https://www.ourchinastory.com/cn/13848?utm_source=openai))\n\n这些事件体现了中国在航天、卫星导航和基础科学研究等领域的持续进步和创新。 ",
"annotations": [
{
"type": "url_citation",
"url_citation": {
"end_index": 271,
"start_index": 156,
"title": "神舟二十号",
"url": "https://zh.wikipedia.org/wiki/%E7%A5%9E%E8%88%9F%E4%BA%8C%E5%8D%81%E5%8F%B7?utm_source=openai"
}
},
{
"type": "url_citation",
"url_citation": {
"end_index": 500,
"start_index": 385,
"title": "神舟十九号",
"url": "https://zh.wikipedia.org/wiki/%E7%A5%9E%E8%88%9F%E5%8D%81%E4%B9%9D%E5%8F%B7?utm_source=openai"
}
},
{
"type": "url_citation",
"url_citation": {
"end_index": 727,
"start_index": 621,
"title": "天問二號",
"url": "https://zh.wikipedia.org/wiki/%E5%A4%A9%E5%95%8F%E4%BA%8C%E8%99%9F?utm_source=openai"
}
},
{
"type": "url_citation",
"url_citation": {
"end_index": 903,
"start_index": 824,
"title": "大事前瞻|2025年,中国这5件科技大事值得期待 | 航空航天 | 中国科技 | 当代中国",
"url": "https://www.ourchinastory.com/cn/13848?utm_source=openai"
}
},
{
"type": "url_citation",
"url_citation": {
"end_index": 1096,
"start_index": 1017,
"title": "大事前瞻|2025年,中国这5件科技大事值得期待 | 航空航天 | 中国科技 | 当代中国",
"url": "https://www.ourchinastory.com/cn/13848?utm_source=openai"
}
}
]
},
"logprobs": null,
"finish_reason": "stop"
}
],
"created": 1745813529,
"model": "gpt-4o-search-preview-2025-03-11",
"object": "chat.completion",
"usage": {
"prompt_tokens": 12,
"completion_tokens": 676,
"total_tokens": 688,
"completion_tokens_details": {
"audio_tokens": 0,
"reasoning_tokens": 0
},
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 0
}
},
"system_fingerprint": ""
}
修改于 2025-04-28 04:12:21