Skip to content

Delete ChatKit thread

ThreadDeleteResponse beta().chatkit().threads().delete(ThreadDeleteParamsparams = ThreadDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
DELETE/chatkit/threads/{thread_id}

Delete a ChatKit thread

ParametersExpand Collapse
ThreadDeleteParams params
Optional<String> threadId
ReturnsExpand Collapse
class ThreadDeleteResponse:

Confirmation payload returned after deleting a thread.

String id

Identifier of the deleted thread.

boolean deleted

Indicates that the thread has been deleted.

JsonValue; object_ "chatkit.thread.deleted"constant"chatkit.thread.deleted"constant

Type discriminator that is always chatkit.thread.deleted.

Delete ChatKit thread

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.beta.chatkit.threads.ThreadDeleteParams;
import com.openai.models.beta.chatkit.threads.ThreadDeleteResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        ThreadDeleteResponse thread = client.beta().chatkit().threads().delete("cthr_123");
    }
}
{
  "id": "id",
  "deleted": true,
  "object": "chatkit.thread.deleted"
}
Returns Examples
{
  "id": "id",
  "deleted": true,
  "object": "chatkit.thread.deleted"
}