Skip to content

Locate API (POST /v1/locate)

POSThttps://llm.manina.ai/v1/locate

Finds the single on-screen UI element described by a plain-language instruction in an iPhone or Android screenshot. It returns the tap point and bounding box in the integer pixel coordinates of the image you sent, a boolean indicating whether the element is currently on screen, and presence/box confidence scores. When on_screen is false, point and box remain the model’s best guess, do not tap them; scroll, navigate back, or rephrase instead. Every HTTP 200 answer is billed at a flat rate ($0.0003 per call), while errors are never billed.

AI Agent & CLI shortcut: Point Claude Code, Codex, or Cursor at manina.ai/llms-full.txt to generate client code automatically, or run manina find “Settings app icon” –tap from your terminal with npm i -g manina.

locate.py
import base64
import json
import os
import urllib.request
with open("screenshot.png", "rb") as f:
image_b64 = base64.b64encode(f.read()).decode("ascii")
req = urllib.request.Request(
"https://llm.manina.ai/v1/locate",
data=json.dumps({
"image": image_b64,
"text": "Settings app icon",
"min_present": 0.5,
}).encode("utf-8"),
headers={
"Authorization": f"Bearer {os.environ['MANINA_API_KEY']}",
"Content-Type": "application/json",
},
method="POST",
)
with urllib.request.urlopen(req) as resp:
result = json.loads(resp.read().decode("utf-8"))
if result["on_screen"]:
print("Tap pixel:", result["point"], "box:", result["box"])
Name Type Required Description
Authorization string yes Bearer hsk_live_… in production, or Bearer hsk_test_… in Sandbox. Create keys in your account (API keys →).
Content-Type string yes Must be application/json. Maximum request body size is 12 MB.

Unknown JSON fields are rejected with 400 invalid_request.

Name Type Required Description
image string yes Base64-encoded screenshot in PNG, JPEG, or WebP format. A data:image/png;base64, (or jpeg / webp) prefix and whitespace/newlines are accepted and stripped automatically. Any dimensions up to ~89 megapixels.
text string yes Plain-language description of the single element to locate, 1 to 1,000 characters after trimming whitespace. Any language (for example "Settings app icon" or "登录按钮").
min_present number no Threshold between 0 and 1 (inclusive), default 0.5. on_screen is true only when both present_prob >= min_present and confidence >= min_present. Raise it when a wrong tap is costly.
200 OK
{
"id": "loc_2f7c9a1e0b6d4f3a",
"point": {"x": 1203, "y": 330},
"box": [1112, 266, 1294, 394],
"on_screen": true,
"present_prob": 0.998,
"confidence": 0.93,
"image": {"width": 1320, "height": 2868},
"latency_ms": 268,
"model": "manina-locate-1"
}
Field Type Description
id string Unique request identifier (loc_ followed by 16 lowercase hex characters). Include this when contacting support.
point object {"x": integer, "y": integer}: centre of box in the pixels of your uploaded image. Tap here when on_screen is true.
box integer[4] [x1, y1, x2, y2] bounding box in the integer pixels of your uploaded image, clamped within [0, width] and [0, height].
on_screen boolean true when present_prob >= min_present and confidence >= min_present; false when the target is absent, occluded, or ambiguous.
present_prob number 0 to 1: model score for whether the requested element appears anywhere on this screen.
confidence number 0 to 1: spatial sharpness/certainty score for box. Useful as a ranking signal across candidate instructions, not a calibrated probability.
image object {"width": integer, "height": integer} of your uploaded screenshot after decoding.
latency_ms integer Server processing time in milliseconds from receiving the request to sending the response (excluding network round-trip).
model string Model identifier that answered the call. Enum values: "manina-locate-1".
  • Gate every tap on on_screen: Never tap point when on_screen is false. Scroll the view, wait for loading to finish, or ask your planner for an alternative action.
  • Tune min_present for high-stakes screens: Raising min_present from 0.5 to 0.7 or 0.8 requires stronger agreement between presence detection (present_prob) and box localization (confidence).
  • Errors & retry handling: See Error codes & rate limits for 400, 401, 402, and 503 busy (Retry-After: 1) responses.