#Moderation Tokenizer

1 messages · Page 1 of 1 (latest)

honest mural
#

What tokenizer does the Moderation API use? The rate limit is 340'000 tps (All moderation endpoints combined) on my tier which is less than GPT 4o I think. How many tokens do images consume?

warped mauveBOT
#

Hi @honest mural. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

The Moderation API from OpenAI is designed to check whether content complies with OpenAI's usage policies. It provides classification capabilities that look for content in various categories. The models take in an arbitrary sized input that is automatically broken up into chunks of 4,096 tokens. If the input is more than 32,768 tokens, truncation is used which may omit a small number of tokens from the moderation check source (https://platform.openai.com/docs/models).

As for images, they are metered and charged in tokens, just like text inputs. The token cost of a given image is determined by its size and the detail option on each image_url block. All images with detail: low cost 85 tokens each. detail: high images are first scaled to fit within a 2048 x 2048 square, maintaining their aspect ratio. Then, they are scaled such that the shortest side of the image is 768px long. Finally, the number of 512px squares the image consists of is counted. Each of those squares costs 170 tokens. An additional 85 tokens are always added to the final total source (https://platform.openai.com/docs/guides/vision).

As for the rate limit, it depends on your usage tier. You can view the rate and usage limits for your organization under the limits section of your account settings. As your usage of the OpenAI API and your spend on the API goes up, you are automatically graduated to the next usage tier, which usually results in an increase in rate limits across most models source (https://platform.openai.com/docs/guides/rate-limits).

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: