ChatPlus API
  1. ChatPlus API
ChatPlus API
  • 发送测试请求
  • HTTP状态码含义
  • ChatPlus API
    • 文字对话聊天
      POST
    • 文字转换语音
      POST
    • 语音转换文字
      POST
    • 语音翻译英文
      POST
    • 文字转换图片
      POST
    • 图片内容识别
      POST
    • gpt-4逆向画图
      POST
    • 谷歌gemini-pro
      POST
    • SunoAI音乐生成
      POST
    • Midjourney绘图
      POST
    • Midjourney查询
      POST
  1. ChatPlus API

gpt-4逆向画图

POST
/v1/chat/completions
gpt-4-dalle逆向模型画图。
支持的模型:gpt-4-dalle

请求参数

Header 参数
Content-Type
string 
必需
在HTTP的请求Header中添加参数Content-Type POST请求主体类型为application/json
示例值:
application/json
Authorization
string 
必需
在HTTP的请求Header中添加参数Authorization,其值为在Bearer之后拼接以sk-开头的令牌API KEY的值。
示例值:
Bearer {{API_KEY}}
Body 参数application/json
model
string 
必需
messages
array [object {2}] 
必需
role
string 
可选
content
string 
可选
示例
{
    "model": "gpt-4-dalle",
    "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://chatplusapi.cn/v1/chat/completions' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gpt-4-dalle",
    "messages": [
        {
            "role": "user",
            "content": "帮我画一只顽皮的小狗在花园里面捉蝴蝶"
        }
    ]
}'

返回响应

🟢200成功
application/json
Body
id
string 
必需
object
string 
必需
created
integer 
必需
model
string 
必需
choices
array [object {3}] 
必需
index
integer 
可选
message
object 
可选
finish_reason
string 
可选
usage
object 
必需
prompt_tokens
integer 
必需
completion_tokens
integer 
必需
total_tokens
integer 
必需
示例
{
    "id": "chatcmpl-89DR6PhGsYk8KaOSIigXkcJHIw2yT",
    "object": "chat.completion",
    "created": 1715100919,
    "model": "gpt-4-dalle",
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "\n```json dalle-prompt\n {\"prompt\":\"Draw a mischievous little dog catching butterflies in the garden. The dog has floppy ears, a wagging tail, and a playful expression on its face. It is running through a lush garden filled with colorful flowers and fluttering butterflies. The dog's fur is a golden brown color, and it has white patches on its chest and paws. The butterflies have vibrant wings with various shades of blue, yellow, and orange. The garden is bathed in warm sunlight, casting dappled shadows on the grass and flowers.\"}\n```\n\n\n![image1](https://filesystem.site/cdn/20240508/4RrrGN82bD9YLNOtMSganUaf2nsjXB.webp)![image2](https://filesystem.site/cdn/20240508/zTTVZahow9NuEnggAqy4YhknuqBmF9.webp)\n\n[下载1](https://filesystem.site/cdn/download/20240508/4RrrGN82bD9YLNOtMSganUaf2nsjXB.webp)\t[下载2](https://filesystem.site/cdn/download/20240508/zTTVZahow9NuEnggAqy4YhknuqBmF9.webp)\n\nHere are two images of a mischievous little dog catching butterflies in the garden. You can see the dog with floppy ears, a wagging tail, and a playful expression on its face, running through a lush garden filled with colorful flowers and fluttering butterflies. The dog's fur is golden brown with white patches on its chest and paws, and the butterflies have vibrant wings with shades of blue, yellow, and orange. The garden is bathed in warm sunlight, creating dappled shadows on the grass and flowers."
            },
            "finish_reason": "stop"
        }
    ],
    "usage": {
        "prompt_tokens": 37,
        "completion_tokens": 380,
        "total_tokens": 417
    }
}
🟠403失败
修改于 2024-05-08 07:08:42
上一页
图片内容识别
下一页
谷歌gemini-pro
Built with