Skip to content

[Bug]: ResponseInput parse error on /v1/responses with Claude Code #97

Description

@ayamamm

Summary

When using Claude Code through LiteLLM with Agnes 2.0 Flash, normal conversations work correctly. However, operations involving file reading (and occasionally subagent tasks) consistently fail when the request is sent to the /v1/responses endpoint.

The upstream API returns:

400 Bad Request

Invalid JSON data:
Failed to deserialize the JSON body into the target type:
input: data did not match any variant of untagged enum ResponseInput

Forcing LiteLLM to use the Chat Completions API (use_chat_completions_api: true) completely resolves the issue.

Steps to reproduce

  1. Configure LiteLLM with Agnes 2.0 Flash:
  1. /Configure Claude Code to connect through LiteLLM.
  2. Use Claude Code to perform a file reading task (for example, "Read config.yaml" or open a local project file).
  3. Observe that LiteLLM forwards the request to:
    POST /v1/responses
  4. The Agnes API returns the deserialization error shown above.

As a comparison, using the same Claude Code and LiteLLM configuration with GPT-5.6 works correctly.

Adding the following LiteLLM option also resolves the issue:

use_chat_completions_api: true

which causes LiteLLM to send requests to /v1/chat/completions instead.

Expected behavior

The /v1/responses endpoint should accept requests generated by Claude Code through LiteLLM and successfully process file reading and other complex context operations without returning a deserialization error.

Actual behavior

The API responds with:

400 Bad Request

Invalid JSON data:
Failed to deserialize the JSON body into the target type:
input: data did not match any variant of untagged enum ResponseInput

The issue occurs consistently during file reading operations.

Using Chat Completions instead of Responses avoids the problem.

Environment

Claude Code: v2.1.218
LiteLLM Proxy
Model: agnes-2.0-flash
API Base: https://apihub.agnes-ai.com/v1
Endpoint used when the issue occurs: /v1/responses

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions