---
title: OpenAI Moderationen | RunAPI
description: Eine Anfrage über RunAPIs OpenAI-kompatible Moderations-Operation senden.
url: https://runapi.ai/de/docs/api/openai/moderations.md
canonical: https://runapi.ai/de/docs/api/openai/moderations
locale: de
---

> HTML-Version: https://runapi.ai/de/docs/api/openai/moderations
> Website-Index für KI-Agenten: https://runapi.ai/llms.txt

# OpenAI Moderationen

## Übersicht

Verwende RunAPI's OpenAI-kompatible Moderations-Operation mit einem kompatiblen Modell sowie den Anfrage- und Antwortstrukturen des Protokolls.

### Schnellstart

1. Erstellen Sie einen API-Schlüssel und setzen Sie ihn als RUNAPI_API_KEY.
2. Wählen Sie ein kompatibles Modell, senden Sie dann die dokumentierten Pfadparameter und den JSON-Body.
3. Lesen Sie die für diesen Vorgang angezeigte JSON-Antwort oder die server-sent events und behandeln Sie Protokollfehler.

## Endpunkt

POST /v1/moderations

Basis-URL: https://runapi.ai

Vertragsversion: v1

Bevorzugte Authentifizierung: Authorization: Bearer YOUR_API_TOKEN

## Authentifizierungsträger

RunAPI akzeptiert jeden der unten aufgeführten Träger. Generierte Beispiele verwenden den bevorzugten Header des Protokolls.

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

## Kompatible Modelle

Öffnen Sie eine Modellseite für aktuelle Preise, Ratenlimits und Details zur kommerziellen Nutzung.

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

## Anfrage-Vertrag

Es werden nur Felder aufgeführt, für die sowohl öffentliche Protokoll- als auch RunAPI-Unterstützung belegt ist. Weitere JSON-Body-Felder werden durchgereicht.

### JSON-Body

Erforderlich: `input`

```json
{
  "input": {
    "description": "Text oder gemischter Text- und Bildinhalt zur Klassifikation.",
    "items": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "additionalProperties": true,
          "type": "object"
        }
      ]
    },
    "type": [
      "string",
      "array"
    ]
  },
  "model": {
    "description": "RunAPI-Moderationsmodellbezeichner; Standard ist omni-moderation-latest.",
    "type": "string"
  }
}
```

### Anfragebeispiel

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

## Synchrone Antwort

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"
}
```

### Beispiel

```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
    }
  ]
}
```

## Protokollfehler: 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"
}
```

### Beispiel

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

## Generierte Code-Beispiele

Jedes cURL-, JavaScript- und Python-Beispiel sendet die validierte Anfrage aus diesem Vertrag, ohne ein protokollspezifisches SDK zu benötigen.

### 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

#### Installieren

```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())
```

## Verwandte Anleitungen

- [Authentifizierung](https://runapi.ai/de/docs/guides/authentication.md)
- [Schnellstart](https://runapi.ai/de/docs/guides/llm-api/quickstart.md)

---

## Mehr von RunAPI

- [Startseite](https://runapi.ai/de/.md)
- [Modellkatalog](https://runapi.ai/de/models.md)
- [Preise](https://runapi.ai/de/pricing.md)
- [Anbieter](https://runapi.ai/de/models)
- [Dokumentation](https://runapi.ai/de/docs/guides)
- [SDKs](https://runapi.ai/de/sdk.md)
- [CLI](https://runapi.ai/de/cli.md)
- [MCP Server](https://runapi.ai/de/mcp.md)
- [Claude Code vs Cursor](https://runapi.ai/de/claude-code-vs-cursor.md)
- [Cursor API-Einrichtung](https://runapi.ai/de/cursor-api-setup.md)
- [RunAPI vs OpenRouter](https://runapi.ai/de/openrouter-alternative.md)
- [Enterprise](https://runapi.ai/de/contact.md)
- [Kontakt](https://runapi.ai/de/contact.md)
- [Bedingungen](https://runapi.ai/de/terms.md)
- [Datenschutz](https://runapi.ai/de/privacy.md)
- [Website-Index für KI-Agenten](https://runapi.ai/llms.txt)

Kontakt: contact@runapi.ai

## Strukturierte Daten

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "de",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/de",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/de/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "de",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/de",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/deicon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "de",
    "@type": "TechArticle",
    "headline": "OpenAI Moderationen",
    "description": "Eine Anfrage über RunAPIs OpenAI-kompatible Moderations-Operation senden.",
    "url": "https://runapi.ai/de/docs/api/openai/moderations",
    "mainEntityOfPage": "https://runapi.ai/de/docs/api/openai/moderations"
  }
]
```
