https://api.praxa.io. It is a production partner preview for admitted
personal tenants. Organization execution and request-level agent, tool,
context, policy, and delivery overrides are not accepted.
Prerequisites
- A personal workspace API key created in the Developer Platform.
execute:writeto submit a task.runs:readto read or stream the run.runs:writeonly if you will test cancellation.- A server runtime. Never expose the key in browser code.
1. Submit a task
- cURL
- JavaScript
- Python
202 with a RunResource. The status will be one
of queued, running, awaiting_approval, completed, failed, or
cancelled.
2. Read until terminal
3. Stream instead of polling
id. Reconnect with Last-Event-ID and require
strictly increasing sequences. A terminal event closes the stream.
4. Integrate a framework safely
Have the client create one application request ID when the user starts the logical action, persist it until the request settles, and resend that same ID after a timeout. The backend should combine it with the authenticated user identity to derive a bounded Praxa idempotency key.- Next.js
- Cloudflare Worker
Put the task call in a Route Handler. The browser sends only your
application input to
/api/tasks; the Praxa key stays on the server.app/api/tasks/route.ts
requireSession, authenticateApplicationRequest, and idempotencyKeyFor
represent your application-owned auth and deterministic key helpers. They must
fail before the Praxa request if the user, input, or request ID is invalid.
5. Verify end to end
Run these checks with a disposable task and least-privilege keys:- Submit once and require
202plus a UUIDrun_id. - Replay the exact body with the same idempotency key and require the same run.
- Change the body under that key and require
409. - Read the run with
runs:readand require the same tenant-owned run ID. - Attempt the read with a key that lacks
runs:readand require a fail-closed response. - Consume events until a terminal event or an explicitly documented timeout.
- If testing cancellation, send exactly
{}and continue reading until the run actually becomes terminal.
A passing submission test proves admission only. Your end-to-end assertion
must observe a terminal run or an explicit non-terminal state that your
product knows how to handle.
Troubleshooting
Best practices
- Persist identity before I/O and state transitions after durable processing.
- Treat admission, delivery attempt, and cancellation request as non-terminal acknowledgements.
- Verify signatures against the raw body before parsing webhook JSON.
- Deduplicate streams and webhooks using stable event or delivery identity.
- Test disconnect, duplicate, out-of-order, timeout, revocation, and cleanup paths.
Optimize for production
- Prefer event-driven updates while retaining bounded polling or readback reconciliation.
- Commit cursors in batches only when that cannot lose acknowledged application work.
- Keep webhook handlers short: verify, persist, acknowledge, then process asynchronously.
- Measure admission-to-terminal time, reconnect rate, duplicate rate, delivery latency, and reconciliation backlog.
Cleanup and next steps
- Cancel or terminally reconcile disposable runs.
- Disable test webhook endpoints and remove their signing secrets.
- Delete synthetic inbox, cursor, and delivery records after assertions.
- Revoke disposable credentials and keep only redacted lifecycle evidence.