1. API请求
智信AI-使用指南
  • 使用指南
    • 平台介绍
    • 使用指南
      • 快速开始
      • 注册账号
      • 账户充值
      • 新建API令牌
      • 获取BaseUrl
      • 系统令牌及用户ID
      • 余额查询接口
      • 计费规则
      • 平台管理类接口
        • 模型列表查询
        • 检索API令牌
        • 模型用量查询
        • 获取API令牌
    • 开发者文档
      • 基础核心概念
      • API请求
        • 平台通用格式
        • 文本对话(非流)
        • 文本对话(流式)
        • 输出JSON格式
        • 向量嵌入
        • 函数调用
        • 图片分析
        • Responses API
    • 接入指南
      • 编程工具
        • Cursor 配置指南
        • VSCode (Continue) 配置指南
        • Claude Code 配置指南
      • 应用集成
        • NextChat 配置指南
        • Open Claw 配置指南
        • Chatbox 配置指南
        • Dify 配置指南
  1. API请求

平台通用格式

平台通用统一请求格式 OpenAI请求格式#


概述:#

所有模型(包括非OpenAI格式的模型)的请求格式已统一转换为OpenAI格式,调用本平台可以统一使用OpenAI的格式发起调用和解析结果。

接口地址#

https://ai.hcrzx.com/v1/chat/completions

Python 代码示例#

import requests 
import json 

# API配置
url = "https://ai.hcrzx.com/v1/chat/completions"
headers = {
    'Accept': 'application/json',
    'Authorization': 'sk-*************************************',  # 替换为您的API密钥
    'Content-Type': 'application/json'
}

# 构建请求数据
payload = json.dumps({
    "model": "qwen3.6-plus-nothinking",                    # 使用的AI模型
    "messages": [
        {
            "role": "system",
            "content": "你是一个得力的助手."
        },
        {
            "role": "user",
            "content": "曹植是曹操的儿子吗?"
        },
        extra_body={
    "enable_thinking": true,
    "thinking_budget": 50
}
    ]
})

# 发送POST请求到API
response = requests.post(url, headers=headers, data=payload)

# 打印格式化的JSON响应结果
response_json = response.json()
print(json.dumps(response_json, indent=2, ensure_ascii=False))

执行结果#

{
  "choices": [
    {
      "message": {
        "content": "是的,曹植是曹操的儿子。他是曹操与正室卞夫人所生的第三子,也是建安时期著名的文学家,与父亲曹操、兄长曹丕并称为“三曹”。",
        "reasoning_content": "Here's a thinking process:\n\n1.  **Analyze User Input:**\n   - User asks: \"曹植是曹操的儿子吗?\" (Is Cao Zhi the son of Cao Cao?)\n   - Language: Chinese\n   - Topic: Historical figures from the Three Kingdoms period (Cao Cao and Cao Zhi)\n\n2.  **Identify Key Entities:**\n   - 曹操 (Cao Cao) - Warlord, founder of Cao Wei\n   - 曹植 (Cao Zhi) - Famous poet, son of Cao Cao\n\n3.  **Verify Historical Fact:**\n   - Cao Cao had many sons, including Cao Ang, Cao Pi, Cao Zhang, Cao Zhi, Cao Chong, etc.\n   - Cao Zhi (曹植, 192–232) was indeed the third son of Cao Cao (born to Lady Bian/卞夫人).\n   - This is a well-established historical fact recorded in official histories like *Records of the Three Kingdoms* (三国志).\n\n4.  **Formulate Response:**\n   - Confirm the fact clearly and concisely.\n   - Add brief relevant context if helpful (e.g., Cao Zhi's position among siblings, his fame as a poet, relationship with Cao Pi).\n   - Keep it accurate and neutral.\n   - Draft (mental): 是的,曹植是曹操的儿子。他是曹操与卞夫人所生的第三子,也是著名的文学家,与父亲曹操、兄长曹丕并称“三曹”。\n   - Check accuracy: Cao Zhi is indeed the third son (some sources say second surviving son, but generally recognized as third son overall). Mother is Lady Bian. \"三曹\" is correct. All accurate.\n\n5.  **Final Output Generation:** (matches the draft)\n   - Direct, accurate, concise, in Chinese.\n   - No extra fluff. Ready. \n   - Output matches the response.✅",
        "role": "assistant"
      },
      "finish_reason": "stop",
      "index": 0,
      "logprobs": null
    }
  ],
  "object": "chat.completion",
  "usage": {
    "prompt_tokens": 27,
    "completion_tokens": 461,
    "total_tokens": 488,
    "completion_tokens_details": {
      "reasoning_tokens": 415,
      "text_tokens": 461
    },
    "prompt_tokens_details": {
      "text_tokens": 27
    }
  },
  "created": 1778292734,
  "system_fingerprint": null,
  "model": "qwen3.6-plus",
  "id": "chatcmpl-62aae6e2-5015-939a-bc1b-ed67b167c7ad"
}
修改于 2026-05-12 07:45:25
上一页
基础核心概念
下一页
文本对话(非流)
Built with