API 参考
所有接口的详细说明,包含请求参数、示例代码和响应格式。
Base URL
所有请求的基础地址
https://api.check-in.tech
认证方式
所有 API 请求需要在 Header 中携带 API Key 进行认证:
Authorization Header
Authorization: Bearer <your-api-key>
API Key 可在控制台的「API Keys」页面创建和管理。
POST /v1/chat/completions
文本对话接口,与 OpenAI API 完全兼容。支持流式和非流式两种响应模式。
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 模型名称,如 qwen3.7-plus |
messages | array | 是 | 对话消息列表 |
stream | boolean | 否 | 是否流式输出,默认 false |
temperature | float | 否 | 采样温度,0-2,默认 1 |
max_tokens | int | 否 | 最大输出 token 数 |
请求示例
bash
curl -X POST https://api.check-in.tech/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "qwen3.7-plus", "messages": [ {"role": "system", "content": "你是一个有帮助的助手。"}, {"role": "user", "content": "什么是人工智能?"} ], "temperature": 0.7 }'
响应示例
json
{
"id": "chatcmpl-xxxxx",
"model": "qwen3.7-plus",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "人工智能是..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 18,
"completion_tokens": 120,
"total_tokens": 138
}
}
视频生成 — 调用流程
视频生成是异步任务,流程如下:
📤 提交任务
POST /videos/generations
→
POST /videos/generations
🔄 轮询状态
GET /videos/generations/:taskId
→
GET /videos/generations/:taskId
✅ 获取结果
video_url
video_url
提交任务后返回 taskId,使用它轮询状态直到 status 变为 completed 或 failed。建议轮询间隔 5-10 秒。
POST /v1/videos/generations
提交一个视频生成任务。任务将在后台异步处理。
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 模型名,如 wan2.7-video-pro |
prompt | string | 是 | 视频描述,最长 2000 字符 |
duration | int | 否 | 时长(秒),5 或 10,默认 5 |
resolution | string | 否 | 分辨率,720p 或 1080p,默认 720p |
aspect_ratio | string | 否 | 宽高比,16:9 / 9:16 / 1:1,默认 16:9 |
请求示例
bash
curl -X POST https://api.check-in.tech/v1/videos/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "wan2.7-video-pro", "prompt": "一只橘猫在樱花树下漫步,花瓣随风飘落,电影级画质", "duration": 5, "resolution": "720p", "aspect_ratio": "16:9" }'
响应示例 202 Accepted
json
{
"id": "vg_xxxxx",
"model": "wan2.7-video-pro",
"status": "processing",
"created_at": "2026-07-02T10:00:00Z"
}
GET /v1/videos/generations/:taskId
查询视频生成任务的状态。根据任务状态返回不同的响应。
请求示例
bash
curl https://api.check-in.tech/v1/videos/generations/vg_xxxxx \ -H "Authorization: Bearer YOUR_API_KEY"
响应 — 处理中 200 OK
json
{
"id": "vg_xxxxx",
"status": "processing",
"progress": 45
}
响应 — 完成 200 OK
json
{
"id": "vg_xxxxx",
"status": "completed",
"video_url": "https://...",
"usage": {
"total_cost": 2.50
}
}
响应 — 失败 200 OK
json
{
"id": "vg_xxxxx",
"status": "failed",
"error": {
"message": "内容审核未通过",
"code": "content_filter"
}
}
POST /v1/videos/generations/:taskId/cancel
取消一个正在处理中的视频生成任务。已完成的任務无法取消。
请求示例
bash
curl -X POST https://api.check-in.tech/v1/videos/generations/vg_xxxxx/cancel \ -H "Authorization: Bearer YOUR_API_KEY"
响应示例 200 OK
json
{
"id": "vg_xxxxx",
"status": "cancelled"
}