[Bug]: Gemini API returns "Unknown parameter 'id' at 'input[N]'" when using Anthropic Messages API via CPA
Is it a request payload issue? [✓] Yes, this is a request payload issue. I am using a client/cURL to send a request payload, but I received an unexpected error. [ ] No, it's another issue.
Describe the bug
When using the Anthropic Messages API (POST /v1/messages) through CPA with the Gemini provider (gemini-3.6-flash via gemini-interactions), the upstream Gemini API returns a 400 error: Unknown parameter 'id' at 'input[821]'.
This indicates that CPA's GeminiExecutor is forwarding an id field from the Anthropic Messages request format to the Gemini GenerateContent API, which does not accept this parameter.
CLI Type gemini (via CPA's gemini-interactions provider)
Model Name gemini-3.6-flash
LLM Client
Claude Code CLI (claude-cli/2.1.229, agent-sdk/0.3.229)
Request Information
Upstream Request (what CPA sends to Gemini)
The request is made via Anthropic Messages format at POST /v1/messages. Based on the error (input[821]), the id field appears deep in the content array (likely in a tool result or nested content block).
Upstream Response (from Gemini API)
{
"error": {
"message": "Unknown parameter 'id' at 'input[821]'.",
"code": "invalid_request"
}
}
- Status Code: 400
- Provider:
gemini-interactions - Model:
gemini-3.6-flash
Downstream Response (returned to client)
{
"error": {
"message": "Unknown parameter 'id' at 'input[821]'.",
"code": "invalid_request"
}
}
Request Context (from CPA logs)
- Endpoint:
POST /v1/messages(Anthropic Messages API) - Executor Type:
GeminiExecutor - Reasoning Effort:
max - Service Tier:
auto - Request ID:
427fafd6 - Timestamp: 2026-08-15T09:59:50.33029217+06:00
- Client IP: 127.0.0.1
- User Agent:
claude-cli/2.1.229 (external, claude-desktop-3p, agent-sdk/0.3.229)
Expected behavior
CPA should strip/ignore the id field (and any other Anthropic-specific fields not supported by Gemini) when converting the request from Anthropic Messages format to Gemini's GenerateContent format. The request should succeed without returning a 400 error from Gemini.
Screenshots Not applicable - this is an API error response.
OS Type
- OS: Linux (containerized)
- Version: Ubuntu 24.04 (in Docker container
eceasy/cli-proxy-api:latest)
Additional context
The error occurs at input[821] which suggests the id field is deep in the message content array - possibly within a tool result block or nested content. This is a field mapping issue in the GeminiExecutor when handling Anthropic Messages API requests.
In the Anthropic Messages API, messages and content blocks can have id fields. When converting to Gemini's format, these fields should be stripped as they're not part of Gemini's GenerateContent request schema.
Suggested Fix
In the GeminiExecutor request transformation logic:
- Remove message-level
idfields before sending to Gemini - Remove content block
idfields (if any) - Filter out any other Anthropic-specific fields not supported by Gemini's schema
- Consider adding a schema validation/sanitization step in the executor base class
Temporary fix Add the following payload section to config.yaml:
payload:
filter:
- models:
- name: "gemini-*"
params:
- "input.#.id"
- "input.#.content.#.id"
If you want it to apply to all Gemini interaction models or all models, you can use:
payload:
filter:
- models:
- name: "*"
params:
- "input.#.id"
- "input.#.content.#.id"