---
title: OpenAI moderaties | RunAPI
description: Stuur een verzoek via de OpenAI-compatibele Moderations-bewerking van
  RunAPI.
url: https://runapi.ai/nl/docs/api/openai/moderations.md
canonical: https://runapi.ai/nl/docs/api/openai/moderations
locale: nl
---

> HTML-versie: https://runapi.ai/nl/docs/api/openai/moderations
> Site-index voor agents: https://runapi.ai/llms.txt

# OpenAI moderaties

## Overzicht

Gebruik RunAPI's OpenAI-compatibele Moderations-bewerking met een compatibel model en de verzoek- en antwoordstructuren van het protocol.

### Snelstart

1. Maak een API-sleutel aan en stel deze in als RUNAPI_API_KEY.
2. Kies een compatibel model en stuur de gedocumenteerde padparameters en JSON-body.
3. Lees de JSON-respons of server-sent events die voor deze bewerking worden weergegeven, en handel protocollfouten af.

## Eindpunt

POST /v1/moderations

Basis-URL: https://runapi.ai

Contractversie: v1

Voorkeursauthenticatie: Authorization: Bearer YOUR_API_TOKEN

## Authenticatiedragers

RunAPI accepteert elke hieronder vermelde carrier. Gegenereerde voorbeelden gebruiken de voorkeurskoptekst van het protocol.

- `Authorization: Bearer YOUR_API_TOKEN` (Voorkeur)
- `x-api-key: YOUR_API_TOKEN`

## Compatibele modellen

Open een modelpagina voor actuele prijzen, snelheidslimieten en details over commercieel gebruik.

