API 文档
提示词与 Seed 数据服务,提供开放的查询接口,支持程序与 AI Agent 直接接入。
接口总览
服务地址:https://seeds.dsgen.cn(HTTPS)
# 所有接口返回 JSON,无需鉴权即可访问
| 方法 | 路径 | 说明 |
|---|---|---|
| GET | /api/prompt-seeds | 查询记录列表(搜索、筛选、分页) |
| GET | /api/prompt-seeds/:id | 查询单条记录详情 |
| GET | /api/models | 查询全部适用模型列表 |
支持跨域访问(CORS),请求与响应均使用 application/json。
查询记录列表
GET /api/prompt-seeds
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
search | string | 选填 | 关键词,模糊匹配提示词内容 |
model | string | 选填 | 按适用模型精确筛选 |
type | string | 选填 | 按类型筛选:image(图片)或 video(视频) |
seed | integer | 选填 | 按 Seed 精确查找 |
page | integer | 选填 | 页码,默认 1 |
pageSize | integer | 选填 | 每页条数,默认 12,最大 100 |
# 请求示例
curl "https://seeds.dsgen.cn/api/prompt-seeds?model=Stable%20Diffusion%20XL&page=1"
# 响应示例
{
"total": 2,
"page": 1,
"pageSize": 12,
"records": [
{
"id": "ef93af4a-d743-4331-998d-44be32939cba",
"type": "image",
"prompt": "A serene misty mountain landscape at dawn, cherry blossoms in the foreground, soft volumetric light, highly detailed, cinematic composition, 8k, masterpiece",
"seed": 123456789,
"model": "Stable Diffusion XL",
"videoUrl": "",
"remark": "",
"createdAt": "2026-10-31T06:16:07.201Z",
"updatedAt": "2026-10-31T06:16:07.201Z"
}
]
}
查询记录详情
GET /api/prompt-seeds/:id
参数::id 为记录 ID,由列表接口返回的 id 字段获得。
# 请求示例
curl "https://seeds.dsgen.cn/api/prompt-seeds/ef93af4a-d743-4331-998d-44be32939cba"
# 响应示例
{
"id": "ef93af4a-d743-4331-998d-44be32939cba",
"type": "image",
"prompt": "A serene misty mountain landscape at dawn, cherry blossoms in the foreground, soft volumetric light, highly detailed, cinematic composition, 8k, masterpiece",
"seed": 123456789,
"model": "Stable Diffusion XL",
"videoUrl": "",
"remark": "",
"createdAt": "2026-10-31T06:16:07.201Z",
"updatedAt": "2026-10-31T06:16:07.201Z"
}
查询模型列表
GET /api/models
# 请求示例
curl "https://seeds.dsgen.cn/api/models"
# 响应示例
{
"models": ["Minimax H3", "Stable Diffusion XL", "Seedream 4.5"]
}
Agent 接入指南
AI Agent 可通过 HTTP 请求直接读取数据,无需鉴权。
① 常用查询
# 按模型查询记录
GET https://seeds.dsgen.cn/api/prompt-seeds?model=Stable%20Diffusion%20XL&pageSize=100
# 按 Seed 反查提示词
GET https://seeds.dsgen.cn/api/prompt-seeds?seed=123456789
# 关键词搜索提示词
GET https://seeds.dsgen.cn/api/prompt-seeds?search=cyberpunk
# 仅查询图片类型
GET https://seeds.dsgen.cn/api/prompt-seeds?type=image
# 获取全部适用模型
GET https://seeds.dsgen.cn/api/models
② 接入流程
# 1. 获取模型列表
GET /api/models
# 2. 按模型获取记录(含提示词、Seed、演示视频)
GET /api/prompt-seeds?model=<模型名>&pageSize=100
# 3. 使用返回的提示词与 Seed 组合,复现生成效果
③ Python 调用示例
import requests
resp = requests.get(
"https://seeds.dsgen.cn/api/prompt-seeds",
params={"model": "Stable Diffusion XL", "pageSize": 100},
)
data = resp.json()
for record in data["records"]:
print(record["seed"], record["model"], record["prompt"][:60])
④ Agent 提示词模板
通过以下 API 获取提示词与 Seed 数据:
- 地址:https://seeds.dsgen.cn/api/prompt-seeds
- 参数:model(按模型筛选)、type(图片 image / 视频 video)、seed(按 Seed 查找)、search(关键词搜索)、page/pageSize(分页)
- 接口无需鉴权,直接返回 JSON。
错误码
| 状态码 | 含义 |
|---|---|
| 400 | 请求参数错误,响应 error 字段说明具体原因 |
| 404 | 请求的资源不存在 |
| 500 | 服务器内部错误 |
错误响应格式:{ "error": "错误描述" }