报价
启动前获取一台机器或一个集群的你的价格,保留 60 秒。
POST
/api/v1/quotes需要 API 密钥报价是一台机器或一个集群对你的价格。在 60 秒内用 POST /rentals 启动它。报价免费,不会启动任何东西。
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
offer_id | string | 是 | 来自 /machines 或 /clusters 的 id |
kind | string | 否 | on_demand 或 interruptible;不填时用机器自己的方式 |
gpus | number | 否 | 每台机器 1、2、4 或 8 块 GPU;不填时用机器自己的数量 |
any_country | boolean | 否 | 如果这台机器已被租走,可能由其他国家的同类机器替代。默认为 true |
curl https://bflops.com/api/v1/quotes \
-H "Authorization: Bearer $BFLOPS_KEY" \
-H "Content-Type: application/json" \
-d '{"offer_id": "s4821", "kind": "on_demand"}'201
{
"quote": {
"id": "q_9d2c4e1f0a7b4c8e9f1a2b3c4d5e6f70",
"expires_at": "2026-11-27T09:31:00.000Z",
"offer_id": "s4821",
"cluster": false,
"kind": "on_demand",
"gpus": 8,
"nodes": 1,
"per_gpu_hour_usd": "2.19",
"per_hour_usd": "17.52",
"start_needs_usd": "4.38",
"available_usd": "120.00",
"enough": true,
"data_allowed": false
}
}start_needs_usd:启动时你的余额必须可用的金额:这台机器以及你在运行的所有机器 15 分钟的费用。enough:available_usd是否足够。不够时,启动前先充值。data_allowed:这次启动能否挂载 /data。
你可能遇到的错误
| 错误码 | 状态码 | 怎么办 |
|---|---|---|
not_found | 404 | 机器已下线。重新列出并选择另一台。 |
gpus_unavailable | 409 | 这台机器只能整台租用:不填 gpus,或要求全部 GPU。 |
kind_unavailable | 409 | 它不以这种方式提供。不填 kind。 |
cluster_needs_established | 409 | 你的账户还不能租用集群。 |
所有错误码:错误。