Https://platform.openai.com/logs are not being deleted after 30 days

Hello,

My team uses https://platform.openai.com/ and for privacy/security reasons we don’t want logs stored on OpenAI servers.

Going forward, we can tick the box to not store logs when we enter prompts, but we would still like old logs deleted. There is no method to delete logs via the API, and the logs have not automatically been deleted after the 30 days as stated here https://platform.openai.com/docs/guides/your-data and there is no retention policy option to set for these logs .

The support bot is not very helpful on this topic. Would appreciate any advice!

Thanks!

Unlike Chat completions, the Responses API has a 30 day retention period by default, or when the store parameter is set to true. Response data will be stored for at least 30 days in this case.

They do not state “at most”, they state “at least”.

I do not see any evidence of data going away. Logs are there since the date of introduction of the Responses endpoint, not prevented by disabling “API endpoint logging”:

I suppose that is a benefit if you are building a stateful chatbot using previous response IDs. However, "store":true as endpoint default is a big “heck no, what were you thinking”.

You are essentially powerless to stop the presentation of this data or its persistence, it seems, for there is no “list” method beyond hacking into the platform site API for easy pruning.


Deleting the response ID will clear the log, gone after the refresh of the page that was previously showing the response ID in the URL:

I also discover non-clever use of a reserved keyword in the SDK, preventing proper function:

from openai import OpenAI
client = OpenAI()

response = client.responses.del("resp_123")
print(response)

So your deleting function for Python:

import os
import httpx

def delete_openai_response(response_id: str) -> dict:
    """
    Sends a DELETE request to the OpenAI API to delete a response object.
    Returns the parsed JSON response which includes the deletion confirmation.
    Raises 404 for bad ID or already deleted
    """
    api_key = os.environ.get("OPENAI_API_KEY")
    if not api_key:
        raise EnvironmentError("OPENAI_API_KEY environment variable is not set")

    url = f"https://api.openai.com/v1/responses/{response_id}"
    headers = {
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    }

    with httpx.Client(timeout=30.0) as client:
        response = client.delete(url, headers=headers)
        response.raise_for_status()

    return response.json()

# Usage
id = "resp_1234123412341234"

response = delete_openai_response(id)
print(response)
print(f"True if deleted: {response["deleted"]}")

(yes, I am able to get the platform site’s listing by “special” techniques if I wanted to automate this, but that’s not what OpenAI wants, as evidenced by mitigations.)

1 Like

Thanks for the comprehensive reply @_j !

I’ll see if I can get this going.

I am also trying to delete my API response logs for information hygiene reasons, my first one still shows from March 23.

Does client.delete() erase the record correctly and cleanly from OpenAI servers?

I think the bigger problem is to the point of the title of this thread, that the retention of this data is not deleted after 30 days as suggested by https://platform.openai.com/docs/guides/your-data

By default, abuse monitoring logs are generated for all API feature usage and retained for up to 30 days.

Endpoint Data used for training Abuse monitoring retention Application state retention Zero >Data Retention eligibility
/v1/responses No 30 days None, see below for exceptions Yes, see below for limitations

I understand that some (most) users may wish to have their logs active for greater than 30 days so they can verify billing, but there is no option on the platform.openai.com settings under ORGANIZATION > Data controls > Data retention

Additionally, ORGANIZATION > Data controls > Data retention > API call logging > Disabled doesn’t seem to actually do anything (to this end).