Short Answer
When calling Gemini 4 models such asgemini-4-argon or gemini-4-hydrogen, if modelVersion in the native response differs from the requested model, do not mark the task as successful merely because it returned HTTP 200, and do not immediately retry it automatically.
Keep the response and record the requested model, returned model, responseId, and your business task ID. Mark the task as needs_rerun. After the batch finishes, generate an exception report and decide whether to run a second pass over only those tasks.
How to Confirm the Condition
A native GeminigenerateContent response includes both modelVersion and responseId at the top level:
gemini-4-argon, this returned model is unexpected. Flag it separately at the business layer even if the text looks normal and finishReason is STOP.
- Non-streaming: check
modelVersionin the complete response. - Streaming: inspect every chunk, not only the first one. Public reproductions show that earlier chunks and the final
STOPchunk can report different models under the sameresponseId. - OpenAI-compatible format: do not use the response’s
modelfield as a substitute for this check, because it usually echoes the requested model name. Use the native Gemini format when you need to verify the provider’s returned model.
Recommended Workflow
Verify the model for every request
response.model_version == requested_model. A missing value also needs an exception marker because the actual model cannot be confirmed; do not treat it as a pass by default.Alert and preserve the original result
Isolate the task without stopping the batch
needs_rerun and continue with the remaining tasks. The batch report should summarize at least successes, model-reporting anomalies, other failures, and tasks awaiting a second pass.Run a second pass after review
Python Validation Example
This example uses thegoogle-genai SDK. It makes only one request and leaves the decision to the calling batch program; it does not retry automatically:
needs_rerun is True when the set is empty, contains another model, or contains multiple models. Continue assembling the text chunk by chunk, and check finishReason and usage separately.
What to Record in a Batch Report
responseId, timestamp with time zone, and a sanitized reproduction request. Do not share customer content or complete business datasets.FAQ
Why not retry immediately after detecting a mismatch?
Why not retry immediately after detecting a mismatch?
Does a mismatched value prove that Flash-Lite generated the answer?
Does a mismatched value prove that Flash-Lite generated the answer?
Should every model name be compared strictly?
Should every model name be compared strictly?
latest, receiving a concrete version can be normal. Validate against your explicitly accepted set of versions instead of applying the fixed-ID rule.What if the second pass still returns a different model?
What if the second pass still returns a different model?
responseId values, requested and returned models, timestamps, and a sanitized reproduction request, then contact APIYI support to investigate the provider-side condition.