Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Delete a model response

client.Beta.Responses.Delete(ctx, responseID, body) error
DELETE
/responses/{response_id}

Deletes a model response with the given ID.

Parameters
responseID string
body BetaResponseDeleteParams

Delete a model response

package main

import (
  "context"

  "github.com/openai/openai-go"
  "github.com/openai/openai-go/option"
)

func main() {
  client := openai.NewClient(
    option.WithAPIKey("My API Key"),
  )
  err := client.Beta.Responses.Delete(
    context.TODO(),
    "resp_677efb5139a88190b512bc3fef8e535d",
    openai.BetaResponseDeleteParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
}
Response example
{
  "id": "resp_123",
  "object": "response.deleted",
  "deleted": true
}
Returns Examples
Response example
{
  "id": "resp_123",
  "object": "response.deleted",
  "deleted": true
}