Support screenshots/image input for Hatz OpenAI Responses API used by OpenCode
complete
Ethan Honis
I’m using Hatz AI as a provider in OpenCode through the OpenAI-compatible Responses API at https://ai.hatz.ai/v1/openai, and while normal text requests work, screenshots and image attachments do not. I’m trying to use Hatz the same way other OpenAI-compatible providers support multimodal conversations in OpenCode, especially for workflows like UI debugging, design review, and bug reports with visual context. From the current docs, the OpenAI Responses route appears to only document input_text usage, and I could not find documented support for image inputs such as input_image, image URLs, or file attachment handling on /v1/openai/responses. At the same time, the Hatz-native chat/completions docs do mention vision-capable models and uploaded files via file_uuids, which makes it seem like image support may only exist on the native chat route and not the OpenAI-compatible route that OpenCode depends on. I’d love to see full screenshot/image support added to the OpenAI-compatible Responses API, including support for OpenAI-style multimodal payloads, clear documentation showing the expected request format, and guidance on which models support vision through this endpoint. This would make Hatz much more usable as a drop-in OpenAI-compatible provider for OpenCode and similar clients.
M
Mark Leeper
updated the status to
complete
M
Michael Garrity
Ethan Honis | Kevin Anderson | Matthew Richardson
This should currently be doable. I think your issue stems from a known issue with OpenCode See: https://github.com/anomalyco/opencode/issues/20802
They mention a workaround by editing your config.json
Attached is a screenshot from my OpenCode with an image attached and the response.
I've included an example below of how my config.json is configured. I trimmed it down to one model as an example for the sake of length, but should be able to get you going.
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"hatz": {
"npm": "@ai-sdk/openai",
"name": "Hatz",
"options": {
"baseURL": "https://ai.hatz.ai/v1/openai"
},
"models": {
"anthropic.claude-sonnet-5": {
"name": "Claude Sonnet 5",
"attachment": true,
"modalities": {
"input": ["text", "image"],
"output": ["text"]
},
"limit": {
"context": 1000000,
"output": 128000
},
"options": {
"reasoningEffort": "high"
}
}
}
}
}
}
Photo Viewer
View photos in a modal
Matthew Richardson
I reached out to support on this and found they were quick to provide an answer. Hatz does support this, but the API doesn't expect standard OpenAI input. Format is more of a proprietary Anthropic syntax with an OpenAI shell. Here is the JSON model for vision requests they provided me and I tested/confirmed working against GTP-5-mini
{
"model": "gpt-5-mini",
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "Analyze this screenshot and describe what is visible."
},
{
"type": "input_image",
"image_url": "data:image/png;base64,{BASE64_STRING_HERE}"
}
]
}
],
"max_output_tokens": 1000
}
The main differences from the Chat Completions payload are:
• The top-level field is input rather than messages.
• Text content uses "type": "input_text".
• Image content uses "type": "input_image".
• The base64 data URI is passed directly as the value of image_url.
• The selected model must support vision input.