microsoft-foundry.rest.security.o-auth2-auth
Responses
Delete a model response
DELETE
/openai/v1/responses/{response_id}
Deletes a model response.
Parámetros de la ruta de acceso
response_id
string
requerido
The ID of the response to delete.
Parámetros de encabezado
x-ms-user-identity
string
Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the agents/endpoints/UserIdentityImpersonation/action RBAC permission.
Respuestas
The request has succeeded.
Encabezados
x-agent-session-id
string
Session ID for this request. Only present for hosted agent responses. Returns the provided session ID or an auto-generated one if not provided in the request.
Cuerpo
Content-Type: application/json
id
string
requerido
The operation ID.
object
enum
requerido
Always return 'response'.
response
deleted
enum
requerido
Always return true
true
Solicitar
curl -X DELETE https://api.openai.com/v1/responses/resp_123 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY"
import OpenAI from "openai";
const client = new OpenAI();
const response = await client.responses.delete("resp_123");
console.log(response);
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
client.responses.delete(
"resp_677efb5139a88190b512bc3fef8e535d",
)
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});
await client.responses.delete('resp_677efb5139a88190b512bc3fef8e535d');
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.Responses.Delete(context.TODO(), "resp_677efb5139a88190b512bc3fef8e535d")
if err != nil {
panic(err.Error())
}
}
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.responses.ResponseDeleteParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
client.responses().delete("resp_677efb5139a88190b512bc3fef8e535d");
}
}
require "openai"
openai = OpenAI::Client.new(api_key: "My API Key")
result = openai.responses.delete("resp_677efb5139a88190b512bc3fef8e535d")
puts(result)
Respuesta
{
"id": "resp_6786a1bec27481909a17d673315b29f6",
"object": "response",
"deleted": true
}