ChatKore API文档
  1. 聊天接口
ChatKore API文档
  • 发出请求
  • 帮助中心
    • 收费标准
    • 常见问题
  • 模型接口
    • 聊天接口
      • 聊天接口
        POST
    • 向量接口
      • 创建向量
    • 图像接口
      • 创建图像
      • 编辑图像
      • 生成图像的变体
    • 语音接口
      • tts文本转语音
      • 创建转录
      • 创建翻译
  1. 聊天接口

聊天接口

POST
https://api.chatkore.com/v1/chat/completions
给定一个提示,该模型将返回一个或多个预测的完成,并且还可以返回每个位置的替代标记的概率。
为提供的提示和参数创建完成

请求参数

Header 参数

Body 参数application/json

示例
{
    "model": "string",
    "messages": [
        {
            "content": "string",
            "role": "string",
            "tool_call_id": "string"
        }
    ],
    "max_tokens": 0,
    "top_p": 0,
    "logit_bias": null,
    "user": "string",
    "n": 0,
    "stop": "string",
    "stream": true,
    "presence_penalty": 0,
    "temperature": 0,
    "frequency_penalty": 0,
    "response_format": {
        "type": "string",
        "json_schema": {
            "description": "string",
            "name": "string",
            "strict": true,
            "schema": {}
        }
    },
    "seed": 0,
    "tools": [
        {
            "type": "string",
            "function": {
                "description": "string",
                "name": "string",
                "parameters": {}
            }
        }
    ],
    "tool_choice": "string"
}

请求示例代码

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.chatkore.com/v1/chat/completions' \
--header 'Authorization: Bearer sk-xxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "string",
    "messages": [
        {
            "content": "string",
            "role": "string",
            "tool_call_id": "string"
        }
    ],
    "max_tokens": 0,
    "top_p": 0,
    "logit_bias": null,
    "user": "string",
    "n": 0,
    "stop": "string",
    "stream": true,
    "presence_penalty": 0,
    "temperature": 0,
    "frequency_penalty": 0,
    "response_format": {
        "type": "string",
        "json_schema": {
            "description": "string",
            "name": "string",
            "strict": true,
            "schema": {}
        }
    },
    "seed": 0,
    "tools": [
        {
            "type": "string",
            "function": {
                "description": "string",
                "name": "string",
                "parameters": {}
            }
        }
    ],
    "tool_choice": "string"
}'

返回响应

🟢200成功
application/json
Body

示例
{
    "id": "string",
    "object": "string",
    "created": 0,
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "string",
                "content": "string",
                "tool_calls": [
                    {
                        "id": "string",
                        "type": "string",
                        "function": {
                            "name": "string",
                            "arguments": "string"
                        }
                    }
                ]
            },
            "finish_reason": "string"
        }
    ],
    "usage": {
        "prompt_tokens": 0,
        "completion_tokens": 0,
        "total_tokens": 0
    },
    "system_fingerprint": "string"
}
修改于 2025-01-20 04:21:18
上一页
常见问题
下一页
创建向量
Built with