---
title: "Generate coordinates for a model"
method: POST
path: "/model"
tags: ["Model"]
---

# Generate coordinates for a model

`POST /model`

## Request body

- ModelRequest — Model request
  - `model` 'gbox-handy-1' — Model to use
  - `screenshot` string, required — Screenshot image as HTTP(S) URL or base64-encoded data URI. Supports both formats: 1) HTTP(S) URL pointing to an image file; 2) Base64-encoded data URI with format 'data:image/png;base64,[data]' or 'data:image/jpeg;base64,[data]'. Only PNG and JPEG formats are supported for base64.
  - `action` union, required — Structured action object (click or drag)
    - ClickAction — Click action structure
      - `type` 'click' | 'drag' | 'scroll', required — Action type
      - `target` string, required — Natural language description of what to click
    - DragAction — Drag action structure
      - `type` 'click' | 'drag' | 'scroll', required — Action type
      - `target` string, required — Natural language description of starting position
      - `destination` string, required — Natural language description of ending position
    - ScrollAction — Scroll action structure
      - `type` 'click' | 'drag' | 'scroll', required — Action type
      - `location` string, required — Natural language description of the location where the scroll should originate.
      - `direction` 'up' | 'down' | 'left' | 'right', required — Scroll direction

## Response `200`

- ModelResponseData — Model response data structure
  - `response` union, required — Model response data
    - ModelClickResponseData — Model click response data structure
      - `type` 'click' | 'drag' | 'scroll', required — Action type
      - `coordinates` ClickResult, required — Single click result with coordinates
        - `x` number, required — X coordinate. Returns -1 if no valid target is found.
        - `y` number, required — Y coordinate. Returns -1 if no valid target is found.
    - ModelDragResponseData — Drag response data structure
      - `type` 'click' | 'drag' | 'scroll', required — Action type
      - `coordinates` DragResult, required — Single drag result with target and destination coordinates
        - `target` Coordinates, required — X and Y coordinates. Returns -1, -1 if no valid target is found.
          - `x` number, required — X coordinate. Returns -1 if no valid target is found.
          - `y` number, required — Y coordinate. Returns -1 if no valid target is found.
        - `destination` Coordinates, required — X and Y coordinates. Returns -1, -1 if no valid target is found.
          - `x` number, required — X coordinate. Returns -1 if no valid target is found.
          - `y` number, required — Y coordinate. Returns -1 if no valid target is found.
    - ModelScrollResponseData — Scroll response data structure
      - `type` 'click' | 'drag' | 'scroll', required — Action type
      - `coordinates` ScrollResult, required — Single scroll result with location and direction
        - `x` number, required — X coordinate
        - `y` number, required — Y coordinate
        - `scrollX` number, required — Horizontal scroll amount
        - `scrollY` number, required — Vertical scroll amount
  - `id` string, required — Unique ID of this request, can be used for issue reporting and feedback

## Changes

- **2025-11-20** `5079febcc37e` — 4 info
  - the `action/oneOf[subschema #1: Click Action]/target` request property's maxLength was increased from `500` to `2000`
  - the `action/oneOf[subschema #2: Drag Action]/destination` request property's maxLength was increased from `500` to `2000`
  - the `action/oneOf[subschema #2: Drag Action]/target` request property's maxLength was increased from `500` to `2000`
  - the `action/oneOf[subschema #3: Scroll Action]/location` request property's maxLength was increased from `500` to `2000`
- **2025-10-22** `98d437c98328` — 10 breaking, 5 info
  - added the new required request property `action/oneOf[#/components/schemas/ClickAction -> subschema #1: Click Action]/target`
  - added the new required request property `action/oneOf[#/components/schemas/ClickAction -> subschema #1: Click Action]/type`
  - added the new required request property `action/oneOf[#/components/schemas/DragAction -> subschema #2: Drag Action]/destination`
  - added the new required request property `action/oneOf[#/components/schemas/DragAction -> subschema #2: Drag Action]/target`
  - …11 more
- **2025-10-22** `94f652aed916` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/babelcloud/apis/gbox-open-api/changes/model/post.md)

---

[API](https://skmtc.dev/babelcloud/apis/gbox-open-api.md) · [All operations](https://skmtc.dev/babelcloud/apis/gbox-open-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/babelcloud/gbox-open-api/revisions/d655577fa915/schema)
