开始使用 HiveAPI
使用编码代理或手动发起第一个 API 请求。两条路径都通向完整、生产安全的集成。
Need a browser-based AI video and creative workflow studio without writing API code? Explore Wodex.ai Studio.
选择一条路径。编码代理路径最快;手动路径展示相同的请求生命周期,无需代理。
使用编码代理
1. 安装 HiveAPI Skill
只有一个文件,直接由本站提供。不需要账号,也不需要安装器:
curl -fsSL --create-dirs -o ~/.agents/skills/hiveapi/SKILL.md https://hiveapi.dev/skills/hiveapi/SKILL.md
如果你的代理读取自己的 skills 目录而不是 ~/.agents/skills,把同一个 URL 存到对应路径即可(Claude Code:~/.claude/skills/hiveapi/SKILL.md)。
该 Skill 为 Claude Code、Codex、Cursor 及其他兼容代理提供 HiveAPI 集成规则和验收清单。
更倾向于实时文档而非安装 Skill?连接只读 Docs MCP 服务器:
claude mcp add --transport http hiveapi-docs https://hiveapi.dev/mcp
使用 Skill 或 MCP,不要同时使用两者。两者都不支持的代理可以读取 llms-full.txt。
2. 粘贴一个聚焦的提示词
替换功能描述,然后将此提示词交给你的编码代理:
Use the installed HiveAPI skill to integrate HiveAPI into this project.
Build this feature: [describe the HiveAPI-powered feature].
Inspect the repository before editing. Keep HIVEAPI_KEY server-side, handle the
asynchronous task lifecycle, persist any output the product must retain, add
focused tests, and report the exact manual smoke test when finished.
不要将 API 密钥粘贴到对话中。只需告诉代理服务端环境变量名为 HIVEAPI_KEY;在部署平台或未被跟踪的本地环境文件中配置其值。
3. 验证集成
仅在满足以下条件时接受实现:
- 从可信的服务端代码调用 HiveAPI;
- 持久化返回的任务
id; - 在
succeeded、failed或cancelled时停止,并设有客户端超时; - 可以重试提交而不创建重复任务;
- 在 API 错误时保留
request_id; - 在需要时将即将过期的输出复制到应用自有存储;
- 在自动化测试中使用模拟响应而非付费 API 调用。
手动发起第一个请求
1. 创建 API 密钥
打开 Dashboard → API keys,创建一个密钥,并将一次性值存储在你的服务端环境中:
export HIVEAPI_KEY="hk_live_..."
永远不要提交密钥或将其暴露给浏览器代码。所有请求使用 https://api.hiveapi.dev。
2. 提交图像任务
使用所选模型的类型化端点。为每个业务操作分配一个稳定的幂等键,如果提交需要重试则复用该键。
curl -X POST https://api.hiveapi.dev/v1/z-image-spicy \
-H "Authorization: Bearer $HIVEAPI_KEY" \
-H "Idempotency-Key: first-image-your-request-id" \
-H "Content-Type: application/json" \
-d '{
"prompt": "a low-poly fox in a snowy forest, golden hour",
"width": 1024,
"height": 576
}'
新任务返回 202 Accepted。在等待前保存其 id:
{
"id": "task_8sd9f7aQ2",
"status": "queued",
"model": "z-image-spicy"
}
3. 获取结果
使用客户端超时轮询已保存的任务:
curl https://api.hiveapi.dev/v1/tasks/task_8sd9f7aQ2 \
-H "Authorization: Bearer $HIVEAPI_KEY"
状态非终态时继续。在 succeeded、failed 或 cancelled 时停止。成功的任务包含其资产和过期时间:
{
"id": "task_8sd9f7aQ2",
"status": "succeeded",
"output": {
"assets": [{ "url": "https://cdn.hiveapi.dev/..." }]
},
"expires_at": 1734104807
}
在 expires_at 之前,将产品必须保留的任何文件复制到你可控的存储中。
类型化端点
每个模型一个类型化端点,提交后统一通过 /v1/tasks/{id} 跟踪。价格为本站美元价:Seedance / Seedream 系列官网价 8 折,聊天 7 折。
| 模型 | 端点 | 模式 | 价格 |
|---|---|---|---|
| Seedance 2.5 | /v1/seedance-2.5-spicy | 文 / 图 / 参考 / 视频生视频 | $0.08/秒 起 |
| Seedance 2.5 Flash | /v1/seedance-2.5-flash-spicy | 文 / 图 / 参考 / 视频生视频 | $0.048/秒 |
| Seedance 2.0 | /v1/seedance-2.0-spicy | 文 / 图 / 参考生视频 | $0.112/秒 |
| Seedance 2.0 Mini | /v1/seedance-2.0-mini-spicy | 文 / 图 / 参考生视频 | $0.064/秒 |
| Wan 3.0 | /v1/w3.0-spicy | 文 / 图 / 参考生视频 | $0.08/秒 |
| Berry 1.0 | /v1/berry-1.0-spicy | 文 / 图 / 参考生视频 | $0.075/秒 |
| MiniMax H3 | /v1/minimax-h3-spicy | 视频 + 原生音频 | $0.02/秒 起 |
| Video Enhancer | /v1/video-enhancer-spicy | 1080p / 2K / 4K 超分 | $0.07/秒 起 |
| Seedream 5.0 Pro | /v1/seedream-5.0-pro-spicy | 文生图 / 图像编辑 | $0.096/张 |
| Seedream 5.0 Lite | /v1/seedream-5.0-lite-spicy | 文生图 / 图像编辑 | $0.048/张 |
| Z-Image Pro | /v1/z-image-spicy-pro | 文生图 | $0.03/张 |
| Z-Image | /v1/z-image-spicy | 文生图 | $0.02/张 |
| Qwen Image Edit | /v1/qwen-image-edit-spicy | 图像编辑(本地图先上传取 URL) | $0.02/张 |
| Face Swap | /v1/face-swap-spicy | 换脸 | $0.026/张 |
| Siren 1.0 | /v1/siren-1.0-spicy | 语音合成 | $0.04/分钟 |
| 聊天模型 | /v1/chat/completions | 聊天补全(OpenAI 兼容) | $0.175/1M tokens 起 |
Talk to the model(聊天补全)
聊天模型经 统一 7 折,无内容拒绝层。使用 OpenAI 兼容的聊天补全端点:
curl -X POST https://api.hiveapi.dev/v1/chat/completions \
-H "Authorization: Bearer $HIVEAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4",
"messages": [{ "role": "user", "content": "你好,介绍一下你自己" }]
}'
积分与计费
1000 积分 = $1,按需付费,无需订阅,充值积分永久有效。模型 API 仅接受 USDT 充值,通过 OxaPay 网关完成。Seedance / Seedream 系列官网价统一 8 折,聊天模型 7 折。详见定价。
上线前
- 选择模型并使用其类型化端点。
- 使用有界轮询或已验证的 webhook 运行和跟踪生成任务。
- 将 API 密钥保留在服务端。
- 处理 API 错误时不要丢弃
request_id。 - 使用生成的 API Reference 获取精确的字段和响应模式。