---
title: "POST /v1alpha/aisafety:classifyContent"
method: POST
path: "/v1alpha/aisafety:classifyContent"
tags: ["aisafety"]
---

# POST /v1alpha/aisafety:classifyContent

`POST /v1alpha/aisafety:classifyContent`

Analyze a piece of content with the provided set of policies.

## Request body

- GoogleChecksAisafetyV1alphaClassifyContentRequest — Request proto for ClassifyContent RPC.
  - `context` GoogleChecksAisafetyV1alphaClassifyContentRequestContext — Context about the input that will be used to help on the classification.
    - `prompt` string — Optional. Prompt that generated the model response.
  - `classifierVersion` 'CLASSIFIER_VERSION_UNSPECIFIED' | 'STABLE' | 'LATEST' — Optional. Version of the classifier to use. If not specified, the latest version will be used.
  - `policies` GoogleChecksAisafetyV1alphaClassifyContentRequestPolicyConfig[] — Required. List of policies to classify against.
    - `threshold` number, float — Optional. Score threshold to use when deciding if the content is violative or non-violative. If not specified, the default 0.5 threshold for the policy will be used.
    - `policyType` 'POLICY_TYPE_UNSPECIFIED' | 'DANGEROUS_CONTENT' | 'PII_SOLICITING_RECITING' | 'HARASSMENT' | 'SEXUALLY_EXPLICIT' | 'HATE_SPEECH' | 'MEDICAL_INFO' | 'VIOLENCE_AND_GORE' | 'OBSCENITY_AND_PROFANITY' — Required. Type of the policy.
  - `input` GoogleChecksAisafetyV1alphaClassifyContentRequestInputContent — Content to be classified.
    - `textInput` GoogleChecksAisafetyV1alphaTextInput — Text input to be classified.
      - `content` string — Actual piece of text to be classified.
      - `languageCode` string — Optional. Language of the text in ISO 639-1 format. If the language is invalid or not specified, the system will try to detect it.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/checks.md) · [All operations](https://skmtc.dev/google/apis/checks/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/checks/revisions/08c0fbb26a65/schema)
