Chat Bp
  1. 聊天接口(Chat)
Chat Bp
  • OpenAI通用接口
    • 聊天接口(Chat)
      • 聊天接口(OpenAI格式通用)
        POST
      • gpts
        POST
      • gemini-pro
        POST
      • gpt-4-all(分析图片)
        POST
      • gpt-4-vision-preview
        POST
    • 图像接口(Images)
      • 图像生成
      • 图像编辑
      • 异步任务查询
    • 帮助中心
      • 常见问题及解决办法
  • Anthropic
    • Anthropic Claude
      POST
  • gemini
    • Gemini多模态
      POST
  • Midjourney API文档
    • 快速教学-完整流程一遍过
    • 任务提交
      • 提交Imagine任务
      • 提交Action任务
      • 提交Blend任务
      • 提交Modal任务
      • 提交Describe任务
      • 提交Shorten任务
      • 提交SwapFace任务
      • 提交Video任务
      • 上传文件到discord
    • 任务查询
      • 指定id查询任务
      • 指定id列表查询任务
      • 获取任务图片的seed
  • gpt-4-all(生成图片)
    POST
  1. 聊天接口(Chat)

gpt-4-vision-preview

POST
/v1/chat/completions

请求参数

Header 参数

Body 参数application/json

示例
{
    "model": "gpt-4-vision-preview",
    "stream": false,
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "这张图片有什么"
                },
                {
                    "type": "image_url",
                    "image_url": {
                        "url": "https://github.com/dianping/cat/raw/master/cat-home/src/main/webapp/images/logo/cat_logo03.png"
                    }
                }
            ]
        }
    ],
    "max_tokens": 400
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/v1/chat/completions' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gpt-4-vision-preview",
    "stream": false,
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "这张图片有什么"
                },
                {
                    "type": "image_url",
                    "image_url": {
                        "url": "https://github.com/dianping/cat/raw/master/cat-home/src/main/webapp/images/logo/cat_logo03.png"
                    }
                }
            ]
        }
    ],
    "max_tokens": 400
}'

返回响应

🟢200成功
application/json
Body

示例
{
    "id": "chatcmpl-123",
    "object": "chat.completion",
    "created": 1677652288,
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "\n\nHello there, how may I assist you today?"
            },
            "finish_reason": "stop"
        }
    ],
    "usage": {
        "prompt_tokens": 9,
        "completion_tokens": 12,
        "total_tokens": 21
    }
}
修改于 2024-12-15 07:31:07
上一页
gpt-4-all(分析图片)
下一页
图像生成
Built with