SpeakNotes API 错误代码
每次失败都会返回相同的 JSON 信封:一个稳定的代码、一条人类可读的消息、指向此页面的链接以及出错时的相关字段。
结构
错误永远不会以 HTML 形式返回。代码是稳定的,可以安全地进行分支处理;消息内容可能会随时更改。
HTTP/1.1 402 Payment Required
X-Request-Id: 0f0a3f2c-6f1e-4a5e-9f1b-9d0b5a2c7e11
{
"error": {
"type": "billing_error",
"code": "insufficient_credits",
"message": "This operation costs 14 credits and the account has 3 left.",
"doc_url": "https://speaknotes.io/developers/errors#insufficient_credits",
"request_id": "0f0a3f2c-6f1e-4a5e-9f1b-9d0b5a2c7e11"
}
}代码
invalid_request400The request was malformed or failed validation.
invalid_token401The credential is missing, malformed, expired, or revoked.
insufficient_scope403The credential is valid but lacks the scope this operation needs.
not_found404The requested resource does not exist.
method_not_allowed405That HTTP method is not supported on this path.
conflict409The request conflicts with the current state of the resource.
payload_too_large413The uploaded file exceeds the size limit.
unsupported_media_type415The file format is not supported.
insufficient_credits402The account has no credits left for this operation.
rate_limited429Too many requests. Retry after the interval in the Retry-After header.
upstream_failure502A provider SpeakNotes depends on failed.
content_policy422The content was refused by the AI content policy.
internal_error500SpeakNotes failed to process the request.
重试策略
在 Retry-After 指定的时间间隔后重试 rate_limited 错误,并使用退避策略重试一到两次 upstream_failure。切勿重试 invalid_request、insufficient_scope 或 content_policy 错误:它们每次都会以同样的方式失败。
请求 ID
每个响应都包含一个 X-Request-Id 标头,错误主体中也会重复该 ID。将其提供给支持团队,即可找到确切的故障原因。