resources/chat/subresources/completions/methods/delete/index.md +0 −64 deleted
File Deleted View Diff
1## Delete chat completion
2
3**delete** `/chat/completions/{completion_id}`
4
5Delete a stored chat completion. Only Chat Completions that have been
6created with the `store` parameter set to `true` can be deleted.
7
8### Path Parameters
9
10- `completion_id: string`
11
12### Returns
13
14- `ChatCompletionDeleted object { id, deleted, object }`
15
16 - `id: string`
17
18 The ID of the chat completion that was deleted.
19
20 - `deleted: boolean`
21
22 Whether the chat completion was deleted.
23
24 - `object: "chat.completion.deleted"`
25
26 The type of object being deleted.
27
28 - `"chat.completion.deleted"`
29
30### Example
31
32```http
33curl https://api.openai.com/v1/chat/completions/$COMPLETION_ID \
34 -X DELETE \
35 -H "Authorization: Bearer $OPENAI_API_KEY"
36```
37
38#### Response
39
40```json
41{
42 "id": "id",
43 "deleted": true,
44 "object": "chat.completion.deleted"
45}
46```
47
48### Example
49
50```http
51curl -X DELETE https://api.openai.com/v1/chat/completions/chat_abc123 \
52 -H "Authorization: Bearer $OPENAI_API_KEY" \
53 -H "Content-Type: application/json"
54```
55
56#### Response
57
58```json
59{
60 "object": "chat.completion.deleted",
61 "id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
62 "deleted": true
63}
64```