#142·bytebot

Gemini 2.5 flash / pro got bad request error

Author: ia-kaishenCreated Sep 25, 2025Updated Nov 14, 2025

I put in gemini api key in env GEMINI_API_KEY= already, when I select either gemini 2.5 flash or pro and run the task, it return this error and task return failed.

Below is the llm-proxy log

bytebot-llm-proxy-1 | 02:13:35 - LiteLLM Proxy:ERROR: common_request_processing.py:636 - litellm.proxy.proxy_server._handle_llm_api_exception(): Exception occured - litellm.BadRequestError: VertexAIException BadRequestError - { bytebot-llm-proxy-1 | "error": { bytebot-llm-proxy-1 | "code": 400, bytebot-llm-proxy-1 | "message": "Invalid value at 'tools[0].function_declarations[10].parameters.properties[0].value.enum[0]' (TYPE_STRING), 500", bytebot-llm-proxy-1 | "status": "INVALID_ARGUMENT", bytebot-llm-proxy-1 | "details": [ bytebot-llm-proxy-1 | { bytebot-llm-proxy-1 | "@type": "type.googleapis.com/google.rpc.BadRequest", bytebot-llm-proxy-1 | "fieldViolations": [ bytebot-llm-proxy-1 | { bytebot-llm-proxy-1 | "field": "tools[0].function_declarations[10].parameters.properties[0].value.enum[0]", bytebot-llm-proxy-1 | "description": "Invalid value at 'tools[0].function_declarations[10].parameters.properties[0].value.enum[0]' (TYPE_STRING), 500" bytebot-llm-proxy-1 | } bytebot-llm-proxy-1 | ] bytebot-llm-proxy-1 | } bytebot-llm-proxy-1 | ] bytebot-llm-proxy-1 | } bytebot-llm-proxy-1 | } bytebot-llm-proxy-1 | . Received Model Group=gemini/gemini-2.5-flash bytebot-llm-proxy-1 | Available Model Group Fallbacks=None LiteLLM Retried: 1 times, LiteLLM Max Retries: 2 bytebot-llm-proxy-1 | Traceback (most recent call last): bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py", line 1844, in async_completion bytebot-llm-proxy-1 | response = await client.post( bytebot-llm-proxy-1 | ^^^^^^^^^^^^^^^^^^ bytebot-llm-proxy-1 | api_base, headers=headers, json=cast(dict, request_body) bytebot-llm-proxy-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bytebot-llm-proxy-1 | ) # type: ignore bytebot-llm-proxy-1 | ^ bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/litellm_core_utils/logging_utils.py", line 190, in async_wrapper bytebot-llm-proxy-1 | result = await func(*args, **kwargs) bytebot-llm-proxy-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/llms/custom_httpx/http_handler.py", line 325, in post bytebot-llm-proxy-1 | INFO: 192.168.97.5:46200 - "POST /chat/completions HTTP/1.1" 400 Bad Request bytebot-llm-proxy-1 | raise e bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/llms/custom_httpx/http_handler.py", line 281, in post bytebot-llm-proxy-1 | response.raise_for_status() bytebot-llm-proxy-1 | ~~~~~~~~~~~~~~~~~~~~~~~~~^^ bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/httpx/_models.py", line 829, in raise_for_status bytebot-llm-proxy-1 | raise HTTPStatusError(message, request=request, response=self) bytebot-llm-proxy-1 | httpx.HTTPStatusError: Client error '400 Bad Request' for url 'https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=AIzaSyBWGpyeBUkUAz3qC-la2RDANjBmQ9aiJAw' bytebot-llm-proxy-1 | For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400 bytebot-llm-proxy-1 | bytebot-llm-proxy-1 | During handling of the above exception, another exception occurred: bytebot-llm-proxy-1 | bytebot-llm-proxy-1 | Traceback (most recent call last): bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/main.py", line 554, in acompletion bytebot-llm-proxy-1 | response = await init_response bytebot-llm-proxy-1 | ^^^^^^^^^^^^^^^^^^^ bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py", line 1850, in async_completion bytebot-llm-proxy-1 | raise VertexAIError( bytebot-llm-proxy-1 | ...<3 lines>... bytebot-llm-proxy-1 | ) bytebot-llm-proxy-1 | litellm.llms.vertex_ai.common_utils.VertexAIError: { bytebot-llm-proxy-1 | "error": { bytebot-llm-proxy-1 | "code": 400, bytebot-llm-proxy-1 | "message": "Invalid value at 'tools[0].function_declarations[10].parameters.properties[0].value.enum[0]' (TYPE_STRING), 500", bytebot-llm-proxy-1 | "status": "INVALID_ARGUMENT", bytebot-llm-proxy-1 | "details": [ bytebot-llm-proxy-1 | { bytebot-llm-proxy-1 | "@type": "type.googleapis.com/google.rpc.BadRequest", bytebot-llm-proxy-1 | "fieldViolations": [ bytebot-llm-proxy-1 | { bytebot-llm-proxy-1 | "field": "tools[0].function_declarations[10].parameters.properties[0].value.enum[0]", bytebot-llm-proxy-1 | "description": "Invalid value at 'tools[0].function_declarations[10].parameters.properties[0].value.enum[0]' (TYPE_STRING), 500" bytebot-llm-proxy-1 | } bytebot-llm-proxy-1 | ] bytebot-llm-proxy-1 | } bytebot-llm-proxy-1 | ] bytebot-llm-proxy-1 | } bytebot-llm-proxy-1 | } bytebot-llm-proxy-1 | bytebot-llm-proxy-1 | bytebot-llm-proxy-1 | During handling of the above exception, another exception occurred: bytebot-llm-proxy-1 | bytebot-llm-proxy-1 | Traceback (most recent call last): bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/proxy/proxy_server.py", line 4090, in chat_completion bytebot-llm-proxy-1 | result = await base_llm_response_processor.base_process_llm_request( bytebot-llm-proxy-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bytebot-llm-proxy-1 | ...<16 lines>... bytebot-llm-proxy-1 | ) bytebot-llm-proxy-1 | ^ bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/proxy/common_request_processing.py", line 433, in base_process_llm_request bytebot-llm-proxy-1 | responses = await llm_responses bytebot-llm-proxy-1 | ^^^^^^^^^^^^^^^^^^^ bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/router.py", line 1076, in acompletion bytebot-llm-proxy-1 | raise e bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/router.py", line 1052, in acompletion bytebot-llm-proxy-1 | response = await self.async_function_with_fallbacks(**kwargs) bytebot-llm-proxy-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/router.py", line 3895, in async_function_with_fallbacks bytebot-llm-proxy-1 | return await self.async_function_with_fallbacks_common_utils( bytebot-llm-proxy-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bytebot-llm-proxy-1 | ...<8 lines>... bytebot-llm-proxy-1 | ) bytebot-llm-proxy-1 | ^ bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/router.py", line 3853, in async_function_with_fallbacks_common_utils bytebot-llm-proxy-1 | raise original_exception bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/router.py", line 3887, in async_function_with_fallbacks bytebot-llm-proxy-1 | response = await self.async_function_with_retries(*args, **kwargs) bytebot-llm-proxy-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/router.py", line 4092, in async_function_with_retries bytebot-llm-proxy-1 | raise original_exception bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/router.py", line 3983, in async_function_with_retries bytebot-llm-proxy-1 | response = await self.make_call(original_function, *args, **kwargs) bytebot-llm-proxy-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/router.py", line 4101, in make_call bytebot-llm-proxy-1 | response = await response bytebot-llm-proxy-1 | ^^^^^^^^^^^^^^ bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/router.py", line 1357, in _acompletion bytebot-llm-proxy-1 | raise e bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/router.py", line 1309, in _acompletion bytebot-llm-proxy-1 | response = await _response bytebot-llm-proxy-1 | ^^^^^^^^^^^^^^^ bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/utils.py", line 1599, in wrapper_async bytebot-llm-proxy-1 | raise e bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/utils.py", line 1450, in wrapper_async bytebot-llm-proxy-1 | result = await original_function(*args, **kwargs) bytebot-llm-proxy-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/main.py", line 573, in acompletion bytebot-llm-proxy-1 | raise exception_type( bytebot-llm-proxy-1 | ~~~~~~~~~~~~~~^ bytebot-llm-proxy-1 | model=model, bytebot-llm-proxy-1 | ^^^^^^^^^^^^ bytebot-llm-proxy-1 | ...<3 lines>... bytebot-llm-proxy-1 | extra_kwargs=kwargs, bytebot-llm-proxy-1 | ^^^^^^^^^^^^^^^^^^^^ bytebot-llm-proxy-1 | ) bytebot-llm-proxy-1 | ^ bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py", line 2309, in exception_type bytebot-llm-proxy-1 | raise e bytebot-llm-proxy-1 | File "/usr/lib/python3.13/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py", line 1293, in exception_type bytebot-llm-proxy-1 | raise BadRequestError( bytebot-llm-proxy-1 | ...<11 lines>... bytebot-llm-proxy-1 | ) bytebot-llm-proxy-1 | litellm.exceptions.BadRequestError: litellm.BadRequestError: VertexAIException BadRequestError - { bytebot-llm-proxy-1 | "error": { bytebot-llm-proxy-1 | "code": 400, bytebot-llm-proxy-1 | "message": "Invalid value at 'tools[0].function_declarations[10].parameters.properties[0].value.enum[0]' (TYPE_STRING), 500", bytebot-llm-proxy-1 | "status": "INVALID_ARGUMENT", bytebot-llm-proxy-1 | "details": [ bytebot-llm-proxy-1 | { bytebot-llm-proxy-1 | "@type": "type.googleapis.com/google.rpc.BadRequest", bytebot-llm-proxy-1 | "fieldViolations": [ bytebot-llm-proxy-1 | { bytebot-llm-proxy-1 | "field": "tools[0].function_declarations[10].parameters.properties[0].value.enum[0]", bytebot-llm-proxy-1 | "description": "Invalid value at 'tools[0].function_declarations[10].parameters.properties[0].value.enum[0]' (TYPE_STRING), 500" bytebot-llm-proxy-1 | } bytebot-llm-proxy-1 | ] bytebot-llm-proxy-1 | } bytebot-llm-proxy-1 | ] bytebot-llm-proxy-1 | } bytebot-llm-proxy-1 | } bytebot-llm-proxy-1 | . Received Model Group=gemini/gemini-2.5-flash bytebot-llm-proxy-1 | Available Model Group Fallbacks=None LiteLLM Retried: 1 times, LiteLLM Max Retries: 2