Files
haiyushuke-website/content/getting-started.mdx
2026-06-16 14:34:09 +08:00

45 lines
1.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: 快速开始
description: 五分钟完成 API Key 创建与首次调用
---
# 快速开始
按以下步骤即可在海宇数科平台完成首次模型调用。
## 1. 注册并登录控制台
访问 [控制台](https://console.haiyushuke.com),使用企业邮箱或手机号完成注册。首次登录建议完成实名/企业认证(若你方环境要求)。
## 2. 创建 API Key
1. 进入 **设置 → API Key**
2. 点击 **创建密钥**,填写名称(如 `prod-backend`
3. 复制密钥并妥善保存(仅展示一次)
## 3. 选择模型与端点
在 **模型广场** 或 **接入文档** 中确认:
- 模型 ID如 `gpt-4o-mini`、`deepseek-chat`
- 兼容协议(一般为 OpenAI Chat Completions
## 4. 发起测试请求
```bash
curl https://api.haiyushuke.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [{"role": "user", "content": "你好,请用一句话介绍海宇数科"}]
}'
```
成功时响应 JSON 中包含 `choices[0].message.content`。
## 下一步
- 按厂商阅读 [OpenAI 接入](/docs/models/openai)、[Claude 接入](/docs/models/claude)
- 了解 [流式调用](/docs/guides/streaming) 与 [API Key 管理](/docs/guides/api_keys)