Moderations
curl --request POST \
--url https://zero.cat/v1/moderations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "<string>",
"model": "text-moderation-latest"
}
'import requests
url = "https://zero.cat/v1/moderations"
payload = {
"input": "<string>",
"model": "text-moderation-latest"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({input: '<string>', model: 'text-moderation-latest'})
};
fetch('https://zero.cat/v1/moderations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"model": "<string>",
"results": [
{
"flagged": true,
"categories": {},
"category_scores": {}
}
]
}内容审查
Moderations
检查文本内容是否违反使用政策
POST
/
v1
/
moderations
Moderations
curl --request POST \
--url https://zero.cat/v1/moderations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "<string>",
"model": "text-moderation-latest"
}
'import requests
url = "https://zero.cat/v1/moderations"
payload = {
"input": "<string>",
"model": "text-moderation-latest"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({input: '<string>', model: 'text-moderation-latest'})
};
fetch('https://zero.cat/v1/moderations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"model": "<string>",
"results": [
{
"flagged": true,
"categories": {},
"category_scores": {}
}
]
}
