> ## Documentation Index
> Fetch the complete documentation index at: https://docs.axilio.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Screenshots: detect

> Detect UI elements and read text in a screenshot.

Detect icons and UI elements and read the text in a screenshot you supply.
Send the image as base64 PNG or JPEG. `inference_type` chooses icons
(`detect`), text (`ocr`), or both (`combined`), and `ocr_engine` chooses the
free or premium text engine.

Detection is billed per page through the Axilio model line. See
[Models](/drivers/models#axilio-models) for the tiers and prices.

To find one described element instead of every element, use
[Screenshots: locate](/api-reference/argus/screenshots-locate). You can pass
the text this operation returns as that request's `texts`.

Errors use the [problem details](/reference/errors#problem-details) shape.


## OpenAPI

````yaml api-reference/openapi-argus.json POST /api/v1/screenshots:detect
openapi: 3.1.0
info:
  title: Argus
  version: 2.0.0
servers:
  - url: https://argus.axilio.ai
    description: Production
security: []
tags:
  - name: Elements
  - name: Models
  - name: Screenshots
paths:
  /api/v1/screenshots:detect:
    post:
      tags:
        - Screenshots
      summary: Detect Screenshot
      description: Detect UI elements and read text in a screenshot.
      operationId: screenshots_detect
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InferenceRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InferenceResponse'
          description: Successful Response
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: Invalid input (bad image, unsupported model)
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: Missing or invalid credential
        '402':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: Insufficient balance
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: Request validation failed
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: Internal error (masked)
        '502':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The model provider failed
      security:
        - AxilioApiKey: []
components:
  schemas:
    InferenceRequest:
      properties:
        confidence_threshold:
          default: 0.25
          description: Minimum confidence threshold for detections and OCR results
          maximum: 1
          minimum: 0
          title: Confidence Threshold
          type: number
        image:
          description: Base64 encoded image data
          maxLength: 16777216
          title: Image
          type: string
        inference_type:
          $ref: '#/components/schemas/InferenceType'
          default: combined
          description: Type of inference to perform
        nms_iou_threshold:
          default: 0.45
          description: IoU threshold for Non-Maximum Suppression (NMS)
          maximum: 1
          minimum: 0
          title: Nms Iou Threshold
          type: number
        ocr_engine:
          default: free
          description: 'OCR engine to use: ''free'' or ''premium'''
          title: Ocr Engine
          type: string
      required:
        - image
      title: InferenceRequest
      type: object
    InferenceResponse:
      properties:
        analyzer_type:
          default: all
          description: Analyzer type used
          title: Analyzer Type
          type: string
        data:
          $ref: '#/components/schemas/InferenceData'
          description: Inference results data
        type:
          default: analyzer_result
          description: Response type
          title: Type
          type: string
      required:
        - data
      title: InferenceResponse
      type: object
    Problem:
      description: RFC 9457 problem details, as argus (and the backend) answer every error.
      properties:
        code:
          description: Stable machine-readable category, e.g. validation, not_found
          title: Code
          type: string
        detail:
          description: Human-readable explanation; masked for internal errors
          title: Detail
          type: string
        errors:
          anyOf:
            - items:
                additionalProperties:
                  type: string
                type: object
              type: array
            - type: 'null'
          default: null
          description: Per-field messages on a request validation problem
          title: Errors
        status:
          description: The HTTP status code
          title: Status
          type: integer
        title:
          description: The status's reason phrase
          title: Title
          type: string
        type:
          default: about:blank
          description: Always about:blank
          title: Type
          type: string
      required:
        - title
        - status
        - detail
        - code
      title: Problem
      type: object
    InferenceType:
      enum:
        - detect
        - ocr
        - combined
      title: InferenceType
      type: string
    InferenceData:
      properties:
        hash_result:
          anyOf:
            - $ref: '#/components/schemas/HashResult'
            - type: 'null'
          description: Image hash of content area
        icon_detections:
          description: Icon detections
          items:
            $ref: '#/components/schemas/Detection'
          title: Icon Detections
          type: array
        metadata:
          $ref: '#/components/schemas/InferenceMetadata'
          description: Inference metadata
        ocr_results:
          description: OCR text detections
          items:
            $ref: '#/components/schemas/OCRResult'
          title: Ocr Results
          type: array
      required:
        - metadata
      title: InferenceData
      type: object
    HashResult:
      properties:
        ahash:
          description: Average hash of the content area
          title: Ahash
          type: string
        content_bounds:
          anyOf:
            - $ref: '#/components/schemas/ContentBounds'
            - type: 'null'
          description: Content area bounds used for hashing
        dhash:
          description: Difference hash of the content area
          title: Dhash
          type: string
        histogram:
          anyOf:
            - items:
                items:
                  type: integer
                type: array
              type: array
            - type: 'null'
          description: RGB histogram (3 channels, 32 bins each)
          title: Histogram
        phash:
          description: Perceptual hash of the content area
          title: Phash
          type: string
      required:
        - phash
        - ahash
        - dhash
      title: HashResult
      type: object
    Detection:
      properties:
        bbox:
          $ref: '#/components/schemas/BoundingBox'
          description: Bounding box coordinates
        class_id:
          description: Class ID of detected object
          title: Class Id
          type: integer
        class_name:
          description: Class name of detected object
          title: Class Name
          type: string
        confidence:
          description: Detection confidence score
          maximum: 1
          minimum: 0
          title: Confidence
          type: number
      required:
        - bbox
        - confidence
        - class_id
        - class_name
      title: Detection
      type: object
    InferenceMetadata:
      properties:
        detect_ns:
          anyOf:
            - type: integer
            - type: 'null'
          description: Nanoseconds spent in icon detection
          title: Detect Ns
        icon_detections_after_nms:
          description: Number of icon detections after NMS filtering
          title: Icon Detections After Nms
          type: integer
        icon_detections_before_nms:
          description: Number of icon detections before NMS filtering
          title: Icon Detections Before Nms
          type: integer
        image_height:
          description: Input image height
          title: Image Height
          type: integer
        image_width:
          description: Input image width
          title: Image Width
          type: integer
        inference_time_ms:
          description: Total inference time in milliseconds
          title: Inference Time Ms
          type: number
        ocr_ns:
          anyOf:
            - type: integer
            - type: 'null'
          description: Nanoseconds spent in OCR
          title: Ocr Ns
        queue_wait_ns:
          anyOf:
            - type: integer
            - type: 'null'
          description: Nanoseconds the job waited in the inference queue
          title: Queue Wait Ns
      required:
        - inference_time_ms
        - image_width
        - image_height
        - icon_detections_before_nms
        - icon_detections_after_nms
      title: InferenceMetadata
      type: object
    OCRResult:
      properties:
        bbox:
          $ref: '#/components/schemas/BoundingBox'
          description: Bounding box around text region
        confidence:
          description: OCR confidence score
          maximum: 1
          minimum: 0
          title: Confidence
          type: number
        text:
          description: Detected text content
          title: Text
          type: string
      required:
        - text
        - confidence
        - bbox
      title: OCRResult
      type: object
    ContentBounds:
      properties:
        bottom_y:
          description: Bottom Y coordinate of content area (above nav bar)
          title: Bottom Y
          type: integer
        top_y:
          description: Top Y coordinate of content area (below notification bar)
          title: Top Y
          type: integer
      required:
        - top_y
        - bottom_y
      title: ContentBounds
      type: object
    BoundingBox:
      properties:
        x1:
          description: Top-left x coordinate
          title: X1
          type: number
        x2:
          description: Bottom-right x coordinate
          title: X2
          type: number
        y1:
          description: Top-left y coordinate
          title: Y1
          type: number
        y2:
          description: Bottom-right y coordinate
          title: Y2
          type: number
      required:
        - x1
        - y1
        - x2
        - y2
      title: BoundingBox
      type: object
  securitySchemes:
    AxilioApiKey:
      description: Axilio API key (axl_*).
      in: header
      name: X-Axilio-Api-Key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.