Method
string
required
The model to use for the batch job. Example:
gemini-2.0-flash-001BatchJobSource
required
The source of the batch job data:
CreateBatchJobConfig
Configuration options for the batch job
Response
string
The resource name of the batch job
JobState
Current state of the batch job:
JOB_STATE_QUEUED: Job is queuedJOB_STATE_PENDING: Job is pendingJOB_STATE_RUNNING: Job is runningJOB_STATE_SUCCEEDED: Job completed successfullyJOB_STATE_FAILED: Job failedJOB_STATE_CANCELLED: Job was cancelled
string
Timestamp when the job was created
string
Timestamp when the job started processing
string
Timestamp when the job completed
string
The model being used for the batch job
BatchJobDestination
Destination information for the output
object
Statistics about completed requests (Vertex AI only)
Usage
Create Batch Job from GCS (Vertex AI)
Create Batch Job from File (Gemini API)
With Inline Requests (Gemini API)
Monitor Job Progress
BigQuery Input/Output (Vertex AI)
Input Format
For file-based inputs (GCS or Files API), use JSONL format with one request per line:Notes
- Batch jobs process requests asynchronously and may take minutes to hours
- Gemini API has lower quotas than Vertex AI for batch processing
- Results are written to the specified destination upon completion
- Monitor job status using batches.get
- You can cancel running jobs using batches.cancel
See Also
- batches.get - Check batch job status
- batches.list - List all batch jobs
- batches.delete - Delete a batch job