- 本站介绍
- 更新日志
- 新版网站介绍
- 自助开票系统使用文档
- Telegram Bot使用文档
- 自建Cloudflare Worker反代教程
- Files文件存储服务 开放API
- OAuth开放API
- Midjourney、SD图像生成 API
- Midjourney开放API接口
- 其它图像生成API
- Flux图像生成
- 管理API列表
- Claude
- OpenAI
- 其它开放API
调用其它开放API
line1
line1
POST
/v1/chat/completions
general_api_access
请求参数
Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token示例:
Authorization: Bearer ********************
Body 参数application/json
object {0}
示例
{
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "user",
"content": "Say test"
}
],
"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://cn2us02.opapi.win/v1/chat/completions' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "user",
"content": "Say test"
}
],
"stream": false
}'
返回响应
🟢200成功
application/json
Body
object {0}
示例
{
"id": "chatcmpl-9jT4VhSGRX9BEU2w03C8PTIUxw16v",
"object": "chat.completion",
"created": 1720623539,
"model": "gpt-3.5-turbo-0125",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Test"
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 9,
"completion_tokens": 1,
"total_tokens": 10
},
"system_fingerprint": null
}
修改于 2024-07-10 15:29:29