curl --request POST \
--url https://api.protoface.com/v1/runs/{run_id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.protoface.com/v1/runs/{run_id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.protoface.com/v1/runs/{run_id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"credits": {
"charged": 123,
"pricing_version": "<string>",
"reserved": 123
},
"credits_released": 1,
"error": {
"code": "<string>",
"message": "<string>"
},
"external_id": "<string>",
"id": "<string>",
"message": "<string>",
"metadata": {},
"model": "<string>",
"model_revision": "<string>",
"operation": "<string>",
"outputs": [
{
"modality": "<string>",
"role": "<string>",
"type": "text",
"asset_id": "<string>",
"data": {},
"file": {
"content_type": "<string>",
"file_name": "<string>",
"file_size": 123,
"url": "<string>"
},
"text": "<string>"
}
],
"progress": 123,
"started_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"audio": {
"content_type": "<string>",
"file_name": "<string>",
"file_size": 123,
"url": "<string>"
},
"capacity_wait": {
"deadline_at": "2023-11-07T05:31:56Z",
"message": "<string>",
"status": "waiting"
},
"deleted_at": "2023-11-07T05:31:56Z",
"eta": {
"p50_seconds": 123,
"p95_seconds": 123,
"source": "<string>"
},
"image": {
"content_type": "<string>",
"file_name": "<string>",
"file_size": 123,
"url": "<string>"
},
"object": "run",
"video": {
"content_type": "<string>",
"file_name": "<string>",
"file_size": 123,
"url": "<string>"
}
}{
"error": {
"code": "transport.unsupported",
"message": "transport.type=pipecat is not supported",
"param": "transport.type",
"request_id": "req_01HXY5K8E7QYG3X8Z6N9R7S0VR",
"type": "invalid_request"
}
}{
"error": {
"code": "transport.unsupported",
"message": "transport.type=pipecat is not supported",
"param": "transport.type",
"request_id": "req_01HXY5K8E7QYG3X8Z6N9R7S0VR",
"type": "invalid_request"
}
}{
"error": {
"code": "transport.unsupported",
"message": "transport.type=pipecat is not supported",
"param": "transport.type",
"request_id": "req_01HXY5K8E7QYG3X8Z6N9R7S0VR",
"type": "invalid_request"
}
}{
"error": {
"code": "transport.unsupported",
"message": "transport.type=pipecat is not supported",
"param": "transport.type",
"request_id": "req_01HXY5K8E7QYG3X8Z6N9R7S0VR",
"type": "invalid_request"
}
}{
"error": {
"code": "transport.unsupported",
"message": "transport.type=pipecat is not supported",
"param": "transport.type",
"request_id": "req_01HXY5K8E7QYG3X8Z6N9R7S0VR",
"type": "invalid_request"
}
}Cancel a run
Cancel work that has not begun execution or provider submission.
A successful response confirms cancellation and releases all reserved credits.
Once work has started, return 409 run.not_cancelable without stopping it:
poll the status URL and retrieve the original run’s outputs when ready.
Replaying a historical charged cancellation reports its existing charge
without claiming a refund or making another charge.
Cancelling twice is not an error, so a client that lost the first response can retry without having to know whether it landed.
curl --request POST \
--url https://api.protoface.com/v1/runs/{run_id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.protoface.com/v1/runs/{run_id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.protoface.com/v1/runs/{run_id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"credits": {
"charged": 123,
"pricing_version": "<string>",
"reserved": 123
},
"credits_released": 1,
"error": {
"code": "<string>",
"message": "<string>"
},
"external_id": "<string>",
"id": "<string>",
"message": "<string>",
"metadata": {},
"model": "<string>",
"model_revision": "<string>",
"operation": "<string>",
"outputs": [
{
"modality": "<string>",
"role": "<string>",
"type": "text",
"asset_id": "<string>",
"data": {},
"file": {
"content_type": "<string>",
"file_name": "<string>",
"file_size": 123,
"url": "<string>"
},
"text": "<string>"
}
],
"progress": 123,
"started_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"audio": {
"content_type": "<string>",
"file_name": "<string>",
"file_size": 123,
"url": "<string>"
},
"capacity_wait": {
"deadline_at": "2023-11-07T05:31:56Z",
"message": "<string>",
"status": "waiting"
},
"deleted_at": "2023-11-07T05:31:56Z",
"eta": {
"p50_seconds": 123,
"p95_seconds": 123,
"source": "<string>"
},
"image": {
"content_type": "<string>",
"file_name": "<string>",
"file_size": 123,
"url": "<string>"
},
"object": "run",
"video": {
"content_type": "<string>",
"file_name": "<string>",
"file_size": 123,
"url": "<string>"
}
}{
"error": {
"code": "transport.unsupported",
"message": "transport.type=pipecat is not supported",
"param": "transport.type",
"request_id": "req_01HXY5K8E7QYG3X8Z6N9R7S0VR",
"type": "invalid_request"
}
}{
"error": {
"code": "transport.unsupported",
"message": "transport.type=pipecat is not supported",
"param": "transport.type",
"request_id": "req_01HXY5K8E7QYG3X8Z6N9R7S0VR",
"type": "invalid_request"
}
}{
"error": {
"code": "transport.unsupported",
"message": "transport.type=pipecat is not supported",
"param": "transport.type",
"request_id": "req_01HXY5K8E7QYG3X8Z6N9R7S0VR",
"type": "invalid_request"
}
}{
"error": {
"code": "transport.unsupported",
"message": "transport.type=pipecat is not supported",
"param": "transport.type",
"request_id": "req_01HXY5K8E7QYG3X8Z6N9R7S0VR",
"type": "invalid_request"
}
}{
"error": {
"code": "transport.unsupported",
"message": "transport.type=pipecat is not supported",
"param": "transport.type",
"request_id": "req_01HXY5K8E7QYG3X8Z6N9R7S0VR",
"type": "invalid_request"
}
}Authorizations
Production API key created at https://app.protoface.com for https://api.protoface.com; no activation step or environment switch. Pass the full secret shown once at creation as Authorization: Bearer sk_live_…, not the short dashboard identifier. HTTP 401 missing_authorization means the header did not parse; the key was not looked up. A token that passes parsing can return api_key.unknown, api_key.revoked, api_key.expired, or api_key.environment. See https://docs.protoface.com/reference/errors#authentication-codes.
Response
Successful Response
Confirmed cancellation, with the run and released reservation.

