'OpenAI' object has no attribute 'Moderation'

Good Afternoon,

I’m in the early days of development, messed with general responses but now tinkering with the moderation endpoint however I’m finding myself met with the following error.

'OpenAI' object has no attribute 'Moderation'

Now, I’ve gone ahead and updated openai via pip with no change in error.
I’m currently using this basic code, though apologies if I’m missing the obvious her (obviously API key is setup in the environment and whatnot prior)

client = OpenAI()
response = client.Moderation.create(

Thanks folks, I appreciate it

from openai import OpenAI
client = OpenAI()

response = client.moderations.create(input="Banana time.")


Golden, thank you for clarifying there!