认证方式:请求头携带 X-API-Key(登录后在控制台复制个人 Key)。
将下列 https://figup.cn/ 替换为你部署站点根 URL。
https://figup.cn/api/v1/
POST/api/v1/generate
{
"text": "肿瘤微环境中巨噬细胞极化与 T 细胞耗竭的关联机制",
"aspectRatio": "3:4"
}
aspectRatio 默认 3:4;支持:3:4、9:16、1:1、16:9、4:3。
响应示例:
{
"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 | 服务端错误(未配置 Gemini Key、模型异常等) |