POST
POST /moderations — OpenAI API
OpenAI API key (required); https://api.openai.com/v1
OpenAI APICreate moderation
- Base URL
- https://api.openai.com/v1
- Auth
- Authorization: Bearer <OPENAI_API_KEY>
- Last verified
- 2026-10-20 · upstream hash matched
Actions Try in browser→
Agents: curl -H "Accept: text/markdown" this URL
→ 224 tokens · Vary: Accept
→ 224 tokens · Vary: Accept
Critical gotchas
The Responses API is the primary interface for new text and tool workflows; Chat Completions remains a separate compatibility API.
Audio transcription uploads use multipart form data rather than a JSON request body.
cURL
curl -X POST 'https://api.openai.com/v1/moderations' \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "input": "...text to classify goes here..."}'
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| input | body | string | Yes | Input (or inputs) to classify. Can be a single string, an array of strings, or an array of multi-modal input objects similar to other models. |
| model | body | string | No | The content moderation model you would like to use. Learn more in [the moderation guide](https://developers.openai.com/api/docs/guides/moderation), and learn about available models [here](https://developers.openai.com/api/docs/guides/moderation). |
Response 200 OK
{
"id": "string",
"model": "string",
"results": [
{
"flagged": true,
"categories": {
"hate": true,
"hate/threatening": true,
"harassment": true,
"harassment/threatening": true,
"illicit": true,
"illicit/violent": true,
"self-harm": true,
"self-harm/intent": true,
"self-harm/instructions": true,
"sexual": true,
"sexual/minors": true,
"violence": true,
"violence/graphic": true
},
"category_scores": {
"hate": 0,
"hate/threatening": 0,
"harassment": 0,
"harassment/threatening": 0,
"illicit": 0,
"illicit/violent": 0,
"self-harm": 0,
"self-harm/intent": 0,
"self-harm/instructions": 0,
"sexual": 0,
"sexual/minors": 0,
"violence": 0,
"violence/graphic": 0
},
"category_applied_input_types": {
"hate": [
"text"
],
"hate/threatening": [
"text"
],
"harassment": [
"text"
],
"harassment/threatening": [
"text"
],
"illicit": [
"text"
],
"illicit/violent": [
"text"
],
"self-harm": [
"text"
],
"self-harm/intent": [
"text"
],
"self-harm/instructions": [
"text"
],
"sexual": [
"text"
],
"sexual/minors": [
"text"
],
"violence": [
"text"
],
"violence/graphic": [
"text"
]
}
}
]
} Get a free OpenAI API key → sponsored Affiliate link - we may earn a commission, at no extra cost to you.