ChatGPT API 中文文档
  1. 图像接口(Images)
ChatGPT API 中文文档
  • 导言
  • 发出请求
  • 模型(Models)
    • 模型对象
    • 列出模型
      GET
  • 聊天接口(Chat)
    • API聊天完成响应对象
    • 聊天接口
      POST
    • gpt-4-turbo
      POST
    • gpt-4-vision-preview
      POST
    • gpt-4-V(支持分析图片URL)
      POST
    • gpt-4-all(联网、绘图等)
      POST
    • gpts
      POST
    • gemini-pro
      POST
    • gemini-pro-vision
      POST
    • gpt-4-turbo Copy
      POST
  • 自动补全接口(Completions)
    • API完成响应对象
    • 内容补全接口
      POST
  • 图像接口(Images)
    • DALL·E 3
      POST
    • Stable-Diffusion
      POST
  • 向量生成接口(Embeddings)
    • 嵌入对象
    • 创建嵌入
      POST
  • 音频接口(Audio)
    • 创建转录
      POST
    • 创建翻译
      POST
    • TTS文本转语音
      POST
  • Midjourney
    • 提交Imagine任务(文生图、文图生图)
    • 上传图片至discord
    • 绘图变化(UPSCALE; VARIATION; REROLL)
    • 执行动作(所有的关联按钮动作UPSCALE; VARIATION; REROLL; ZOOM等)
    • 提交Blend任务(图生图)
    • 提交Describe任务(图生文)
    • 提交Modal(提交局部重绘、ZOOM)
    • 提交Shorten任务(prompt分析)
    • 提交swap_face任务
    • 根据ID获取图片
    • 根据ID列表查询任务
    • 指定ID获取任务
    • 获取任务图片的seed
  • 帮助中心
    • 常见问题及解决办法
  1. 图像接口(Images)

Stable-Diffusion

POST
/v1/chat/completions
逆向stable-diffusion实现API形式调用,兼容chat请求格式,messages直接输入sd绘画prompt

请求参数

Header 参数

Body 参数application/json

示例
{
  "model": "stable-diffusion",
  "messages": [{"role": "user", "content": "striking poses, stunning backdrop of rocky coastline and golden hour lighting, fashion-forward wardrobe, eye-catching accessories, warm and inviting color palette, sharp and detailed digital rendering, stunning high definition finish, on eye level, scenic, masterpiece"}]
}

请求示例代码

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.pro365.top/v1/chat/completions' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data-raw '{
  "model": "stable-diffusion",
  "messages": [{"role": "user", "content": "striking poses, stunning backdrop of rocky coastline and golden hour lighting, fashion-forward wardrobe, eye-catching accessories, warm and inviting color palette, sharp and detailed digital rendering, stunning high definition finish, on eye level, scenic, masterpiece"}]
}'

返回响应

🟢200OK
application/json
Body

示例
{
    "id": "chatcmpl-89DnosjPTOPBDQqI8geuIcDWVs1up",
    "object": "chat.completion",
    "created": 1705053450,
    "model": "stable-diffusion",
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "绘制中..\n![striking poses, stunning backdrop of rocky coastline and golden hour lighting, fashionforward wardrobe, eyecatching accessories, warm and inviting color palette, sharp and detailed digital rendering, stunning high definition finish, on eye level, scenic, masterpiece](https://qph.cf2.poecdn.net/main-sdxl_3eb26dedc4f25bc8281d9a7faf64134d45cb7f6538535d3eeccda6cb4edbf02c.png?w=1024&h=1024)"
            },
            "finish_reason": "stop"
        }
    ],
    "usage": {
        "prompt_tokens": 46,
        "completion_tokens": 119,
        "total_tokens": 165
    }
}
修改于 2024-03-26 06:33:16
上一页
DALL·E 3
下一页
嵌入对象
Built with