Question, pricing of API in structured format mode

When I set ‘json_schema’ in the response_format, I think more tokens are needed for sending and receiving the same information in the JSON format I requested? (Compare to when the response_format is text.) So this will make each request more expensive? Is this true?

Yes, the format of a function call requires some additional text, which will always be tokenized in a same way, which will increase the token count for your request.

The actual number of tokens will still probably be negligible in terms of pricing, but if you want to calculate it very precisely, you can take a look at this amazing library and this thread

1 Like