Different Output In AI Studio and API

I am encountering significant differences in the output that I encounter from the API that I get from AI Studio for the same prompt and document. I am using Gemini Flash 2.0 and my use case is asking the LLM to classify the document based on some criteria provided in the prompt. It is working well in AI studio but isn’t working well when passed through API.
How could I overcome this problem?

Hey @Dhruv_Shah , Make sure the hyperparameters you set in both the API and AIStudio remain the same. Ideally, the model performance should remain the same whether you access it in the API or AIStudio.

Thanks