Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Gemini API responseSchema: token count & caching question

Hi, I’m calling the Gemini API with a responseSchema to control JSON output, but I don’t see the schema size reflected anywhere in the usageMetadata the API returns.

So I have the following questions:
1. Does the schema I pass in the responseSchema parameter count toward my input tokens?
2. If so, why isn’t that usage showing up in the usageMetadata field?
3. Why can’t the schema be cached the same way other prompts are—i.e., what makes it ineligible for response caching?

0 0 66
0 REPLIES 0