Hi, @Lalit_Kumar thanks for the reply!
I’ve already prepared JSONL files to run batch audio generation. Example:
{"key": "<Key>", "request": {"contents": "<Contents>", "generation_config": {"response_modalities": ["AUDIO"], "speech_config": {"voice_config": {"prebuilt_voice_config": {"voice_name": "Leda"}}}}}}
{"key": "<Key>", "request": {"contents": "<Contents>", "generation_config": {"response_modalities": ["AUDIO"], "speech_config": {"voice_config": {"prebuilt_voice_config": {"voice_name": "Leda"}}}}}}
I tested this with 5–10 records, and followed the documentation to upload the JSONL file and create the batch job:
MODEL_NAME = "models/gemini-2.5-flash-preview-tts"
BATCH_DISPLAY_NAME = "batch-narration"
# Upload JSONL file
logger.info(f"Uploading JSONL file: {jsonl_file_path}")
batch_input_file = client.files.upload(
file=str(jsonl_file_path)
)
logger.info(f"Successfully uploaded JSONL file: {batch_input_file.name}")
# Create batch job
logger.info("Creating batch job...")
batch_multimodal_job = client.batches.create(
model=MODEL_NAME,
src=batch_input_file.name,
config={
'display_name': BATCH_DISPLAY_NAME,
}
)
Error observed
Instead of succeeding, I get the following error:
2025-09-24 14:23:09,297 - INFO - HTTP Request: POST https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-preview-tts:batchGenerateContent "HTTP/1.1 404 Not Found"
2025-09-24 14:23:09,299 - ERROR - Error occurred: 404 NOT_FOUND. {'error': {'code': 404, 'message': 'models/gemini-2.5-flash-preview-tts is not found for API version v1beta, or is not supported for batchGenerateContent. Call ListModels to see the list of available models and their supported methods.', 'status': 'NOT_FOUND'}}
I also tried using just "gemini-2.5-flash-preview-tts"
as the model name, but the error persists.
Model inspection
When I query the model info directly:
client = genai.Client(api_key=API_KEY, http_options={'api_version': 'v1beta'})
model_info = client.models.get(model=MODEL_NAME)
print(model_info)
The result is:
2025-09-24 14:23:06,150 - INFO - HTTP Request: GET https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-preview-tts "HTTP/1.1 200 OK"
name='models/gemini-2.5-flash-preview-tts' display_name='Gemini 2.5 Flash Preview TTS' description='Gemini 2.5 Flash Preview TTS' version='gemini-2.5-flash-exp-tts-2025-05-19' endpoints=None labels=None tuned_model_info=TunedModelInfo() input_token_limit=8192 output_token_limit=16384 supported_actions=['countTokens', 'generateContent'] default_checkpoint_id=None checkpoints=None
Analysis
From the supported_actions
field, it looks like this model only supports:
-
countTokens
-
generateContent
There’s no support for batchGenerateContent
, which explains the 404 error when trying to create a batch job.