UniAPI API Doc
首页全部OpenAI平台接口音乐模型图像模型视频模型
首页全部OpenAI平台接口音乐模型图像模型视频模型
  1. Completions
  • Audio
    • 文本生成音频
      POST
    • 音频转文本
      POST
    • 创建转录
      POST
  • Chat
    • 聊天接口
      POST
  • Completions
    • 自动补全
      POST
  • Embeddings
    • 向量接口
      POST
  • Images
    • 图像编辑
      POST
    • 图像生成
      POST
    • 图像变体
      POST
  • Models
    • 获取模型列表
      GET
  • Moderations
    • 审核
      POST
  • Responses
    • response
      POST
  1. Completions

自动补全

POST
/v1/completions
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.uniapi.io/v1/completions' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "string",
    "prompt": "",
    "best_of": 1,
    "echo": false,
    "frequency_penalty": 0,
    "logit_bias": null,
    "logprobs": null,
    "max_tokens": 16,
    "n": 1,
    "presence_penalty": 0,
    "seed": 0,
    "stop": "<|endoftext|>",
    "stream": false,
    "stream_options": null,
    "suffix": null,
    "temperature": 1,
    "top_p": 1,
    "user": "user-1234"
}'
响应示例响应示例
{
    "id": "string",
    "choices": [
        {
            "finish_reason": "stop",
            "index": 0,
            "logprobs": {
                "text_offset": [
                    0
                ],
                "token_logprobs": [
                    0
                ],
                "tokens": [
                    "string"
                ],
                "top_logprobs": [
                    {
                        "property1": 0,
                        "property2": 0
                    }
                ]
            },
            "text": "string"
        }
    ],
    "created": 0,
    "model": "string",
    "system_fingerprint": "string",
    "object": "text_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