@Lalit_Kumar
below is the candidate array
[
{
"content": {
"parts": [
{
"text": "\nHere's a breakdown of the pricing for Gemini image models: \n\n **Gemini 2.5 Flash Image Preview** \n\n * **Input price (text/image):** $0.30 per 1M tokens (paid tier, standard mode); $0.15 per 1M tokens (paid tier, batch mode). \n * **Output price:** $0.039 per image for images up to 1024x1024px (paid tier, standard mode); $0.0195 per image for images up to 1024x1024px (paid tier, batch mode). \n * Image output is priced at $30 per 1,000,000 tokens, with 1290 tokens consumed per image up to 1024x1024px, equating to $0.039 per image. \n\n **Gemini 2.0 Flash** \n\n * **Image generation pricing:** $0.039 per image (paid tier, standard mode); $0.0195 per image (paid tier, batch mode). \n * Image output is priced at $30 per 1,000,000 tokens, with 1290 tokens consumed per image up to 1024x1024px, equating to $0.039 per image. \n\n **Imagen 4** \n\n * **Imagen 4 Fast image price:** $0.02 per image (paid tier). \n * **Imagen 4 Standard image price:** $0.04 per image (paid tier). \n * **Imagen 4 Ultra image price:** $0.06 per image (paid tier). \n\n **Imagen 3** \n\n * **Image price:** $0.03 per image (paid tier). \n\n Google AI Studio usage for these models is free in all available regions."
}
],
"role": "model"
},
"finishReason": "STOP",
"urlContextMetadata": {
"urlMetadata": [
{
"retrievedUrl": "https://ai.google.dev/gemini-api/docs/pricing",
"urlRetrievalStatus": "URL_RETRIEVAL_STATUS_SUCCESS"
},
{
"retrievedUrl": "https://ai.google.dev/gemini-api/docs/pricing",
"urlRetrievalStatus": "URL_RETRIEVAL_STATUS_SUCCESS"
}
]
},
"groundingMetadata": {
"groundingChunks": [
{
"web": {
"uri": "https://ai.google.dev/gemini-api/docs/pricing",
"title": "Gemini Developer API Pricing | Gemini API | Google AI for Developers"
}
},
{
"web": {
"uri": "https://ai.google.dev/gemini-api/docs/pricing",
"title": "Gemini Developer API Pricing | Gemini API | Google AI for Developers"
}
}
],
"groundingSupports": [
{
"segment": {
"startIndex": 102,
"endIndex": 228,
"text": "* **Input price (text/image):** $0.30 per 1M tokens (paid tier, standard mode); $0.15 per 1M tokens (paid tier, batch mode)."
},
"groundingChunkIndices": [1]
},
{
"segment": {
"startIndex": 231,
"endIndex": 398,
"text": "* **Output price:** $0.039 per image for images up to 1024x1024px (paid tier, standard mode); $0.0195 per image for images up to 1024x1024px (paid tier, batch mode)."
},
"groundingChunkIndices": [1]
},
{
"segment": {
"startIndex": 401,
"endIndex": 541,
"text": "* Image output is priced at $30 per 1,000,000 tokens, with 1290 tokens consumed per image up to 1024x1024px, equating to $0.039 per image."
},
"groundingChunkIndices": [1]
},
{
"segment": {
"startIndex": 569,
"endIndex": 690,
"text": "* **Image generation pricing:** $0.039 per image (paid tier, standard mode); $0.0195 per image (paid tier, batch mode)."
},
"groundingChunkIndices": [1]
},
{
"segment": {
"startIndex": 693,
"endIndex": 833,
"text": "* Image output is priced at $30 per 1,000,000 tokens, with 1290 tokens consumed per image up to 1024x1024px, equating to $0.039 per image."
},
"groundingChunkIndices": [1]
},
{
"segment": {
"startIndex": 853,
"endIndex": 916,
"text": "* **Imagen 4 Fast image price:** $0.02 per image (paid tier)."
},
"groundingChunkIndices": [1]
},
{
"segment": {
"startIndex": 919,
"endIndex": 986,
"text": "* **Imagen 4 Standard image price:** $0.04 per image (paid tier)."
},
"groundingChunkIndices": [1]
},
{
"segment": {
"startIndex": 989,
"endIndex": 1053,
"text": "* **Imagen 4 Ultra image price:** $0.06 per image (paid tier)."
},
"groundingChunkIndices": [1]
},
{
"segment": {
"startIndex": 1073,
"endIndex": 1122,
"text": "* **Image price:** $0.03 per image (paid tier)."
},
"groundingChunkIndices": [1]
},
{
"segment": {
"startIndex": 1126,
"endIndex": 1199,
"text": "Google AI Studio usage for these models is free in all available regions."
},
"groundingChunkIndices": [1]
}
]
},
"index": 0
}
]
And this is usageMetadata
{
promptTokenCount: 71,
candidatesTokenCount: 477,
totalTokenCount: 15598,
cachedContentTokenCount: 33,
promptTokensDetails: [ { modality: 'TEXT', tokenCount: 71 } ],
cacheTokensDetails: [ { modality: 'TEXT', tokenCount: 33 } ],
toolUsePromptTokenCount: 15050,
toolUsePromptTokensDetails: [ { modality: 'TEXT', tokenCount: 15050 } ]
}
Tool used-
const tools = [
{ urlContext: {} },
];
Model and query
const model = 'gemini-2.5-flash';
const contents = [
{
role: 'user',
parts: [
{
text: `url- https://ai.google.dev/gemini-api/docs/pricing
user_query- what is the pricing for gemini image models`,
},
],
},
];