input: ModerationResult { categories, category_applied_input_types, category_scores, 3 more } | Error { code, message, type }

Moderation for the response input.

One of the following:
ModerationResult { categories, category_applied_input_types, category_scores, 3 more }

A moderation result produced for the response input or output.

categories: Record<string, boolean>

A dictionary of moderation categories to booleans, True if the input is flagged under this category.

category_applied_input_types: Record<string, Array<"text" | "image">>

Which modalities of input are reflected by the score for each category.

One of the following:
"text"
"image"
category_scores: Record<string, number>

A dictionary of moderation categories to scores.

flagged: boolean

A boolean indicating whether the content was flagged by any category.

model: string

The moderation model that produced this result.

type: "moderation_result"

The object type, which was always moderation_result for successful moderation results.

Error { code, message, type }

An error produced while attempting moderation for the response input or output.

code: string

The error code.

message: string

The error message.

type: "error"

The object type, which was always error for moderation failures.

output: ModerationResult { categories, category_applied_input_types, category_scores, 3 more } | Error { code, message, type }

Moderation for the response output.

One of the following:
ModerationResult { categories, category_applied_input_types, category_scores, 3 more }

A moderation result produced for the response input or output.

categories: Record<string, boolean>

A dictionary of moderation categories to booleans, True if the input is flagged under this category.

category_applied_input_types: Record<string, Array<"text" | "image">>

Which modalities of input are reflected by the score for each category.

One of the following:
"text"
"image"
category_scores: Record<string, number>

A dictionary of moderation categories to scores.

flagged: boolean

A boolean indicating whether the content was flagged by any category.

model: string

The moderation model that produced this result.

type: "moderation_result"

The object type, which was always moderation_result for successful moderation results.

Error { code, message, type }

An error produced while attempting moderation for the response input or output.

code: string

The error code.

message: string

The error message.

type: "error"

The object type, which was always error for moderation failures.