go/resources/models/methods/delete/index.md +0 −56 deleted
File Deleted View Diff
1## Delete a fine-tuned model
2
3`client.Models.Delete(ctx, model) (*ModelDeleted, error)`
4
5**delete** `/models/{model}`
6
7Delete a fine-tuned model. You must have the Owner role in your organization to delete a model.
8
9### Parameters
10
11- `model string`
12
13### Returns
14
15- `type ModelDeleted struct{…}`
16
17 - `ID string`
18
19 - `Deleted bool`
20
21 - `Object string`
22
23### Example
24
25```go
26package main
27
28import (
29 "context"
30 "fmt"
31
32 "github.com/openai/openai-go"
33 "github.com/openai/openai-go/option"
34)
35
36func main() {
37 client := openai.NewClient(
38 option.WithAPIKey("My API Key"),
39 )
40 modelDeleted, err := client.Models.Delete(context.TODO(), "ft:gpt-4o-mini:acemeco:suffix:abc123")
41 if err != nil {
42 panic(err.Error())
43 }
44 fmt.Printf("%+v\n", modelDeleted.ID)
45}
46```
47
48#### Response
49
50```json
51{
52 "id": "id",
53 "deleted": true,
54 "object": "object"
55}
56```