Delete Task

How to Delete Task

Delete one or more prediction jobs by their IDs.

Warning: Deleted predictions cannot be recovered. Only finished predictions in your organization can be deleted.

Endpoint

POST https://api.wavespeed.ai/api/v3/predictions/delete

Request

curl --fail-with-body --connect-timeout 10 --max-time 60 \
--request POST 'https://api.wavespeed.ai/api/v3/predictions/delete' \
--header "Authorization: Bearer $WAVESPEED_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
    "ids": ["247ae6a651", "8f5f0bdc7b3742"]
}'

Parameters

ParameterTypeRequiredDescription
idsarrayYesList of prediction IDs to delete

Response

{
  "code": 200,
  "message": "success",
  "data": {
    "deleted_count": 2,
    "deleted_ids": ["247ae6a651", "8f5f0bdc7b3742"]
  }
}

Response Fields

FieldTypeDescription
codeintegerHTTP status code (200 for success)
messagestringStatus message
data.deleted_countintegerNumber of predictions deleted by this request
data.deleted_idsarrayIDs actually deleted by this request; skipped IDs are not included

Python Example

import os
import requests
 
api_key = os.environ["WAVESPEED_API_KEY"]
 
def delete_tasks(task_ids):
    response = requests.post(
        "https://api.wavespeed.ai/api/v3/predictions/delete",
        headers={
            "Authorization": f"Bearer {api_key}",
            "Content-Type": "application/json"
        },
        json={"ids": task_ids},
        timeout=(10, 60),
    )
    response.raise_for_status()
    body = response.json()
    if body.get("code") != 200:
        raise RuntimeError(body.get("message", "Failed to delete predictions"))
    return body
 
# Delete a single task
result = delete_tasks(["pred_abc123"])
print(f"Deleted: {result['data']['deleted_count']}")
 
# Delete multiple tasks
result = delete_tasks(["pred_1", "pred_2", "pred_3"])
print(f"Deleted: {result['data']['deleted_count']}")

Notes

  • Multiple predictions can be deleted in a single request
  • Tasks with status created or processing cannot be deleted. They are skipped, and deletion does not cancel a running task.
  • Non-existent IDs, tasks outside your organization, and already deleted tasks are also skipped. Check deleted_ids and deleted_count; a successful response does not mean every requested ID was deleted.
  • Deleted tasks remain visible in prediction history, detail queries, and billing records with their prediction ID, model, and deleted status. Their request content and outputs are no longer returned, and shared results are unavailable.
  • Deleting a task does not refund its charge or remove its billing record.

When to Delete

ScenarioRecommendation
Task still running or stuckCheck its status; deletion cannot stop it. Contact support if it remains stuck.
Finished task no longer neededDownload any outputs you want to keep, then delete the task
Wrong parametersA new submission is a separate request with its own charge. Delete the old task only after it finishes.

Error Responses

CodeDescription
401Invalid API key
400Invalid request (missing ids)
© 2026 WaveSpeedAI. All rights reserved.