UniAPI API Doc
首页全部OpenAI平台接口音乐模型图像模型视频模型
首页全部OpenAI平台接口音乐模型图像模型视频模型
  1. Chat
  • OpenAI
    • Audio
      • 文本生成音频
      • 音频转文本
      • 创建转录
    • Chat
      • 聊天接口
        POST
    • Completions
      • 自动补全
    • Embeddings
      • 向量接口
    • Images
      • 图像编辑
      • 图像生成
      • 图像变体
    • Models
      • 获取模型列表
    • Moderations
      • 审核
    • Responses
      • response
  • 平台接口
    • 余额
      GET
  • 音乐模型
    • Suno
      • 灵感模式
      • 自定义模式
      • 上传音频自定义
      • 声曲分离
      • 文件上传
        • 2. 上传音频
        • 说明文件
        • 3. 报告上传完成
        • 1.获取上传地址
        • 4. 查询上传状态
        • 5. 音频初始化
      • 声曲分离 (已弃用)
      • 歌词、音频时间线
      • 获取 wav 格式文件
      • 生成 mp4 mv 视频
      • 创建音乐
      • 拼接音乐
      • 创建歌词
      • 批量获取任务
      • 查询单个任务
  • 图像模型
    • MidJourney
      • API接入说明类型
      • 任务提交
        • 提交Imagine任务(文生图、文图生图)
        • 提交Blend任务(图生图)
        • 提交Describe任务(图生文)
        • 提交Shorten任务(prompt分析)
        • 执行动作(所有的关联按钮动作UPSCALE; VARIATION; REROLL; ZOOM等)
        • 提交Modal(提交局部重绘、ZOOM)
        • 上传图片获得url
        • 绘图变化(UPSCALE; VARIATION; REROLL)
        • 绘图变化-simple(UPSCALE; VARIATION; REROLL)
      • 换脸
        • 提交swap_face任务
      • 查询任务
        • 根据ID列表查询任务
        • 指定ID获取任务
        • 获取任务图片的seed
    • ideogram
      • Generates(文生图)
      • Remix(混合图)
      • Upscale(放大高清)
      • Describe(描述)
    • FalAI
      • Openai 格式
      • 提交任务
      • 获取任务状态
      • 获取任务结果
    • 即梦
      • Openai 格式
    • Kling
      • 图像生成(文生图/图生图)
      • 图像生成 获取状态
      • 虚拟试穿
      • 虚拟试穿 获取状态
  • 视频模型
    • Luma
      • 生成视频
      • 扩展视频
      • 获取下载地址
      • 获取任务
    • FalAI
      • 调用说明
      • 提交任务
      • 获取任务状态
      • 获取任务结果
    • Kling
      • 图像生成(文生图/图生图)
      • 图像生成 获取状态
      • 文生视频
      • 文生视频 获取状态
      • 图生视频
      • 图生视频 获取状态
      • 虚拟试穿
      • 虚拟试穿 获取状态
  1. Chat

聊天接口

POST
/v1/chat/completions
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.uniapi.io/v1/chat/completions' \
--header 'Content-Type: application/json' \
--data-raw '{
    "metadata": {
        "property1": "string",
        "property2": "string"
    },
    "temperature": 1,
    "top_p": 1,
    "user": "user-1234",
    "service_tier": "auto",
    "messages": [
        {
            "content": "string",
            "role": "developer",
            "name": "string"
        }
    ],
    "model": "string",
    "modalities": [
        "text"
    ],
    "reasoning_effort": "medium",
    "max_completion_tokens": 0,
    "frequency_penalty": 0,
    "presence_penalty": 0,
    "web_search_options": {
        "user_location": {
            "type": "approximate",
            "approximate": {
                "country": "string",
                "region": "string",
                "city": "string",
                "timezone": "string"
            }
        },
        "search_context_size": "medium"
    },
    "top_logprobs": 0,
    "response_format": {
        "type": "text"
    },
    "audio": {
        "voice": "string",
        "format": "wav"
    },
    "store": false,
    "stream": false,
    "stop": "<|endoftext|>",
    "logit_bias": null,
    "logprobs": false,
    "max_tokens": 0,
    "n": 1,
    "prediction": {
        "type": "content",
        "content": "string"
    },
    "seed": -9223372036854776000,
    "stream_options": null,
    "tools": [
        {
            "type": "function",
            "function": {
                "description": "string",
                "name": "string",
                "parameters": {},
                "strict": false
            }
        }
    ],
    "tool_choice": "none",
    "parallel_tool_calls": true,
    "function_call": "none",
    "functions": [
        {
            "description": "string",
            "name": "string",
            "parameters": {}
        }
    ]
}'
响应示例响应示例
{
    "id": "string",
    "choices": [
        {
            "finish_reason": "stop",
            "index": 0,
            "message": {
                "content": "string",
                "refusal": "string",
                "tool_calls": [
                    {
                        "id": "string",
                        "type": "function",
                        "function": {
                            "name": "string",
                            "arguments": "string"
                        }
                    }
                ],
                "annotations": [
                    {
                        "type": "url_citation",
                        "url_citation": {
                            "end_index": 0,
                            "start_index": 0,
                            "url": "string",
                            "title": "string"
                        }
                    }
                ],
                "role": "assistant",
                "function_call": {
                    "arguments": "string",
                    "name": "string"
                },
                "audio": {
                    "id": "string",
                    "expires_at": 0,
                    "data": "string",
                    "transcript": "string"
                }
            },
            "logprobs": {
                "content": [
                    {
                        "token": "string",
                        "logprob": 0,
                        "bytes": [
                            0
                        ],
                        "top_logprobs": [
                            {
                                "token": "string",
                                "logprob": 0,
                                "bytes": [
                                    0
                                ]
                            }
                        ]
                    }
                ],
                "refusal": [
                    {
                        "token": "string",
                        "logprob": 0,
                        "bytes": [
                            0
                        ],
                        "top_logprobs": [
                            {
                                "token": "string",
                                "logprob": 0,
                                "bytes": [
                                    0
                                ]
                            }
                        ]
                    }
                ]
            }
        }
    ],
    "created": 0,
    "model": "string",
    "service_tier": "auto",
    "system_fingerprint": "string",
    "object": "chat.completion",
    "usage": {
        "completion_tokens": 0,
        "prompt_tokens": 0,
        "total_tokens": 0,
        "completion_tokens_details": {
            "accepted_prediction_tokens": 0,
            "audio_tokens": 0,
            "reasoning_tokens": 0,
            "rejected_prediction_tokens": 0
        },
        "prompt_tokens_details": {
            "audio_tokens": 0,
            "cached_tokens": 0
        }
    }
}

请求参数

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

示例

返回响应

🟢200成功
application/json
OK
Body

修改于 2025-05-18 07:36:21
上一页
创建转录
下一页
自动补全
Built with