OpenAI · Arazzo Workflow

OpenAI Moderate then Generate Image

Version 1.0.0

Screen an image prompt, then generate an image only when it is allowed.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub Artificial IntelligenceLarge Language ModelsT1ArazzoWorkflows

Provider

openai

Workflows

moderate-then-generate-image
Moderate an image prompt and generate an image only when allowed.
Classifies the supplied prompt for policy violations, and only when the prompt is not flagged does it request an image from the image generation endpoint.
2 steps inputs: apiKey, imageModel, prompt outputs: firstImage, flagged
1
moderate
Classify the image prompt for policy violations.
2
generateImage
Generate an image from the moderated, allowed prompt.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: OpenAI Moderate then Generate Image
  summary: Screen an image prompt, then generate an image only when it is allowed.
  description: >-
    Runs the image prompt through the moderation classifier and branches: when
    the prompt is flagged the flow ends, and when it is allowed it calls the
    image generation endpoint. Every step spells out its request inline so the
    flow can be read and executed without opening the underlying OpenAPI
    description.
  version: 1.0.0
sourceDescriptions:
- name: imagesApi
  url: ../openapi/openai-images-api-openapi.yml
  type: openapi
- name: moderationsApi
  url: ../openapi/openai-moderations-api-openapi.yml
  type: openapi
workflows:
- workflowId: moderate-then-generate-image
  summary: Moderate an image prompt and generate an image only when allowed.
  description: >-
    Classifies the supplied prompt for policy violations, and only when the
    prompt is not flagged does it request an image from the image generation
    endpoint.
  inputs:
    type: object
    required:
    - apiKey
    - imageModel
    - prompt
    properties:
      apiKey:
        type: string
        description: OpenAI API key used as a Bearer token.
      imageModel:
        type: string
        description: The image model id (e.g. dall-e-3 or gpt-image-1).
      prompt:
        type: string
        description: A text description of the desired image.
  steps:
  - stepId: moderate
    description: Classify the image prompt for policy violations.
    operationId: createModeration
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiKey"
    requestBody:
      contentType: application/json
      payload:
        input: $inputs.prompt
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      flagged: $response.body#/results/0/flagged
    onSuccess:
    - name: promptAllowed
      type: goto
      stepId: generateImage
      criteria:
      - context: $response.body
        condition: $.results[0].flagged == false
        type: jsonpath
    - name: promptFlagged
      type: end
      criteria:
      - context: $response.body
        condition: $.results[0].flagged == true
        type: jsonpath
  - stepId: generateImage
    description: Generate an image from the moderated, allowed prompt.
    operationId: createImage
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiKey"
    requestBody:
      contentType: application/json
      payload:
        model: $inputs.imageModel
        prompt: $inputs.prompt
        n: 1
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      created: $response.body#/created
      firstImage: $response.body#/data/0
  outputs:
    flagged: $steps.moderate.outputs.flagged
    firstImage: $steps.generateImage.outputs.firstImage

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/openai-generate-image-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.