Skip to content
Primary navigation

Delete thread

Deprecated
client.beta.threads.delete(stringthreadID, RequestOptionsoptions?): ThreadDeleted { id, deleted, object }
DELETE/threads/{thread_id}

Delete a thread.

ParametersExpand Collapse
threadID: string
ReturnsExpand Collapse
ThreadDeleted { id, deleted, object }
id: string
deleted: boolean
object: "thread.deleted"

Delete thread

import OpenAI from "openai";

const openai = new OpenAI();

async function main() {
  const response = await openai.beta.threads.delete("thread_abc123");

  console.log(response);
}
main();
{
  "id": "thread_abc123",
  "object": "thread.deleted",
  "deleted": true
}
Returns Examples
{
  "id": "thread_abc123",
  "object": "thread.deleted",
  "deleted": true
}