capabilities.work

Moderate then Chat

A 2-step recipe with OpenAI. We can help you get access.

Recipe · 2 steps

Moderate then Chat

with OpenAI

Moderate input text and create a chat completion only when it is allowed.

  1. Classify the user input for policy violations.
  2. Create a chat completion for the moderated, allowed user message.
What you'll need to have ready
  • apiKey: OpenAI API key used as a Bearer token.
  • chatModel: The model id for the chat completion (e.g. gpt-4o-mini).
  • userMessage: The user message to moderate and then send to the model.
For your developer

Arazzo workflow openai:moderate-then-chat, 2 operations: createModeration → createChatCompletion. Specs on APIs.io.