Gemini-3.1-flash-lite inline Batch returns item-level INVALID_ARGUMENT while gemini-2.5-flash succeeds

Hi Gemini API Team,

We are seeing a model-specific issue with inline Batch API requests using the Gemini Developer API v1beta.

Environment

  • API surface: Gemini Developer API v1beta
  • SDK: @google/genai@2.15.0
  • Batch type: Inline Batch
  • Request structure: batch.inputConfig.requests.requests
  • Authentication: Server-side Gemini API key
  • Billing tier: Tier 1

Affected Batch Job

  • Model: gemini-3.1-flash-lite
  • Batch Job ID: batches/dyvyb7296ks4z65ferrkswy00l0o4xwzdez5
  • Job terminal state: JOB_STATE_SUCCEEDED
  • Item result: code 3 INVALID_ARGUMENT
  • Model response: none
  • UsageMetadata: none

Minimal Reproduction

The failing control request contained only:

  • One inline text-only item
  • One user text part
  • No audio
  • No Files URI
  • No response schema
  • No structured output
  • No system instruction
  • No tools or code execution
  • No safetySettings
  • No cachedContent
  • No explicit generationConfig
  • No explicit temperature
  • No explicit thinkingConfig

The request was generated by the official @google/genai@2.15.0 SDK.

Controlled Comparison

We ran the same minimal inline Batch test using:

  • The same project
  • The same API key
  • The same SDK version
  • The same API version
  • The same Edge runtime
  • The same Batch wrapper
  • The same text-only request structure

The only material difference was the model.

gemini-2.5-flash result:

  • Batch job accepted
  • Terminal state: JOB_STATE_SUCCEEDED
  • Item response: successful
  • Finish reason: STOP
  • UsageMetadata returned
  • Usage: 15 input tokens, 10 candidate output tokens, 28 thinking tokens, 53 total tokens

gemini-3.1-flash-lite result:

  • Batch job accepted
  • Terminal state: JOB_STATE_SUCCEEDED
  • Item response: none
  • Item error: code 3 INVALID_ARGUMENT
  • UsageMetadata: none

The official SDK-generated text request structures were equivalent apart from the model name and diagnostic metadata.

Because gemini-2.5-flash succeeds under the same project, credential, SDK, API version, and inline Batch wrapper, this appears to be specific to the gemini-3.1-flash-lite Batch model path rather than a general project, credential, or request-wrapper issue.

Could someone from the Gemini API team please confirm:

  1. Is gemini-3.1-flash-lite currently fully enabled for inline Batch requests through the Gemini Developer API v1beta?
  2. Is there a known model-specific issue where the Batch job reaches JOB_STATE_SUCCEEDED but every item returns code 3 INVALID_ARGUMENT?
  3. Are there any rollout, entitlement, region, or project-specific availability requirements?
  4. Does gemini-3.1-flash-lite require any additional Batch-only request field that gemini-2.5-flash does not require?
  5. Can the backend validation reason for the affected Batch Job ID be checked?

Safe diagnostic fingerprints are available if needed. No API keys, secrets, user data, or private content are included in this report.

Thank you.

Hello @kangseogbeom ,

We were unable to reproduce item-level invalid argument errors with standard test payloads. Could you please share your complete code snippet and raw request payload so we can investigate further?

Thank you for looking into this.

I have attached the requested sanitized reproduction artifacts:

  • minimal-repro.ts — minimal reproduction using @google/genai@2.15.0
  • sdk-wire-sanitized.json — SDK-serialized request body captured before the provider call

No API keys, authorization headers, secrets, user data, or private file URIs are included.

One correction to my original post: the affected gemini-3.1-flash-lite job contained four inline items. Item A was the minimal text-only control, and all four items returned the same code 3 error. The successful gemini-2.5-flash comparison was a separate single-item text-only Batch job.

Please let me know if any additional sanitized diagnostic information is needed.

import { GoogleGenAI } from “@google/genai”;

const apiKey = process.env.GEMINI_API_KEY;
if (!apiKey) {
throw new Error(“GEMINI_API_KEY is required”);
}

const ai = new GoogleGenAI({
apiKey,
httpOptions: {
apiVersion: “v1beta”,
timeout: 120_000,
},
});

const job = await ai.batches.create({
model: “gemini-3.1-flash-lite”,
src: [
{
contents: [
{
role: “user”,
parts: [{ text: “Reply with exactly: sdk text control ok” }],
},
],
metadata: { key: “sdk_matrix_text_control” },
},
],
config: {
displayName: “d5r27-sdk-minimal-repro”,
},
});

console.log(JSON.stringify({
accepted: typeof job.name === “string” && job.name.startsWith(“batches/”),
state: job.state ?? “JOB_STATE_UNSPECIFIED”,
}));

{
“method”: “POST”,
“path”: “/v1beta/models/gemini-3.1-flash-lite:batchGenerateContent”,
“body”: {
“batch”: {
“inputConfig”: {
“requests”: {
“requests”: [
{
“request”: {
“contents”: [
{
“parts”: [
{
“text”: “<SYNTHETIC_TEXT>”
}
],
“role”: “user”
}
]
},
“metadata”: {
“key”: “sdk_matrix_text_control”
}
}
]
}
},
“displayName”: “d5r27-sdk-minimal-repro”
}
}
}