快速开始

几分钟内从照片得到 GLB。

  1. 1. 创建 API 密钥

    将其保存在服务器的环境变量中。

    export WANDY3D_API_KEY="hg_live_…"
  2. 2. 为余额充值

    $5 起。随时可用免费调用查询余额。

    curl https://api.wandy3d.com/api/platform/balance \  -H "Authorization: Bearer $WANDY3D_API_KEY"# → {"balance_usd": "<balance>", "month_spent_usd": "<spent>", …}
  3. 3. 生成模型

    上传照片、轮询任务、下载 GLB。费用从余额扣除并显示在响应中。

    # 1. Start a generation from a photo (Wandy 2)curl -s -X POST "https://api.wandy3d.com/generate/cloud/ultra" \  -H "Authorization: Bearer $WANDY3D_API_KEY" \  -F "file=@photo.jpg"# → {"task_id": "<task_id>", "status": "queued", "billing": {"cost_usd": "<price>", "balance_usd": "<balance>"}, …}# 2. Poll until "status" is "done"curl -s "https://api.wandy3d.com/task/<task_id>/status" \  -H "Authorization: Bearer $WANDY3D_API_KEY"# → {"status": "done", "model_id": "<model_id>", …}# 3. Get a download link, then download the GLBcurl -s "https://api.wandy3d.com/model/<model_id>/export?format=glb" \  -H "Authorization: Bearer $WANDY3D_API_KEY"# → {"status": "ready", "url": "<download_url>", "filename": "<name>.glb", …}curl -L -o model.glb "<download_url>"
  4. 4. 须知

    计费、错误和限额的工作方式。

    • 每个响应都含计费信息
      付费调用会返回 billing.cost_usd 和 billing.balance_usd,以及 X-Wandy-Cost-USD / X-Wandy-Balance-USD 响应头。
    • 错误
      402 insufficient_balance / monthly_limit_reached / key_limit_reached,429 rate_limited / too_many_jobs。每个错误都是包含代码和说明的 JSON。
    • 自动退款
      任务失败时费用会退回余额——没拿到的模型不收费。
    • 限额
      每个密钥每分钟 60 次请求,每个账户同时 5 个任务。月度上限可在限额页面设置。