Cancel an in-progress agent response
POST/agent/:id/responses/:response_id/cancel
Requests cancellation of an in-progress response. The platform sets a cancel signal that the worker polls; the underlying job transitions to a terminal state and any connected SSE consumer receives a synthesized terminal frame.
Returns cancelled: true when a cancel signal was set, and cancelled: false when the response had already reached a terminal state (completed or failed) and there was nothing to cancel.
Note: unlike the SSE endpoints (which return OpenAI-shaped error envelopes), this endpoint returns the platform's standard { success, data } envelope on success.
Request
Responses
- 200
- 401
- 404
- 410
Cancellation outcome. cancelled is true when a cancel signal was set, false when the response had already terminated.
Authentication required
The response exists but does not belong to this agent (id).
The response is unknown (absent from both cache and durable store) or its backing job no longer exists.