diff --git a/articles/ai-foundry/openai/how-to/responses.md b/articles/ai-foundry/openai/how-to/responses.md index fe18374d36..6e19f2fcf1 100644 --- a/articles/ai-foundry/openai/how-to/responses.md +++ b/articles/ai-foundry/openai/how-to/responses.md @@ -331,6 +331,8 @@ curl -X GET https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/responses/{res By default response data is retained for 30 days. To delete a response, you can use `response.delete"("{response_id})` +# [Python (Microsoft Entra ID)](#tab/python-secure) + ```python from openai import AzureOpenAI from azure.identity import DefaultAzureCredential, get_bearer_token_provider @@ -350,6 +352,26 @@ response = client.responses.delete("resp_67cb61fa3a448190bcf2c42d96f0d1a8") print(response) ``` +# [REST API](#tab/rest-api) + +### API Key + +```bash +curl -X DELETE https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/responses/{response_id}?api-version=preview \ + -H "Content-Type: application/json" \ + -H "api-key: $AZURE_OPENAI_API_KEY" +``` + +# [Output](#tab/output) + +```json +{ + "id": "resp_67cb61fa3a448190bcf2c42d96f0d1a8", + "object": "response.deleted", + "deleted": true +} +``` + ## Chaining responses together You can chain responses together by passing the `response.id` from the previous response to the `previous_response_id` parameter.