[INFO] 2026-05-05T04:04:30.690Z [AIStudioToAPI] - [Request] Request dispatched to browser for processing...
[INFO] 2026-05-05T04:04:30.710Z [AIStudioToAPI] - [Context#9] Received request: POST /v1beta/models/gemini-3-flash-preview:streamGenerateContent
[INFO] 2026-05-05T04:04:31.398Z [AIStudioToAPI] - [Context#9] Request processing failed: Google API returned error: 400 INVALID_ARGUMENT {"error":{"code":400,"message":"* GenerateContentRequest.tools[0].function_declarations[1].parameters.required[0]: property is not defined\n* GenerateContentRequest.tools[0].function_declarations[8].parameters.required[0]: property is not defined\n","status":"INVALID_ARGUMENT"}}
[ERROR] 2026-05-05T04:04:31.401Z [AIStudioToAPI] - [Request] Gemini real stream failed after retries. Status code: 400, message: Proxy browser error: Google API returned error: 400 INVALID_ARGUMENT {"error":{"code":400,"message":"* GenerateContentRequest.tools[0].function_declarations[1].parameters.required[0]: property is not defined\n* GenerateContentRequest.tools[0].function_declarations[8].parameters.required[0]: property is not defined\n","status":"INVALID_ARGUMENT"}}
[WARN] 2026-05-05T04:04:31.402Z [AIStudioToAPI] - ⚠️ [Auth] Request failed - failure count: 1/3 (Current account index: 9)
[INFO] 2026-05-05T04:04:31.414Z [AIStudioToAPI] - [Context#9] Sent 'error' information back to server
[INFO] 2026-05-05T04:05:13.587Z [AIStudioToAPI] - [Entrypoint] Received a request: POST /v1beta/models/gemini-3-flash-preview:streamGenerateContent
[INFO] 2026-05-05T04:05:13.593Z [AIStudioToAPI] - [Auth] API Key verification passed (from: 172.20.0.2)
[INFO] 2026-05-05T04:05:13.594Z [AIStudioToAPI] - [Browser] ⚡ User activity detected, forcing Launch detection wakeup...
[INFO] 2026-05-05T04:05:13.594Z [AIStudioToAPI] - [Request] Generation request - account rotation count: 2/10 (Current account: 9)
[INFO] 2026-05-05T04:05:13.627Z [AIStudioToAPI] - [Request] Client enabled streaming (real), entering streaming processing mode...
[INFO] 2026-05-05T04:05:13.627Z [AIStudioToAPI] - [Request] Request dispatched to browser for processing...
[INFO] 2026-05-05T04:05:13.646Z [AIStudioToAPI] - [Context#9] Received request: POST /v1beta/models/gemini-3-flash-preview:streamGenerateContent
[ERROR] 2026-05-05T04:05:14.109Z [AIStudioToAPI] - [Request] Gemini real stream failed after retries. Status code: 400, message: Proxy browser error: Google API returned error: 400 INVALID_ARGUMENT {"error":{"code":400,"message":"* GenerateContentRequest.tools[0].function_declarations[1].parameters.required[0]: property is not defined\n* GenerateContentRequest.tools[0].function_declarations[8].parameters.required[0]: property is not defined\n","status":"INVALID_ARGUMENT"}}
[WARN] 2026-05-05T04:05:14.111Z [AIStudioToAPI] - ⚠️ [Auth] Request failed - failure count: 2/3 (Current account index: 9)
[INFO] 2026-05-05T04:05:14.118Z [AIStudioToAPI] - [Context#9] Request processing failed: Google API returned error: 400 INVALID_ARGUMENT {"error":{"code":400,"message":"* GenerateContentRequest.tools[0].function_declarations[1].parameters.required[0]: property is not defined\n* GenerateContentRequest.tools[0].function_declarations[8].parameters.required[0]: property is not defined\n","status":"INVALID_ARGUMENT"}}
[INFO] 2026-05-05T04:05:14.119Z [AIStudioToAPI] - [Context#9] Sent 'error' information back to server
[INFO] 2026-05-05T04:05:33.591Z [AIStudioToAPI] - [Entrypoint] Received a request: GET /api/version/check
[INFO] 2026-05-05T04:19:22.220Z [AIStudioToAPI] - [Entrypoint] Received a request: POST /v1beta/models/gemini-3-flash-preview:streamGenerateContent
[INFO] 2026-05-05T04:19:22.226Z [AIStudioToAPI] - [Auth] API Key verification passed (from: 172.20.0.2)
[INFO] 2026-05-05T04:19:22.227Z [AIStudioToAPI] - [Browser] ⚡ User activity detected, forcing Launch detection wakeup...
[INFO] 2026-05-05T04:19:22.228Z [AIStudioToAPI] - [Request] Generation request - account rotation count: 3/10 (Current account: 9)
[INFO] 2026-05-05T04:19:22.256Z [AIStudioToAPI] - [Request] Client enabled streaming (real), entering streaming processing mode...
[INFO] 2026-05-05T04:19:22.256Z [AIStudioToAPI] - [Request] Request dispatched to browser for processing...
[INFO] 2026-05-05T04:19:22.274Z [AIStudioToAPI] - [Context#9] Received request: POST /v1beta/models/gemini-3-flash-preview:streamGenerateContent
[ERROR] 2026-05-05T04:19:22.946Z [AIStudioToAPI] - [Request] Gemini real stream failed after retries. Status code: 400, message: Proxy browser error: Google API returned error: 400 INVALID_ARGUMENT {"error":{"code":400,"message":"* GenerateContentRequest.tools[0].function_declarations[1].parameters.required[0]: property is not defined\n* GenerateContentRequest.tools[0].function_declarations[8].parameters.required[0]: property is not defined\n","status":"INVALID_ARGUMENT"}}
[WARN] 2026-05-05T04:19:22.947Z [AIStudioToAPI] - ⚠️ [Auth] Request failed - failure count: 3/3 (Current account index: 9)
[WARN] 2026-05-05T04:19:22.949Z [AIStudioToAPI] - 🔴 [Auth] Failure threshold reached (3/3)! Preparing to switch account...
版本号
v1.2.3
请求接口
Gemini
模型名称
所有
客户端/工具
Hermes CLI v3.12.13
问题描述
[Bug] 转发包含 tools/function_declarations 的请求到 Gemini 时返回 400 INVALID_ARGUMENT
环境信息
POST /v1beta/models/gemini-3-flash-preview:streamGenerateContent问题描述
当上游客户端(Hermes CLI)发送包含
tools/function_declarations的请求时,AIStudioToAPI 将请求原样转发给 Google Gemini API,Gemini 返回400 INVALID_ARGUMENT错误,导致所有带工具调用的请求全部失败。该问题 100% 可复现,只要请求体中携带了
tools字段就会触发。错误详情
Gemini API 返回的错误明确指出:
function_declarations的parameters.required数组中引用的属性,在对应的parameters.properties中未定义:GenerateContentRequest.tools[0].function_declarations[1].parameters.required[0]: property is not definedGenerateContentRequest.tools[0].function_declarations[8].parameters.required[0]: property is not defined完整日志
以下是三次连续失败触发账号轮转的完整日志记录:
日志信息 (关键)