Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions articles/ai-foundry/openai/how-to/responses.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" \
Copy link
Preview

Copilot AI Oct 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Content-Type header is unnecessary for DELETE requests that don't send a request body. Consider removing this header to follow REST API best practices.

Suggested change
-H "Content-Type: application/json" \

Copilot uses AI. Check for mistakes.

-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.
Expand Down