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

Get project safety alert

SafetyAlert safety().alerts().retrieve(AlertRetrieveParamsparams = AlertRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/safety/alerts/{id}

Get a safety alert belonging to the authenticated API project.

ParametersExpand Collapse
AlertRetrieveParams params
Optional<String> id

Project safety alert ID

maxLength38
ReturnsExpand Collapse
class SafetyAlert:
String id
long createdAt
formatunixtime
ErrorType errorType
String model
JsonValue; object_ "safety.alert"constant"safety.alert"constant
Optional<String> reason

A customer-safe description derived from error_type, or null for zero data retention requests.

String requestId
boolean requestPaused

Whether block registration succeeded for this request. This does not confirm that response execution stopped.

String responseId

Get project safety alert

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.safety.alerts.AlertRetrieveParams;
import com.openai.models.safety.alerts.SafetyAlert;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        SafetyAlert safetyAlert = client.safety().alerts().retrieve("id");
    }
}
{
  "id": "alert_0123456789abcdef0123456789abcdef",
  "object": "safety.alert",
  "created_at": 1787659200,
  "request_id": "req_123",
  "response_id": "resp_123",
  "model": "gpt-6-astra",
  "request_paused": true,
  "error_type": "potentially_unintended_data_access",
  "reason": "Potentially unintended data access."
}
Returns Examples
{
  "id": "alert_0123456789abcdef0123456789abcdef",
  "object": "safety.alert",
  "created_at": 1787659200,
  "request_id": "req_123",
  "response_id": "resp_123",
  "model": "gpt-6-astra",
  "request_paused": true,
  "error_type": "potentially_unintended_data_access",
  "reason": "Potentially unintended data access."
}