Webhooks
webhooks.unwrap() -> void
**** ``
Validates that the given payload was sent by OpenAI and parses the payload.
Example
require "openai"
openai = OpenAI::Client.new(api_key: "My API Key")
result = openai.webhooks.unwrap
puts(result)
Domain Types
Batch Cancelled Webhook Event
-
class BatchCancelledWebhookEventSent when a batch API request has been cancelled.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the batch API request was cancelled.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the batch API request.
-
-
type: :"batch.cancelled"The type of the event. Always
batch.cancelled.:"batch.cancelled"
-
object: :eventThe object of the event. Always
event.:event
-
Batch Completed Webhook Event
-
class BatchCompletedWebhookEventSent when a batch API request has been completed.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the batch API request was completed.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the batch API request.
-
-
type: :"batch.completed"The type of the event. Always
batch.completed.:"batch.completed"
-
object: :eventThe object of the event. Always
event.:event
-
Batch Expired Webhook Event
-
class BatchExpiredWebhookEventSent when a batch API request has expired.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the batch API request expired.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the batch API request.
-
-
type: :"batch.expired"The type of the event. Always
batch.expired.:"batch.expired"
-
object: :eventThe object of the event. Always
event.:event
-
Batch Failed Webhook Event
-
class BatchFailedWebhookEventSent when a batch API request has failed.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the batch API request failed.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the batch API request.
-
-
type: :"batch.failed"The type of the event. Always
batch.failed.:"batch.failed"
-
object: :eventThe object of the event. Always
event.:event
-
Eval Run Canceled Webhook Event
-
class EvalRunCanceledWebhookEventSent when an eval run has been canceled.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the eval run was canceled.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the eval run.
-
-
type: :"eval.run.canceled"The type of the event. Always
eval.run.canceled.:"eval.run.canceled"
-
object: :eventThe object of the event. Always
event.:event
-
Eval Run Failed Webhook Event
-
class EvalRunFailedWebhookEventSent when an eval run has failed.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the eval run failed.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the eval run.
-
-
type: :"eval.run.failed"The type of the event. Always
eval.run.failed.:"eval.run.failed"
-
object: :eventThe object of the event. Always
event.:event
-
Eval Run Succeeded Webhook Event
-
class EvalRunSucceededWebhookEventSent when an eval run has succeeded.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the eval run succeeded.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the eval run.
-
-
type: :"eval.run.succeeded"The type of the event. Always
eval.run.succeeded.:"eval.run.succeeded"
-
object: :eventThe object of the event. Always
event.:event
-
Fine Tuning Job Cancelled Webhook Event
-
class FineTuningJobCancelledWebhookEventSent when a fine-tuning job has been cancelled.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the fine-tuning job was cancelled.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the fine-tuning job.
-
-
type: :"fine_tuning.job.cancelled"The type of the event. Always
fine_tuning.job.cancelled.:"fine_tuning.job.cancelled"
-
object: :eventThe object of the event. Always
event.:event
-
Fine Tuning Job Failed Webhook Event
-
class FineTuningJobFailedWebhookEventSent when a fine-tuning job has failed.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the fine-tuning job failed.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the fine-tuning job.
-
-
type: :"fine_tuning.job.failed"The type of the event. Always
fine_tuning.job.failed.:"fine_tuning.job.failed"
-
object: :eventThe object of the event. Always
event.:event
-
Fine Tuning Job Succeeded Webhook Event
-
class FineTuningJobSucceededWebhookEventSent when a fine-tuning job has succeeded.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the fine-tuning job succeeded.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the fine-tuning job.
-
-
type: :"fine_tuning.job.succeeded"The type of the event. Always
fine_tuning.job.succeeded.:"fine_tuning.job.succeeded"
-
object: :eventThe object of the event. Always
event.:event
-
Realtime Call Incoming Webhook Event
-
class RealtimeCallIncomingWebhookEventSent when Realtime API Receives a incoming SIP call.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the model response was completed.
-
data: Data{ call_id, sip_headers}Event data payload.
-
call_id: StringThe unique ID of this call.
-
sip_headers: Array[SipHeader{ name, value}]Headers from the SIP Invite.
-
name: StringName of the SIP Header.
-
value: StringValue of the SIP Header.
-
-
-
type: :"realtime.call.incoming"The type of the event. Always
realtime.call.incoming.:"realtime.call.incoming"
-
object: :eventThe object of the event. Always
event.:event
-
Response Cancelled Webhook Event
-
class ResponseCancelledWebhookEventSent when a background response has been cancelled.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the model response was cancelled.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the model response.
-
-
type: :"response.cancelled"The type of the event. Always
response.cancelled.:"response.cancelled"
-
object: :eventThe object of the event. Always
event.:event
-
Response Completed Webhook Event
-
class ResponseCompletedWebhookEventSent when a background response has been completed.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the model response was completed.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the model response.
-
-
type: :"response.completed"The type of the event. Always
response.completed.:"response.completed"
-
object: :eventThe object of the event. Always
event.:event
-
Response Failed Webhook Event
-
class ResponseFailedWebhookEventSent when a background response has failed.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the model response failed.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the model response.
-
-
type: :"response.failed"The type of the event. Always
response.failed.:"response.failed"
-
object: :eventThe object of the event. Always
event.:event
-
Response Incomplete Webhook Event
-
class ResponseIncompleteWebhookEventSent when a background response has been interrupted.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the model response was interrupted.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the model response.
-
-
type: :"response.incomplete"The type of the event. Always
response.incomplete.:"response.incomplete"
-
object: :eventThe object of the event. Always
event.:event
-
Unwrap Webhook Event
-
UnwrapWebhookEvent = BatchCancelledWebhookEvent | BatchCompletedWebhookEvent | BatchExpiredWebhookEvent | 12 moreSent when a batch API request has been cancelled.
-
class BatchCancelledWebhookEventSent when a batch API request has been cancelled.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the batch API request was cancelled.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the batch API request.
-
-
type: :"batch.cancelled"The type of the event. Always
batch.cancelled.:"batch.cancelled"
-
object: :eventThe object of the event. Always
event.:event
-
-
class BatchCompletedWebhookEventSent when a batch API request has been completed.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the batch API request was completed.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the batch API request.
-
-
type: :"batch.completed"The type of the event. Always
batch.completed.:"batch.completed"
-
object: :eventThe object of the event. Always
event.:event
-
-
class BatchExpiredWebhookEventSent when a batch API request has expired.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the batch API request expired.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the batch API request.
-
-
type: :"batch.expired"The type of the event. Always
batch.expired.:"batch.expired"
-
object: :eventThe object of the event. Always
event.:event
-
-
class BatchFailedWebhookEventSent when a batch API request has failed.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the batch API request failed.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the batch API request.
-
-
type: :"batch.failed"The type of the event. Always
batch.failed.:"batch.failed"
-
object: :eventThe object of the event. Always
event.:event
-
-
class EvalRunCanceledWebhookEventSent when an eval run has been canceled.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the eval run was canceled.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the eval run.
-
-
type: :"eval.run.canceled"The type of the event. Always
eval.run.canceled.:"eval.run.canceled"
-
object: :eventThe object of the event. Always
event.:event
-
-
class EvalRunFailedWebhookEventSent when an eval run has failed.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the eval run failed.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the eval run.
-
-
type: :"eval.run.failed"The type of the event. Always
eval.run.failed.:"eval.run.failed"
-
object: :eventThe object of the event. Always
event.:event
-
-
class EvalRunSucceededWebhookEventSent when an eval run has succeeded.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the eval run succeeded.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the eval run.
-
-
type: :"eval.run.succeeded"The type of the event. Always
eval.run.succeeded.:"eval.run.succeeded"
-
object: :eventThe object of the event. Always
event.:event
-
-
class FineTuningJobCancelledWebhookEventSent when a fine-tuning job has been cancelled.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the fine-tuning job was cancelled.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the fine-tuning job.
-
-
type: :"fine_tuning.job.cancelled"The type of the event. Always
fine_tuning.job.cancelled.:"fine_tuning.job.cancelled"
-
object: :eventThe object of the event. Always
event.:event
-
-
class FineTuningJobFailedWebhookEventSent when a fine-tuning job has failed.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the fine-tuning job failed.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the fine-tuning job.
-
-
type: :"fine_tuning.job.failed"The type of the event. Always
fine_tuning.job.failed.:"fine_tuning.job.failed"
-
object: :eventThe object of the event. Always
event.:event
-
-
class FineTuningJobSucceededWebhookEventSent when a fine-tuning job has succeeded.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the fine-tuning job succeeded.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the fine-tuning job.
-
-
type: :"fine_tuning.job.succeeded"The type of the event. Always
fine_tuning.job.succeeded.:"fine_tuning.job.succeeded"
-
object: :eventThe object of the event. Always
event.:event
-
-
class RealtimeCallIncomingWebhookEventSent when Realtime API Receives a incoming SIP call.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the model response was completed.
-
data: Data{ call_id, sip_headers}Event data payload.
-
call_id: StringThe unique ID of this call.
-
sip_headers: Array[SipHeader{ name, value}]Headers from the SIP Invite.
-
name: StringName of the SIP Header.
-
value: StringValue of the SIP Header.
-
-
-
type: :"realtime.call.incoming"The type of the event. Always
realtime.call.incoming.:"realtime.call.incoming"
-
object: :eventThe object of the event. Always
event.:event
-
-
class ResponseCancelledWebhookEventSent when a background response has been cancelled.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the model response was cancelled.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the model response.
-
-
type: :"response.cancelled"The type of the event. Always
response.cancelled.:"response.cancelled"
-
object: :eventThe object of the event. Always
event.:event
-
-
class ResponseCompletedWebhookEventSent when a background response has been completed.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the model response was completed.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the model response.
-
-
type: :"response.completed"The type of the event. Always
response.completed.:"response.completed"
-
object: :eventThe object of the event. Always
event.:event
-
-
class ResponseFailedWebhookEventSent when a background response has failed.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the model response failed.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the model response.
-
-
type: :"response.failed"The type of the event. Always
response.failed.:"response.failed"
-
object: :eventThe object of the event. Always
event.:event
-
-
class ResponseIncompleteWebhookEventSent when a background response has been interrupted.
-
id: StringThe unique ID of the event.
-
created_at: IntegerThe Unix timestamp (in seconds) of when the model response was interrupted.
-
data: Data{ id}Event data payload.
-
id: StringThe unique ID of the model response.
-
-
type: :"response.incomplete"The type of the event. Always
response.incomplete.:"response.incomplete"
-
object: :eventThe object of the event. Always
event.:event
-
-