API文档 - JuheNext
  1. OpenAI兼容格式
API文档 - JuheNext
  • OpenAI兼容格式
    • 普通对话
      POST
    • 识图模型
      POST
    • 流式输出
      POST
    • 结构化输出
      POST
    • Fouctions调用
      POST
    • 嵌入模型
      POST
    • 审查模型
      POST
    • Dalle绘图模型
      POST
    • tts文本转语音
      POST
    • 新绘图 - 图生图
      POST
    • 新绘图 - 文生图
      POST
    • 新response端点o3-pro
      POST
    • Gemini视频识别
      POST
    • GeminiPDF文件识别
      POST
    • 普通对话 Copy
      POST
  • Gemini原生格式
    • 普通对话
      POST
    • 图像生成
      POST
    • 音频生成
      POST
    • 结构化输出
      POST
    • 思考设置
      POST
    • 函数调用
      POST
    • PDF文件识别
      POST
    • 图像识别
      POST
    • 视频识别
      POST
    • Imagen图像生成 Copy
      POST
  • Anthropic原生格式
    • 普通对话
      POST
    • 图像识别
      POST
    • 函数调用
      POST
  • 列出支持的模型
    GET
  1. OpenAI兼容格式

结构化输出

POST
https://api.juheai.top/v1/chat/completions

请求参数

Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
Header 参数
Content-Type
string 
可选
示例值:
application/json
Body 参数application/json
object {0}
示例
{
    "model": "gpt-4o-2024-11-20",
    "messages": [
        {
            "role": "system",
            "content": "Extract the event information."
        },
        {
            "role": "user",
            "content": "Alice and Bob are going to a science fair on Friday."
        }
    ],
    "response_format": {
        "type": "json_schema",
        "json_schema": {
            "name": "CalendarEvent",
            "strict": true,
            "schema": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "date": {
                        "type": "string"
                    },
                    "participants": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "required": [
                    "name",
                    "date",
                    "participants"
                ],
                "additionalProperties": false
            }
        }
    }
}

示例代码

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.juheai.top/v1/chat/completions' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gpt-4o-2024-11-20",
    "messages": [
        {
            "role": "system",
            "content": "Extract the event information."
        },
        {
            "role": "user",
            "content": "Alice and Bob are going to a science fair on Friday."
        }
    ],
    "response_format": {
        "type": "json_schema",
        "json_schema": {
            "name": "CalendarEvent",
            "strict": true,
            "schema": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "date": {
                        "type": "string"
                    },
                    "participants": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "required": [
                    "name",
                    "date",
                    "participants"
                ],
                "additionalProperties": false
            }
        }
    }
}'

返回响应

🟢200成功
application/json
Body
object {0}
示例
{}
修改于 2025-06-26 06:36:36
上一页
流式输出
下一页
Fouctions调用
Built with