Skip to content

Delete assistant

Deprecated
client.Beta.Assistants.Delete(ctx, assistantID) (*AssistantDeleted, error)
DELETE/assistants/{assistant_id}

Delete an assistant.

ParametersExpand Collapse
assistantID string
ReturnsExpand Collapse
type AssistantDeleted struct{…}
ID string
Deleted bool
Object AssistantDeleted

Delete assistant

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"),
  )
  assistantDeleted, err := client.Beta.Assistants.Delete(context.TODO(), "assistant_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", assistantDeleted.ID)
}
{
  "id": "id",
  "deleted": true,
  "object": "assistant.deleted"
}
Returns Examples
{
  "id": "id",
  "deleted": true,
  "object": "assistant.deleted"
}