client. See Get started with the SDK.
Deletion methods
Delete fine-tuning jobs and projects over REST. See Delete fine-tuning jobs and projects for a worked example.
List your resources
Begin by listing the resource type you intend to remove. The list methods differ in shape. Some return a list directly. Others return a response object with the results underdata.
client.tools.list(), client.files.list(), client.data_jobs.list(), and client.projects.list() accept paging arguments. When a workspace holds more resources than one page returns, increase limit or request successive pages with offset.
client.data_jobs.list() also filters by job_type and sorts with sort_by and sort_order. See Manage data jobs.
Delete a single resource
Each delete method takes the resource ID.Delete in bulk
To remove several resources at once, filter a list call to the resources you want to delete, then iterate over the result. This example removes every tool whose name starts with a test prefix.Delete fine-tuning jobs and projects
Delete fine-tuning jobs and projects with a direct HTTP request to the REST endpoints. Deleting a project does not delete the fine-tuning jobs in it. The jobs are disassociated from the project and remain in your workspace. To remove them as well, delete the jobs first.204 No Content on success. The deleted job or project no longer appears in client.fine_tuning.list() or client.projects.list().
Cancelling a job is not the same as deleting it. Cancel stops a job while it is queued or running and keeps the record, so the job stays in your list with a cancelled status. Delete removes the record and its artifacts, and works on a job in any state.