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

client.Safety.Alerts.Get(ctx, id) (*SafetyAlert, error)
GET
/safety/alerts/{id}

Get a safety alert belonging to the authenticated API project.

Parameters
id string

Project safety alert ID

maxLength38
Returns
type SafetyAlert struct{…}
ID string
CreatedAt int64
formatunixtime
ErrorType SafetyAlertErrorType
Model string
Object SafetyAlert
Reason string

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

RequestID string
RequestPaused bool

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

ResponseID string
DetailedExplanation string
Optional

A generated explanation, temporarily available for eligible zero data retention alerts. Omitted when unavailable.

Get project safety alert

package main

import (
  "context"
  "fmt"

  "github.com/openai/openai-go"
  "github.com/openai/openai-go/option"
)

func main() {
  client := openai.NewClient(
    option.WithAPIKey("My API Key"),
  )
  safetyAlert, err := client.Safety.Alerts.Get(context.TODO(), "id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", safetyAlert.ID)
}
Response example
{
  "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
Response example
{
  "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."
}