- OpenAI通用接口
- 全能模型接口
- kimi
- 通义千问
- 智谱
- 秘塔搜索
- 讯飞星火
- 海螺
- deepseek
- Openai
- Suno(音乐)
- Midjourney(绘画)
- Flux(绘图)
- Recraft(绘图)
- Ideogram(绘画)
- Luma(视频)
- Runway(视频)
- 可灵(视频)
GPT-4o全能版(生成图片)
POST
https://api.ecovai.cn/v1/chat/completions
请求参数
Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token示例:
Authorization: Bearer ********************
Header 参数
Content-Type
string
必需
示例值:
application/json
Accept
string
必需
示例值:
application/json
Authorization
string
可选
示例值:
Bearer {{YOUR_API_KEY}}
Body 参数application/json
model
string
kimi
messages
array [object {2}]
必需
role
string
可选
content
string
可选
示例
{
"model": "gpt-4o-all",
"messages": [
{
"role": "user",
"content": "画一只猫"
}
]
}
示例代码
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.ecovai.cn/v1/chat/completions' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-4o-all",
"messages": [
{
"role": "user",
"content": "画一只猫"
}
]
}'
返回响应
🟢200OK
application/json
Body
id
string
必需
model
string
必需
object
string
必需
created
integer
必需
choices
array [object {3}]
必需
index
integer
可选
message
object
可选
finish_reason
string
可选
usage
object
必需
prompt_tokens
integer
必需
completion_tokens
integer
必需
total_tokens
integer
必需
示例
{
"id": "chatcmpl-89DzXhJ3dvHIbnUADjqaYgp5vVyf1",
"model": "gpt-4o-all",
"object": "chat.completion",
"created": 1730454367,
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "{\"prompt\":\"A realistic cat sitting gracefully, with a calm and curious expression, detailed fur, and expressive eyes. The background is soft and neutral to keep the focus on the cat. The cat is in a natural and comfortable position, conveying a peaceful demeanor. The lighting is soft to enhance the details of the fur and the texture.\",\"size\":\"1024x1024\"}\n\n\n\n[下载1](https://filesystem.site/cdn/download/20241101/r8OQfXQsP4uuv1lzIDEBTjVj5aVap6.webp)\n\n这里是一只优雅的小猫形象,具有温和、好奇的表情,栩栩如生。"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 11,
"completion_tokens": 183,
"total_tokens": 194
}
}
修改于 2024-11-01 09:48:02