接入文档

接入文档

使用平台 API 地址和生产 Key,即可调用汇元汇能 GPT 模型。

生成 Key

1. 快速开始

curl https://huiyuanhuineng.com/v1/chat/completions \
  -H "Authorization: Bearer sk-xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.4-mini",
    "messages": [
      {"role": "user", "content": "Hello"}
    ]
  }'

2. API 地址

https://huiyuanhuineng.com/v1

请以控制台展示的 API 地址为准。

3. API Key

在令牌管理中创建 `sk-` 开头的生产 Key。完整 Key 只显示一次,请创建后立即保存。

4. Python 示例

from openai import OpenAI

client = OpenAI(
    api_key="sk-xxxx",
    base_url="https://huiyuanhuineng.com/v1"
)

response = client.chat.completions.create(
    model="gpt-5.4-mini",
    messages=[
        {"role": "user", "content": "Hello"}
    ]
)

print(response.choices[0].message.content)

5. Node.js 示例

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "sk-xxxx",
  baseURL: "https://huiyuanhuineng.com/v1"
});

const response = await client.chat.completions.create({
  model: "gpt-5.4-mini",
  messages: [
    { role: "user", content: "Hello" }
  ]
});

console.log(response.choices[0].message.content);

6. 客户端配置

自定义 API Provider
API 地址: https://huiyuanhuineng.com/v1
API Key: sk-xxxx
Model: gpt-5.5 / gpt-5.4 / gpt-5.4-mini / gpt-5.3-codex / gpt-5.2

7. Cherry Studio 配置

供应商:自定义 API
API 地址:https://huiyuanhuineng.com/v1
API Key:sk-xxxx
模型:从 /v1/models 拉取或手动填写

8. Open WebUI 配置

OPENAI_API_BASE_URL=https://huiyuanhuineng.com/v1
OPENAI_API_KEY=sk-xxxx

9. 常见错误

  • 401:API Key 缺失、无效或已禁用。
  • 402:余额不足。
  • 404 model not found:模型 ID 不存在或暂未开放。
  • 429:触发限流,请降低并发或联系管理员。
  • 5xx:服务暂时异常,请稍后重试或联系客服。

10. 模型价格说明

页面展示的是平台额度价格。实际扣费以 GPT 模型页和使用记录为准。