Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(openai): add support for OpenAI Moderation API #5439

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danielsogl
Copy link

@danielsogl danielsogl commented Mar 28, 2025

  • Introduced the OpenAI Moderation API, allowing content compliance checks with OpenAI's usage policies.
  • Added usage examples for moderating text and images.
  • Created TypeScript types and schemas for moderation responses and categories.
  • Implemented tests for the moderation model to ensure functionality and accuracy.

closes #2555 #2521

@danielsogl danielsogl changed the title feat (openai): add support for OpenAI Moderation API with detailed do… feat (openai): add support for OpenAI Moderation API Mar 28, 2025
@danielsogl danielsogl force-pushed the feature/openai_moderation_api branch 3 times, most recently from 0d332b6 to 3f16c9a Compare March 29, 2025 12:44
@danielsogl danielsogl changed the title feat (openai): add support for OpenAI Moderation API feat(openai): add support for OpenAI Moderation API Mar 29, 2025
@danielsogl danielsogl force-pushed the feature/openai_moderation_api branch 3 times, most recently from 4204b0e to fd47dac Compare April 2, 2025 17:27
@danielsogl
Copy link
Author

@lgrammel I hope it’s okay to tag you in my PR. I recently worked on a project migrating everything to the AI SDK. The Moderation API is the last piece of the puzzle to finally remove the OpenAI SDK from the project.

Kind regards

@danielsogl danielsogl force-pushed the feature/openai_moderation_api branch 2 times, most recently from 2d37bd8 to 336fea5 Compare April 3, 2025 17:34
@danielsogl danielsogl force-pushed the feature/openai_moderation_api branch from 336fea5 to c3cee5c Compare April 4, 2025 08:03
@lgrammel
Copy link
Collaborator

lgrammel commented Apr 4, 2025

@danielsogl the goal of the ai sdk is to provide unified apis across many providers (with specs etc). this is very openai specific. we might add it at some point, but for now my recommendation would be to use the openai sdk or directly call their api with fetch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How can i use moderation api from open ai with vercel ai sdk, there was nothing about this in vercel ai docs
2 participants