UnifyLLM接口文档
  1. OpenAI兼容格式
UnifyLLM接口文档
  • UnifyLLM
  • OpenAI兼容格式
    • 普通对话
      POST
    • 识图模型
      POST
    • 识图模型base64
      POST
    • 流式输出
      POST
    • 结构化输出
      POST
    • Fouctions调用
      POST
    • 嵌入模型
      POST
    • 审查模型
      POST
    • GPT-image-1新绘图
      POST
    • 新绘图模型(逆向+流式)
      POST
    • Dalle绘图模型
      POST
    • tts文本转语音
      POST
    • 新response端点o3-pro
      POST
    • o4-mini输出思维链
      POST
  • Anthropic原生格式
    • 普通对话
    • 思考设置
    • 图像识别
    • 函数调用
  • Gemini原生格式
    • 普通对话
    • 图像生成
    • 音频生成
    • 结构化输出
    • 思考设置
    • 函数调用
    • PDF文件识别
    • 图像识别
    • 视频识别
    • Imagen图像生成 Copy
  • Midjourney绘图
    • 任务提交
      • 文生图 - Imagine
      • 关联按钮动作 - Action
      • 图生文 - Describe
      • 图像混合 - Blend
      • 局部重绘 - Modal
    • 任务查询
      • 多任务查询 - ListByCondition
      • 单任务查询 - FetchFromTask
      • Seed查询 - ImageSeed
  • 列出支持的模型
    GET
  1. OpenAI兼容格式

Fouctions调用

POST
https://apihk.unifyllm.top/v1/chat/completions

请求参数

Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
Header 参数

Body 参数application/json

示例
{
    "model": "gpt-4.1",
    "messages": [
        {
            "role": "user",
            "content": "What is the weather like in Boston today?"
        }
    ],
    "tools": [
        {
            "type": "function",
            "function": {
                "name": "get_current_weather",
                "description": "Get the current weather in a given location",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "location": {
                            "type": "string",
                            "description": "The city and state, e.g. San Francisco, CA"
                        },
                        "unit": {
                            "type": "string",
                            "enum": [
                                "celsius",
                                "fahrenheit"
                            ]
                        }
                    },
                    "required": [
                        "location"
                    ]
                }
            }
        }
    ],
    "tool_choice": "auto"
}

示例代码

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://apihk.unifyllm.top/v1/chat/completions' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gpt-4.1",
    "messages": [
        {
            "role": "user",
            "content": "What is the weather like in Boston today?"
        }
    ],
    "tools": [
        {
            "type": "function",
            "function": {
                "name": "get_current_weather",
                "description": "Get the current weather in a given location",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "location": {
                            "type": "string",
                            "description": "The city and state, e.g. San Francisco, CA"
                        },
                        "unit": {
                            "type": "string",
                            "enum": [
                                "celsius",
                                "fahrenheit"
                            ]
                        }
                    },
                    "required": [
                        "location"
                    ]
                }
            }
        }
    ],
    "tool_choice": "auto"
}'

返回响应

🟢200成功
application/json
Body

示例
{}
修改于 2025-07-12 05:05:44
上一页
结构化输出
下一页
嵌入模型
Built with