When requesting a response to make an image, is there a way to return something that says the prompt broke the api content guidelines?

I have something similar to an automatic script set to create random images from random words, however some of these words string together that break the community guidelines, and the output is that it doesn’t create an image.

Is there something setup in the api that allows an image response request to return like a specific error number when this happens? Thanks!

1 Like

Hi! This great feedback, what would your ideal workflow look like?

1 Like

Maybe text or text + image we can display?

Also, an error if we reach our limit for 60 seconds? (And who can we contact to get this limit raised if we start getting more traffic?)

Thanks in advance!

ETA: Nevermind, I think I found it. Have to build in error detection in my app…

1 Like

I’m a very young novice programmer so I don’t really know what my ideal workflow means or looks like :sweat_smile: but the changes (or supposed changes it seems, I’m getting new errors of “request being rejected” since I’ve made this post) make my script stop running when the errors flag, when before it would just pass over them.

My idea that could fix it (in my circumstance) could be a variable passed into or made into the ‘response’ request such as a ‘validprompt’ that the request could flag to be true or false, and if false i could do xx or yy rather than it stopping my script. This implementation could be very convoluted of a fix as I don’t have a great grasp at coding yet. If the new flagging of the “Your request was rejected as a result of our safety system.” error can be worked into a solution similar to mine already, I’d love to hear it! Thanks!! : )

2 Likes

I have just learned about catching errors and responding to them when they come up, thanks for the fix guys!

1 Like