Documentation release. A completeness audit of the v2.0.3 async guide found the happy path correct but the failure/edge paths missing — the parts an async paid API actually hits in production. This release closes them so a developer can ship a correct async API, not just the happy path.
- Idempotent acceptance. The accept leg must dedupe on the quoted token: a platform
retry returns the same
job_idand never enqueues a second job or double-charges. (The v2.0.3 example accidentally taught a non-idempotent enqueue — now fixed and asserted in the example'smain().) get_resultfor every state. Documented and demonstrated the running (poll again), succeeded, failed, and unknown/expired responses — all free (amount_minor: 0, nobillingPreview) — instead of only the success shape.- Failure after acceptance. Settlement is final on acceptance; if the job fails in
your worker the buyer is already charged and the platform does not auto-refund —
refund/repair is the publisher's responsibility. Report the failure via
get_resultand declare your policy inToolManual.refund_or_cancellation_note. - Full accepted-status set.
queued,accepted,processing,pending,running,in_progress,deferred,scheduledare all accepted-deferred (the real test isaccepted: true+ ajob_id+ a non-terminalstatus). - Polling lifecycle,
job_idretention, and one-tool-or-two input dispatch are now spelled out (the agent pollsget_result; there is no completion webhook). - Reconciled the remaining synchronous-only "not delivered" prose in
GETTING_STARTED.mdand theREADME.mdnarrative with the async carve-out, addedasync_transcription.pyto the README example index, and extended the refund boundary inplatform-api-boundary.mdandpricing-and-billing.mdto the async accept-then-fail case.
No code changes are required. If you built an async API against v2.0.3, review two things:
your accept leg must be idempotent (dedupe on the commit token), and your get_result
must return a defined response for the running and failed states — otherwise a
polling agent cannot distinguish "come back later" from "failed", and a worker failure
silently keeps the buyer's money with no signal.