胜算云文档
胜算云
胜算云
  1. API手册
  • 快速入门
  • 更新公告
  • 使用指南
    • 账号指南
    • 开发者快速入门指南
    • Claude Code / Agent 接入胜算云API
    • CodeX 接入胜算云API
    • LangBot 接入胜算云API
    • VS Code插件快速入门指南
    • AI群聊快速入门指南
    • 使用Cherry Studio接入胜算云API
    • 使用LobeChat接入胜算云API
  • 大厂模型-大语言
    • 联网搜索
    • 模型路由
    • 工具和函数调用
    • 错误处理
    • 常见问题
    • 使用案例
      • 在VS Code中使用Cline-中文版
      • cherry studio和chat box配置指南
      • 如何在KiloSSY中使用胜算云Router
      • 胜算云大模型API接入各大智能体平台
      • Roo code配置
      • MCP安装
      • VS Code Cline插件使用胜算云API
    • API手册
      • API 错误代码说明
      • 获取APIKey详情
        GET
      • 聊天补全
        POST
      • 文本向量化
        POST
  • 大厂模型-多媒体
    • 支持的模型(逐步更新)
    • 基础接口
      • 任务提交 API
      • 查询任务结果 API
      • 同步图像生成API
    • API文档
      • 阿里Paraformer
        • Paraformer-v2音频转录-异步
      • 可灵
        • 可灵 API
        • 可灵视频生成
      • 通义千问
        • 千问图像生成/编辑-异步
        • 千问图像编辑-同步
      • 即梦
        • 即梦生图参数详解
        • 即梦视频生成
        • 即梦生图
      • 豆包
        • 豆包视频生成参数详解
        • 豆包生视频-异步
        • 豆包生图-异步
        • 豆包生图-同步
      • Google
        • Veo3 视频生成 API
        • Gemini-2.5-flash-image-preview
        • Veo3视频生成
        • 🍌图像生成-异步
        • 🍌图像生成-同步
        • 🍌图像生成-Chat接口
      • Minimax
        • 视频生成 API
        • Minimax视频生成
      • Vidu
        • 视频生成 API
        • Vidu视频生成
      • OpenAI
        • Sora 视频生成 API
        • Image1 图像生成
        • sora视频生成
        • Image1图像生成-同步
        • Image1图像生成-异步
        • Whisper1音频转录-同步
        • Whisper1音频转录-异步
      • 火山引擎
        • 火山引擎图片处理
      • Runway
        • 视频生成
      • 查询任务状态
  • GPU租赁
    • GPU租赁与选型指南
    • 容器实例
    • 数据与存储
    • 费用相关
  • 条款与协议
    • 用户协议
    • 隐私政策
    • 用户充值协议
    • 付费充值协议
    • 使用条款
    • 数据安全协议和分析
  1. API手册

聊天补全

POST
https://router.shengsuanyun.com/api/v1/chat/completions
与AI模型进行多轮对话

请求参数

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

Body 参数application/json

示例

返回响应

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

🟠400请求有误
请求示例请求示例
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 'Authorization: Bearer <token>' \
--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
    }
}
修改于 2025-09-10 08:17:47
上一页
获取APIKey详情
下一页
文本向量化
Built with