Cancel a Job
Cancel a job that is still pending. Use it to stop a job you started by mistake, or one you no longer need, before it completes.
Endpoint
DELETE https://api.speechischeap.com/v2/jobs/:job_id
Don't add a trailing slash. A request to /v2/jobs/:job_id/ returns 404 Not Found.
Authentication
Send an API key from the account that created the job as a Bearer token:
Authorization: Bearer YOUR_API_KEY
A job paid with x402 has no API key. Its paying wallet cancels it. See x402 Cancel a Job.
Request
| Parameter | Type | Default | Description |
|---|---|---|---|
job_id | string | Required | The ID of the job to cancel, in the URL path. |
Example Requests
curl --request DELETE \
--url https://api.speechischeap.com/v2/jobs/00000000-1111-7222-b333-444444444444-sic \
--header 'Authorization: Bearer YOUR_API_KEY'
Response
The API uses standard HTTP status codes to indicate the outcome of your request.
| Status Code | Description |
|---|---|
| 200 OK | The API canceled the job. |
| 401 Unauthorized | The Authorization header is missing or malformed, or the API key is unknown, expired, or revoked. |
| 402 Payment Required | The API key is known, but its billing isn't active. |
| 403 Forbidden | The job was paid with x402. Cancel it with the paying wallet. See x402 Cancel a Job. |
| 404 Not Found | No job has this ID, the job belongs to another account, or the job already completed, failed, or was canceled. |
| 500 Internal Server Error | The API couldn't cancel the job. Try again. |
Success Response
HTTP/1.1 200 OK
Content-Type: text/plain
OK
Errors
Errors have a plain-text body, and the most likely are 404 Not Found, which is a generic message, and Paid jobs require the original wallet cancellation proof for an x402 job. See Jobs API errors for each one.
Notes
- Only a pending job can be canceled. The API answers
404 Not Foundfor a job that doesn't exist, for another account's job, and for a job that already ended. To tell them apart, get the job. - A
200response confirms the request to cancel. Get the job afterward to confirm that itsstatusisCANCELED. - A job that is canceled before it completes costs nothing. See Billing.
- Canceling a job can send a
CANCELEDwebhook. - Closing the connection of a stream doesn't cancel the job.