lmstudio-ai / lmstudio-ai/docs

Invalid type for 'input' when sending array input to /v1/responses

Open
#141 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
MDX
Stars
172
Forks
128
Avg merge
8m
Merged PRs (30d)
1

Description

When sending a request to the /v1/responses endpoint with input as an array (to include multiple content types such as text and image), the API returns an error stating that the input type is invalid.

This behavior makes it impossible to send multimodal (text + image) queries via the responses endpoint, even though the structure mirrors how /v1/chat/completions handles messages.

Request
`{
"model": "gemma-3-12b-it",
"input": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What is in this image?"
},
{
"type": "image_url",
"image_url": "{{TestBase64Image}}"
}
]
}
]
}
`

Response:
`{
"error": {
"message": "Invalid type for 'input'.",
"type": "invalid_request_error",
"param": "input",
"code": "invalid_union"
}
}
`

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the /v1/responses documentation and its input schema, then compare it with the /v1/chat/completions message format shown in the report. Reproduce the request using the provided multimodal example and determine whether the documented input shape accepts arrays. Done means the endpoint behavior and supported input format are accurately documented or corrected.

Written by the indexing model from the issue text.

Assessment

Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.