POST /v1beta/interactions rejects "input_image" with HTTP 400 (unsupported input type "input_image")
Environment
- AIStudio2API version:
v0.3.14(Linuxaarch64) - Endpoint:
POST /v1beta/interactions
Observed Behavior
When a client sends a request to POST /v1beta/interactions whose input array contains a content item with "type": "input_image" (e.g., forwarded from an OpenAI Responses-style client or multi-turn tool result), AIStudio2API immediately rejects the request before model dispatch (~9–12 ms) with HTTP 400:
{"error":{"code":400,"message":"unsupported input type \"input_image\"","status":"INVALID_ARGUMENT"}}
Meanwhile, requests on the same POST /v1beta/interactions endpoint using "type": "image" in input succeed with HTTP 200.
Minimal Reproduction
curl -s -X POST "http://127.0.0.1:2048/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: YOUR_API_KEY" \
-d '{
"model": "gemini-4-hydrogen",
"input": [
{"type": "text", "text": "describe"},
{
"type": "input_image",
"data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=",
"mime_type": "image/png"
}
]
}'
Actual response (HTTP 400):
{"error":{"code":400,"message":"unsupported input type \"input_image\"","status":"INVALID_ARGUMENT"}}
Server Log Excerpts
From aistudio2api journald logs (redacted):
{"time":"2026-11-23T10:35:46.121507135+08:00","level":"ERROR","msg":"Request failed","event":"request.finished","source":"request","request":{"id":"req_1795401346109650610_92","state":"failed","method":"POST","path":"/v1beta/interactions","status":400,"duration_ms":11.854085,"error":"unsupported input type \"input_image\""}}
{"time":"2026-11-23T10:35:46.30860459+08:00","level":"ERROR","msg":"Request failed","event":"request.finished","source":"request","request":{"id":"req_1795401346299711647_94","state":"failed","method":"POST","path":"/v1beta/interactions","status":400,"duration_ms":8.890063,"error":"unsupported input type \"input_image\""}}
In requests.db, the model column for these failed rows is empty (""), indicating rejection during /v1beta/interactions input validation prior to account/model routing.
Closing this: confirmed on our end that an intermediate proxy (CPA) forwarded input_image verbatim into /v1beta/interactions instead of converting it. aistudio2api's /v1/responses handles input_image properly (200 OK). Sorry for the noise!