Skip to content

[Feature Request] Support image/file input via API #279

Description

@daveekr

I am using HAWKI in a research context and would like to process images programmatically via the API, without having to use the manual upload in the web chat UI.

Currently, the HAWKI frontend allows uploading images through the chat interface, which are then processed by the selected model, but there is no documented or supported way to do the same via the API. For my research workflows, the manual upload is unfortunately not practical, as I need to automate large batches of requests and integrate HAWKI into existing pipelines.

I attempted to approximate the behavior of the chat UI by sending an image to a vision-capable model (e.g., qwen3-vl-30b-a3b-instruct) through the API, using a payload similar to this:

payload = {
    "payload": {
        "model": "qwen3-vl-30b-a3b-instruct",
        "messages": [
            {
                "role": "user",
                "content": {
                    "text": "What is the formula in this image?",
                    "type": "image_url",
                    "image_url": f"{encoded_image}"
                }
            }
        ]
    }
}

However, this approach did not work. In addition, trying to reuse the same upload endpoints that the web frontend uses runs into CSRF protection and does not accept the API token as a credential (401 Unauthenticated), which strongly suggests that these endpoints are intentionally not meant for API usage.

If there is already any experimental or partially documented API for this that I have missed, I would be very grateful for a short pointer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions