认证方式:请求头携带 X-API-Key(登录后在个人中心复制个人 Key)。
将下列 https://figup.cn/ 替换为你部署站点根 URL。
https://figup.cn/api/v1/
POST/api/v1/generate
{
"text": "肿瘤微环境中巨噬细胞极化与 T 细胞耗竭的关联机制",
"aspectRatio": "1536x1024",
"serviceMode": "fast"
}
aspectRatio 默认 1536x1024;支持:1536x1024(横版)、1024x1536(竖版)、2048x2048(2K正方形)、2048x1152(2K横版)。旧比例值会自动兼容映射。
serviceMode 可选:fast(快速)或 fine(精细)。
响应示例:
{
"success": true,
"taskId": "uuid",
"resultUrl": "https://你的域名/media/...",
"creditCost": 10,
"balance": 90
}
curl -X POST https://figup.cn/api/v1/generate \
-H "X-API-Key: sci_your_api_key" \
-H "Content-Type: application/json" \
-d '{"text": "肿瘤微环境中巨噬细胞极化与 T 细胞耗竭的关联机制"}'
GET/api/v1/credits
curl -H "X-API-Key: sci_your_api_key" https://figup.cn/api/v1/credits
响应字段:balance、totalUsed、totalPurchased。
GET/api/v1/history,支持 ?limit=20(最大 100)。
| HTTP | 说明 |
|---|---|
| 401 | API Key 无效 |
| 402 | Credit 余额不足 |
| 400 | 请求参数错误 |
| 500 | 服务端错误(未配置图片生成服务 Key、模型异常等) |