翻译API
POST
/v1/chat/completions由 伊莉思AGI 提供的免费 GPT-3.5-Turbo 模型,高并发 单个IP 20 QPS/秒
仅支持沉浸翻译JSON格式请求,不支持stream,不支持上下文
使用沉浸翻译
- 插件安装地址:https://immersivetranslate.com/docs/installation/
- 基本设置;选择一项翻译服务;选择 OpenAI, 填写任意APIKEY,每秒最大请求数20,
- 展开更多自定义选项,修改自定义 API 接口地址: https://translators.ylsagi.io/v1/chat/completions
参数说明
model 任意参数都指向 gpt-3.5-turbo
apiKey 任意或留空
请注意上下文长度最大8K
请注意QPS限速,长期超速IP拉入黑名单
请求参数
Header 参数
Content-Type
string
必需
示例值:
application/json
Authorization
string
必需
示例值:
{{token}}
Body 参数application/json
stream
boolean
可选
messages
array [object {2}]
必需
role
string
必需
content
string
必需
示例1
{
"stream": false,
"messages": [
{
"role": "user",
"content": "hi"
}
]
}
示例代码
返回响应
成功(200)
失败(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
choices
array [object {3}]
必需
finish_reason
string
可选
index
integer
可选
message
object
可选
created
integer
必需
id
string
必需
usage
object
必需
completion_tokens
integer
必需
prompt_tokens
integer
必需
total_tokens
integer
必需
model
string
必需
object
string
必需
示例
成功示例
{
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "Hello! How can I assist you today?",
"role": "assistant"
}
}
],
"created": 1712177550,
"id": "chatcmpl-9A1ssPPRigI2AEds1ltq0PD2cVA6p",
"usage": {
"completion_tokens": 0,
"prompt_tokens": 0,
"total_tokens": 0
},
"model": "gpt-3.5-turbo",
"object": "chat.completion"
}
最后修改时间: 7 个月前