go/resources/videos/methods/delete/index.md +0 −88 deleted
File Deleted View Diff
1## Delete video
2
3`client.Videos.Delete(ctx, videoID) (*VideoDeleteResponse, error)`
4
5**delete** `/videos/{video_id}`
6
7Permanently delete a completed or failed video and its stored assets.
8
9### Parameters
10
11- `videoID string`
12
13### Returns
14
15- `type VideoDeleteResponse struct{…}`
16
17 Confirmation payload returned after deleting a video.
18
19 - `ID string`
20
21 Identifier of the deleted video.
22
23 - `Deleted bool`
24
25 Indicates that the video resource was deleted.
26
27 - `Object VideoDeleted`
28
29 The object type that signals the deletion response.
30
31 - `const VideoDeletedVideoDeleted VideoDeleted = "video.deleted"`
32
33### Example
34
35```go
36package main
37
38import (
39 "context"
40 "fmt"
41
42 "github.com/openai/openai-go"
43 "github.com/openai/openai-go/option"
44)
45
46func main() {
47 client := openai.NewClient(
48 option.WithAPIKey("My API Key"),
49 )
50 video, err := client.Videos.Delete(context.TODO(), "video_123")
51 if err != nil {
52 panic(err.Error())
53 }
54 fmt.Printf("%+v\n", video.ID)
55}
56```
57
58#### Response
59
60```json
61{
62 "id": "id",
63 "deleted": true,
64 "object": "video.deleted"
65}
66```
67
68### Example
69
70```go
71package main
72
73import (
74 "context"
75 "fmt"
76
77 "github.com/openai/openai-go"
78)
79
80func main() {
81 client := openai.NewClient()
82 video, err := client.Videos.Delete(context.TODO(), "video_123")
83 if err != nil {
84 panic(err.Error())
85 }
86 fmt.Printf("%+v\n", video.ID)
87}
88```