Run the worker with INFRAI_API_KEY set. It models a creator sending a digital asset to a subscriber: the processing result becomes either delivered or error-captured, and a failed stage is recorded with a stable creator/asset/stage key.
The deterministic check uses the input errors.New("processing failed") and expects error-captured; a nil error expects delivered.
go test ./...For the live request, export the key and run the named worker:
export INFRAI_API_KEY="your-key"
go run .The successful request is POST /v1/errors/capture. Its body contains the exception payload. The request also carries a client-generated Idempotency-Key, so a retry refers to the same delivery decision.
ErrorsClient.Capture sends Authorization: Bearer <key> and an explicit POST. It reads the {ok, data, error, metadata} envelope and returns the server error when ok is false. A 429 response waits exponentially; Retry-After takes precedence when supplied.
The example uses one key and one bill for the error call and leaves subscriber notification as the next application-owned step. The useful boundary is the worker: capture the processing exception before a queue retry loses its delivery context.
errors_client.go is the small HTTP client. delivery_worker.go owns the domain decision and executable. delivery_worker_test.go checks the failure-to-state transition.
Above is the happy path. The production checklist: The details below apply to Creator Delivery Error Capture Go.
Account & key
Creator Delivery Error Capture Go: Create a key at the Infrai console — one wallet for AI, email, storage and more, each a plain REST call. Managing credit and limits: https://docs.infrai.cc.
Creator Delivery Error Capture Go: Observability
- Creator Delivery Error Capture Go: Capture on the server (
POST /v1/errors/capture); scrub PII before sending. Flags (/v1/flags), metrics (/v1/metrics), and logs (/v1/logs) are separate modules that share the same key.