Delete chat completion
client.Chat.Completions.Delete(ctx, completionID) (*ChatCompletionDeleted, error)
DELETE/chat/completions/{completion_id}
Delete a stored chat completion. Only Chat Completions that have been
created with the store parameter set to true can be deleted.
Parameters
completionID string
Returns
Delete chat completion
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
chatCompletionDeleted, err := client.Chat.Completions.Delete(context.TODO(), "completion_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", chatCompletionDeleted.ID)
}
{
"id": "id",
"deleted": true,
"object": "chat.completion.deleted"
}Returns Examples
{
"id": "id",
"deleted": true,
"object": "chat.completion.deleted"
}