胜算云文档
胜算云
胜算云
  1. API手册
  • 快速入门
  • 更新公告
  • 使用指南
    • 账号指南
    • 开发者快速入门指南
    • VS Code插件快速入门指南
    • AI群聊快速入门指南
    • Claude Code接入胜算云API
  • 大厂模型
    • 联网搜索
    • 模型路由
    • 工具和函数调用
    • 错误处理
    • 常见问题
    • 使用案例
      • 在VS Code中使用Cline-中文版
      • cherry studio和chat box配置指南
      • 如何在KiloSSY中使用胜算云Router
      • 胜算云大模型API接入各大智能体平台
      • Roo code配置
      • MCP安装
      • VS Code Cline插件使用胜算云API
    • API手册
      • API 错误代码说明
      • 聊天补全
        POST
      • 文本向量化
        POST
      • 多模态向量化
        POST
      • 图像生成
        POST
      • 文本分词
        POST
      • 文本重排序
        POST
  • GPU租赁
    • GPU租赁与选型指南
    • 容器实例
    • 数据与存储
    • 费用相关
  • 条款与协议
    • 用户协议
    • 隐私政策
    • 用户充值协议
    • 付费充值协议
    • 使用条款
    • 数据安全协议和分析
  1. API手册

聊天补全

POST
https://router.shengsuanyun.com/api/v1/chat/completions
与AI模型进行多轮对话
请求示例请求示例
Shell
JavaScript
Java
Swift
cURL
curl --location --request POST 'https://router.shengsuanyun.com/api/v1/chat/completions' \
--header 'HTTP-Referer: https://www.postman.com' \
--header 'X-Title: Postman' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "deepseek/deepseek-v3",
    "stream": true,
    "messages": [
        {
            "role": "user",
            "content": "你好"
        }
    ],
    "stream_options": {
        "include_usage": true
    }
}'
响应示例响应示例
200 - 非流式响应
{
    "id": "20250410143202432620157mDT6DvdC",
    "provider": "OpenRouter",
    "model": "anthropic/claude-3.7-sonnet",
    "object": "chat.completion",
    "created": 1744266722,
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "I don't have the ability to check real-time weather information for Shanghai or any other location. To get accurate and current weather information for Shanghai, you could:\n\n1. Check a weather website or app such as Weather.com, AccuWeather, or a local Chinese weather service\n2. Search for \"上海天气\" (Shanghai weather) on a search engine\n3. Look at the weather function on your smartphone\n4. Check local Shanghai news websites\n\nIf you need current weather information, these sources will provide you with accurate forecasts, temperature, precipitation chances, and other relevant weather data for Shanghai today."
            },
            "finish_reason": "stop"
        }
    ],
    "usage": {
        "prompt_tokens": 16,
        "completion_tokens": 133,
        "total_tokens": 149
    }
}

请求参数

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

Body 参数application/json

示例

返回响应

🟢200成功
application/json
请求成功
Body

🟠400请求有误
修改于 2025-06-24 04:46:07
上一页
API 错误代码说明
下一页
文本向量化
Built with