所有端点均返回 application/json。错误遵循 RFC 7807(Problem+JSON)。每个响应都携带 X-Request-Id 响应头,便于与服务器端审计日志进行关联。
| Method | Path | 权限范围 | 用途 |
|---|---|---|---|
| GET | /v1/health | public | 无需身份验证的健康检查。 |
| GET | /v1/me | any | 自身账户信息与密钥元数据。 |
| GET | /v1/products | read:products | 所有公开销售产品的列表与价格。 |
| GET | /v1/products/{id} | read:products | 产品详情,包含配置选项。 |
| POST | /v1/orders | write:orders | 提交订单。必须携带 Idempotency-Key。 |
| GET | /v1/orders/{id} | read:orders | 自身订单的状态。 |
| GET | /v1/services | read:services | 自身服务列表(支持分页)。 |
| GET | /v1/services/{id} | read:services | 自身某项服务的详情。 |
| GET | /v1/services/{id}/credentials | read:credentials | 服务凭据(独立权限范围,全程审计)。 |
| POST | /v1/services/{id}/actions | write:services | 服务操作:start、stop、reboot、cancel(于计费周期结束时生效)、cancel_revoke。 |
| GET | /v1/billing/balance | read:billing | 账户余额。 |
| GET | /v1/billing/invoices | read:billing | 您的发票列表(支持分页)。 |
| GET | /v1/billing/invoices/{id}/pdf | read:billing | 发票 PDF。 |
| GET | /v1/webhooks | read:webhooks | 当前 Webhook URL。 |
| PUT | /v1/webhooks | write:webhooks | 设置或取消 Webhook URL。 |
幂等性
POST /v1/orders 与 POST /v1/services/{id}/actions 必须携带 Idempotency-Key 请求头(1 至 80 个字符,取自 [A-Za-z0-9_.-])。该 Key 与请求方法、路径及请求体绑定。在一小时内使用同一个 Key 重复发送相同的请求,将返回已保存的响应;超过一小时后将返回 410(reason 为 replay_stale),此时请发送新的 Key。若同一个 Key 搭配不同的请求体或用于其他端点,请求将以 409 idempotency_conflict 被拒绝。
速率限制
默认限制为:每个密钥每分钟 60 次请求(另允许 20 次突发)、每天 5,000 次;每个账户在所有密钥之间合计每分钟 120 次;每个来源 IP 每分钟 600 次。超出限制时,将返回 HTTP 429 并附带 Retry-After 响应头。响应头 X-RateLimit-Remaining 与 X-RateLimit-Reset 显示该密钥限额的当前状态。

