input: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }

Moderation for the response input.

moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }

A moderation result produced for the response input or output.

categories: map[boolean]

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

category_applied_input_types: map[array of "text" or "image"]

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

"text"
"image"
category_scores: map[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: object { 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: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }

Moderation for the response output.

moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }

A moderation result produced for the response input or output.

categories: map[boolean]

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

category_applied_input_types: map[array of "text" or "image"]

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

"text"
"image"
category_scores: map[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: object { 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.