REST API 快速接入

认证方式:请求头携带 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

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

响应字段:balancetotalUsedtotalPurchased

生成历史

GET/api/v1/history,支持 ?limit=20(最大 100)。

错误码

HTTP说明
401API Key 无效
402Credit 余额不足
400请求参数错误
500服务端错误(未配置 Gemini Key、模型异常等)

← 返回首页