Will OpenAI charge me if there is a BadRequestError?

I received this message: ‘openai.BadRequestError: Error code: 400 - {‘error’: {‘message’: ‘Your input image may contain content that is not allowed by our safety system.’, ‘type’: ‘invalid_request_error’, ‘param’: None, ‘code’: ‘content_policy_violation’}}’ when requesting image detection from GPT4-o.

Will OpenAI charge me if there is a BadRequestError?

Welcome @logan5

Error 400 should not result in any charges.
You can confirm this by checking your usage.

I’d be wary of accumulating content filter warnings though.

2 Likes

@sps Thank you for your response. I would like to review my usage, but since my account is being used for other services, it’s difficult to track the costs. Could you clarify if there will be no charges for both input and output tokens, or only for output tokens?

If you get a bad request error, then the input sent to API could not even be parsed into the individual components of parameters, and likely didn’t even make it to a token encoder, let alone to an AI model. Therefore, no tokens and no cost.

1 Like