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

# Detect objects

> Return grounded object detections for a single image from text categories, annotated exemplars, or exhaustive detection.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/detect
openapi: 3.1.0
info:
  title: Perceptron API
  contact:
    name: Perceptron API Support
    email: support@perceptron.inc
  version: 1.0.0
servers:
  - url: https://api.perceptron.inc
security: []
tags:
  - name: Chat Completions
    description: Chat completions API (OpenAI-compatible)
  - name: Detection
    description: Native Perceptron image detection API
  - name: Models
    description: Model listing and metadata API
  - name: Files
    description: File upload, listing, retrieval, and deletion API
paths:
  /v1/detect:
    post:
      tags:
        - Detection
      summary: Detect objects
      description: >-
        Return grounded object detections for a single image from text
        categories, annotated exemplars, or exhaustive detection.
      operationId: handle_detect
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DetectRequest'
        required: true
      responses:
        '200':
          description: Detection completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetectResponse'
        '400':
          description: Invalid detection request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerceptronErrorResponse'
        '401':
          description: Authentication failed. Invalid or missing API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerceptronErrorResponse'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerceptronErrorResponse'
        '500':
          description: Internal error while processing detection.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerceptronErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    DetectRequest:
      type: object
      required:
        - media
      properties:
        categories:
          type:
            - array
            - 'null'
          items:
            type: string
          description: >-
            Category names to detect. Entries must be non-empty and must not
            contain commas.
        config:
          $ref: '#/components/schemas/DetectConfig'
        exemplars:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/DetectExemplar'
        media:
          $ref: '#/components/schemas/DetectMedia'
        negative_exemplars:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/DetectNegativeExemplar'
      additionalProperties: false
    DetectResponse:
      type: object
      required:
        - detections
        - finish_reason
      properties:
        detections:
          type: array
          items:
            $ref: '#/components/schemas/Detection'
        finish_reason:
          $ref: '#/components/schemas/DetectFinishReason'
      additionalProperties: false
    PerceptronErrorResponse:
      type: object
      description: Native Perceptron error response format.
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/PerceptronErrorDetail'
    DetectConfig:
      type: object
      properties:
        enable_thinking:
          type:
            - boolean
            - 'null'
          description: >-
            Deprecated: use `reasoning_effort`. `true` is `high` and `false` is
            `none`; ignored when

            `reasoning_effort` is set.
          deprecated: true
        output:
          $ref: '#/components/schemas/DetectOutput'
        reasoning_effort:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ReasoningEffort'
              description: >-
                How much the model reasons before it answers: `none` (the
                default), `minimal`, `low`,

                `medium` or `high`. A tier other than `none` turns reasoning on.
                Only image-only detection

                (no categories or exemplars) reasons.
      additionalProperties: false
    DetectExemplar:
      type: object
      required:
        - media
        - annotations
      properties:
        annotations:
          type: array
          items:
            $ref: '#/components/schemas/DetectPointPrimitive'
        media:
          $ref: '#/components/schemas/DetectMedia'
    DetectMedia:
      oneOf:
        - type: object
          required:
            - image_url
            - type
          properties:
            image_url:
              type: string
              description: Image URL or data URL. Video is not supported by /v1/detect yet.
            type:
              type: string
              enum:
                - image
    DetectNegativeExemplar:
      type: object
      required:
        - media
      properties:
        media:
          $ref: '#/components/schemas/DetectMedia'
          description: Image known not to contain requested target objects.
    Detection:
      type: object
      required:
        - mention
      properties:
        mention:
          type: string
        point:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/DetectPoint'
              description: Point in target-image pixel coordinates.
        point_box:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/DetectPointBox'
              description: Bounding box in target-image pixel coordinates.
      additionalProperties: false
    DetectFinishReason:
      type: string
      enum:
        - complete
        - max_tokens
    PerceptronErrorDetail:
      type: object
      description: Native Perceptron error detail.
      required:
        - message
      properties:
        code:
          type:
            - string
            - 'null'
        message:
          type: string
        param:
          type:
            - string
            - 'null'
        type:
          type:
            - string
            - 'null'
    DetectOutput:
      type: string
      enum:
        - box
        - point
    ReasoningEffort:
      type: string
      description: >-
        How much the model reasons before it answers; `none` asks for no
        reasoning.
      enum:
        - none
        - minimal
        - low
        - medium
        - high
    DetectPointPrimitive:
      type: object
      required:
        - mention
      properties:
        index:
          type:
            - integer
            - 'null'
          format: int64
        label:
          type:
            - string
            - 'null'
        mention:
          type: string
          description: >-
            Category/target identity for this exemplar annotation. Must not
            contain commas.
        point:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/DetectPoint'
              description: Exemplar point annotation in exemplar-image pixel coordinates.
        point_box:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/DetectPointBox'
              description: Exemplar box annotation in exemplar-image pixel coordinates.
        timestamp:
          type:
            - number
            - 'null'
          format: double
    DetectPoint:
      type: object
      required:
        - x
        - 'y'
      properties:
        x:
          type: number
          format: double
          description: X coordinate in image pixels.
        'y':
          type: number
          format: double
          description: Y coordinate in image pixels.
    DetectPointBox:
      type: object
      required:
        - top_left
        - bottom_right
      properties:
        bottom_right:
          $ref: '#/components/schemas/DetectPoint'
        top_left:
          $ref: '#/components/schemas/DetectPoint'
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication using your Perceptron API key

````