REST API
Asynchronous operations
Defer long-running AI work, poll operation state, receive completion events, and cancel pending work.
Verified against the implementation ·
Request asynchronous processing
Add Prefer: respond-async to a supported AI POST. PrompTessor returns HTTP 202 with an operation object, Location header, and Preference-Applied: respond-async.
curl -i -X POST https://api.promptessor.com/v1/prompts/generate \
-H "Authorization: Bearer pt_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: async-generation-001" \
-H "Prefer: respond-async" \
-d '{"message":"Create an incident-response runbook","mode":"planning"}'Inspect and cancel
| Method | Path | Scope |
|---|---|---|
| GET | /operations | operations:read |
| GET | /operations/{id} | operations:read |
| DELETE | /operations/{id} | operations:cancel |
Cancellation window
Only PENDING operations can be cancelled. Once an operation starts running, cancellation returns operation_not_cancellable.
| List parameter | Rules |
|---|---|
| status | Optional: PENDING, RUNNING, SUCCEEDED, FAILED, or CANCELLED |
| kind | Optional exact operation kind, up to 100 characters |
| limit | 1–100; default 25 |
| cursor | Use nextCursor from the previous response |
This resource lists credit-consuming AI operations only. Ordinary API requests and MCP reads remain available in dashboard Activity Logs but do not appear here and do not count toward concurrent AI work. Operation records are retained for 90 days; idempotent response bodies are retained for 24 hours.