- [omni-moderation-latest](https://runapi.ai/nl/models/openai-moderation)

## Verzoekcontract

Alleen velden met zowel openbaar protocol als bewijs van RunAPI-ondersteuning worden vermeld. Aanvullende JSON-bodyvelden worden doorgegeven.

### JSON-body

Vereist: `input`

```json
{
  "input": {
    "description": "Tekst of gemengde tekst- en afbeeldingsinhoud om te classificeren.",
    "items": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "additionalProperties": true,
          "type": "object"
        }
      ]
    },
    "type": [
      "string",
      "array"
    ]
  },
  "model": {
    "description": "RunAPI moderatiemodelidentificator; standaard omni-moderation-latest.",
    "type": "string"
  }
}
```

### Verzoekvoorbeeld

```json
{
  "input": [
    {
      "text": "A peaceful landscape.",
      "type": "text"
    },
    {
      "image_url": {
        "url": "https://runapi.ai/icon.png"
      },
      "type": "image_url"
    }
  ]
}
```

## Synchroon antwoord

HTTP 200

### Schema

```json
{
  "additionalProperties": true,
  "properties": {
    "id": {
      "minLength": 1,
      "type": "string"
    },
    "model": {
      "minLength": 1,
      "type": "string"
    },
    "results": {
      "items": {
        "additionalProperties": true,
        "properties": {
          "categories": {
            "additionalProperties": true,
            "type": "object"
          },
          "category_applied_input_types": {
            "additionalProperties": true,
            "type": "object"
          },
          "category_scores": {
            "additionalProperties": true,
            "type": "object"
          },
          "flagged": {
            "type": "boolean"
          }
        },
        "required": [
          "flagged",
          "categories",
          "category_scores"
        ],
        "type": "object"
      },
      "minItems": 1,
      "type": "array"
    }
  },
  "required": [
    "id",
    "model",
    "results"
  ],
  "type": "object"
}
```

### Voorbeeld

```json
{
  "id": "modr_123",
  "model": "omni-moderation-latest",
  "results": [
    {
      "categories": {
        "sexual": false,
        "violence": false
      },
      "category_applied_input_types": {
        "sexual": [
          "text",
          "image"
        ],
        "violence": [
          "text",
          "image"
        ]
      },
      "category_scores": {
        "sexual": 0.0002,
        "violence": 0.0001
      },
      "flagged": false
    }
  ]
}
```

## Protocolfout: invalid_request

HTTP 400

### Schema

```json
{
  "additionalProperties": true,
  "properties": {
    "error": {
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "message",
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "error"
  ],
  "type": "object"
}
```

### Voorbeeld

```json
{
  "error": {
    "code": null,
    "message": "input is required",
    "param": "input",
    "type": "invalid_request_error"
  }
}
```

## Gegenereerde codevoorbeelden

Elk cURL-, JavaScript- en Python-voorbeeld verstuurt de gevalideerde aanvraag uit dit contract zonder dat een protocolspecifieke SDK vereist is.

### curl

```curl
curl -X POST https://runapi.ai/v1/moderations \
  -H Authorization:\ Bearer\ YOUR_API_TOKEN \
  -H Content-Type:\ application/json \
  -d \{\"input\":\[\{\"type\":\"text\",\"text\":\"A\ peaceful\ landscape.\"\},\{\"type\":\"image_url\",\"image_url\":\{\"url\":\"https://runapi.ai/icon.png\"\}\}\]\}
```

### javascript

```javascript
const response = await fetch("https://runapi.ai/v1/moderations", {
  method: "POST",
  headers: {
  "Authorization": "Bearer YOUR_API_TOKEN",
  "Content-Type": "application/json"
},
  body: JSON.stringify({
  "input": [
    {
      "type": "text",
      "text": "A peaceful landscape."
    },
    {
      "type": "image_url",
      "image_url": {
        "url": "https://runapi.ai/icon.png"
      }
    }
  ]
})
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();
console.log(data);
```

### python

#### Installeren

```bash
pip install requests
```

```python
import requests

response = requests.post(
    "https://runapi.ai/v1/moderations",
    headers={"Authorization": "Bearer YOUR_API_TOKEN", "Content-Type": "application/json"},
    json={"input": [{"type": "text", "text": "A peaceful landscape."}, {"type": "image_url", "image_url": {"url": "https://runapi.ai/icon.png"}}]}
)
response.raise_for_status()
print(response.json())
```

## Gerelateerde handleidingen

- [Authenticatie](https://runapi.ai/nl/docs/guides/authentication.md)
- [Snelstart](https://runapi.ai/nl/docs/guides/llm-api/quickstart.md)

---

## Meer van RunAPI

- [Home](https://runapi.ai/nl/.md)
- [Modelcatalogus](https://runapi.ai/nl/models.md)
- [Prijzen](https://runapi.ai/nl/pricing.md)
- [Providers](https://runapi.ai/nl/models)
- [Documentatie](https://runapi.ai/nl/docs/guides)
- [SDK's](https://runapi.ai/nl/sdk.md)
- [CLI](https://runapi.ai/nl/cli.md)
- [MCP Server](https://runapi.ai/nl/mcp.md)
- [Claude Code vs Cursor](https://runapi.ai/nl/claude-code-vs-cursor.md)
- [Cursor API instellen](https://runapi.ai/nl/cursor-api-setup.md)
- [RunAPI vs OpenRouter](https://runapi.ai/nl/openrouter-alternative.md)
- [Enterprise](https://runapi.ai/nl/contact.md)
- [Contact](https://runapi.ai/nl/contact.md)
- [Voorwaarden](https://runapi.ai/nl/terms.md)
- [Privacy](https://runapi.ai/nl/privacy.md)
- [Site-index voor agents](https://runapi.ai/llms.txt)

Contact: contact@runapi.ai

## Gestructureerde gegevens

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "nl",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/nl",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/nl/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "nl",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/nl",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/nlicon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "nl",
    "@type": "TechArticle",
    "headline": "OpenAI moderaties",
    "description": "Stuur een verzoek via de OpenAI-compatibele Moderations-bewerking van RunAPI.",
    "url": "https://runapi.ai/nl/docs/api/openai/moderations",
    "mainEntityOfPage": "https://runapi.ai/nl/docs/api/openai/moderations"
  }
]
```
