Delete File
client.Beta.Files.Delete(ctx, fileID, body) (*DeletedFile, error)
/v1/files/{file_id}?beta=true
Delete File
Parameters
fileID string
ID of the File.
Returns
Delete File
Go
package main
import (
"context"
"fmt"
"github.com/anthropics/anthropic-sdk-go"
"github.com/anthropics/anthropic-sdk-go/option"
)
func main() {
client := anthropic.NewClient(
option.WithAPIKey("my-anthropic-api-key"),
)
deletedFile, err := client.Beta.Files.Delete(
context.TODO(),
"file_id",
anthropic.BetaFileDeleteParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", deletedFile.ID)
}
{
"id": "id",
"type": "file_deleted"
}Returns Examples
{
"id": "id",
"type": "file_deleted"
}