components:
  schemas:
    BoundingBox:
      properties:
        confidence:
          format: float
          type: number
        x_max:
          format: float
          type: number
        x_min:
          format: float
          type: number
        y_max:
          format: float
          type: number
        y_min:
          format: float
          type: number
      required:
      - x_min
      - y_min
      - x_max
      - y_max
      - confidence
      type: object
    FlatImageInput:
      properties:
        type:
          default: image_url
          example: image_url
          type: string
        url:
          description: >-
            Image data URL containing base64-encoded JPEG or PNG bytes. JPEG
            input enables GPU-accelerated batched image decoding and is recommended
            for performance-sensitive workloads. See the
            [performance guidance](performance.html#object-detection-jpeg-performance).
          example: data:image/png;base64,iVBORw0KGgo=
          pattern: ^data:image/(jpeg|png);base64,.+$
          type: string
      required:
      - url
      type: object
    HealthLiveResponse:
      properties:
        live:
          type: boolean
        message:
          example: live
          type: string
        object:
          example: health.response
          type: string
      required:
      - object
      - message
      - live
      type: object
    HealthReadyResponse:
      properties:
        message:
          example: ready
          type: string
        object:
          example: health.response
          type: string
        ready:
          type: boolean
      required:
      - object
      - message
      - ready
      type: object
    ImageInput:
      oneOf:
      - $ref: '#/components/schemas/FlatImageInput'
      - $ref: '#/components/schemas/NestedImageInput'
    ImageUsage:
      properties:
        images_size_mb:
          format: double
          type: number
      required:
      - images_size_mb
      type: object
    InferRequest:
      additionalProperties: false
      properties:
        confidence_threshold:
          default: 0.01
          format: float
          maximum: 1.0
          minimum: 0.0
          type: number
        input:
          items:
            $ref: '#/components/schemas/ImageInput'
          minItems: 1
          type: array
        nms_threshold:
          description: Optional request override. When omitted, the loaded object detection model's default NMS threshold is used.
          format: float
          maximum: 1.0
          minimum: 0.0
          type: number
      required:
      - input
      type: object
    InferResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/ObjectDetectionResponseItem'
          type: array
        model:
          type: string
        usage:
          $ref: '#/components/schemas/ImageUsage'
      required:
      - model
      - data
      - usage
      type: object
    LicenseInfo:
      properties:
        content:
          type: string
        name:
          type: string
        path:
          type: string
        sha:
          type: string
        size:
          format: uint64
          type: integer
        type:
          type: string
        url:
          type: string
      required:
      - name
      - path
      - sha
      - size
      - url
      - type
      - content
      type: object
    ManifestInfo:
      properties:
        manifest_file:
          type: string
        repository_override:
          type: string
      required:
      - manifest_file
      - repository_override
      type: object
    ModelCard:
      properties:
        created:
          format: uint64
          type: integer
        id:
          type: string
        object:
          example: model
          type: string
        owned_by:
          example: nvidia
          type: string
      required:
      - id
      - object
      type: object
    ModelsResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/ModelCard'
          type: array
        object:
          example: list
          type: string
      required:
      - object
      - data
      type: object
    NestedImageInput:
      properties:
        image_url:
          properties:
            url:
              description: >-
                Image data URL containing base64-encoded JPEG or PNG bytes.
                JPEG input enables GPU-accelerated batched image decoding and is
                recommended for performance-sensitive workloads. See the
                [performance guidance](performance.html#object-detection-jpeg-performance).
              example: data:image/png;base64,iVBORw0KGgo=
              pattern: ^data:image/(jpeg|png);base64,.+$
              type: string
          required:
          - url
          type: object
        type:
          default: image_url
          example: image_url
          type: string
      required:
      - image_url
      type: object
    NimErrorResponse:
      properties:
        detail:
          oneOf:
          - type: string
          - type: object
          - items:
              additionalProperties: true
              properties:
                ctx:
                  type: object
                input: {}
                loc:
                  items:
                    oneOf:
                    - type: string
                    - type: integer
                  type: array
                msg:
                  type: string
                type:
                  type: string
              required:
              - type
              - loc
              - msg
              type: object
            type: array
        message:
          type: string
        object:
          example: error
          type: string
        type:
          type: string
      required:
      - object
      - message
      - type
      type: object
    NimMetadata:
      properties:
        assetInfo:
          items:
            type: string
          type: array
        backend:
          example: rust
          type: string
        licenseInfo:
          $ref: '#/components/schemas/LicenseInfo'
        modelInfo:
          items:
            $ref: '#/components/schemas/NimModelInfo'
          type: array
        repository_override:
          type: string
        selectedModelProfileId:
          type: string
        version:
          type: string
      required:
      - version
      - modelInfo
      - assetInfo
      - licenseInfo
      - repository_override
      - selectedModelProfileId
      - backend
      type: object
    NimModelInfo:
      properties:
        modelUrl:
          type: string
        shortName:
          type: string
      required:
      - modelUrl
      - shortName
      type: object
    ObjectDetectionResponseItem:
      properties:
        bounding_boxes:
          additionalProperties:
            items:
              $ref: '#/components/schemas/BoundingBox'
            type: array
          type: object
        index:
          type: integer
      required:
      - index
      - bounding_boxes
      type: object
    VersionInfo:
      properties:
        api:
          example: 1.0.0
          type: string
        release:
          type: string
      required:
      - release
      - api
      type: object
info:
  description: OpenAPI contract for the Nemotron object detection HTTP server.
  title: Nemotron Object Detection Server
  version: 1.0.0
openapi: 3.0.3
paths:
  /v1/health/live:
    get:
      operationId: healthLive
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HealthLiveResponse'
          description: OK
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Not found
        '405':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Method not allowed
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Internal server error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Service unavailable
      summary: Check liveness
  /v1/health/ready:
    get:
      operationId: healthReady
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HealthReadyResponse'
          description: OK
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Not found
        '405':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Method not allowed
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Internal server error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Service unavailable
      summary: Check readiness
  /v1/license:
    get:
      operationId: getLicense
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LicenseInfo'
          description: OK
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Not found
        '405':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Method not allowed
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Internal server error
      summary: Get license metadata and content
  /v1/manifest:
    get:
      operationId: getManifest
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManifestInfo'
          description: OK
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Not found
        '405':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Method not allowed
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Internal server error
      summary: Get model manifest wrapper
  /v1/metadata:
    get:
      operationId: getMetadata
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimMetadata'
          description: OK
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Not found
        '405':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Method not allowed
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Internal server error
      summary: Get NIM metadata
  /v1/metrics:
    get:
      operationId: getMetrics
      responses:
        '200':
          content:
            text/plain:
              schema:
                type: string
          description: OK
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Not found
        '405':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Method not allowed
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Internal server error
      summary: Get Prometheus metrics
  /v1/models:
    get:
      operationId: listModels
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelsResponse'
          description: OK
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Not found
        '405':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Method not allowed
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Internal server error
      summary: List served models
  /v1/page-elements:
    post:
      operationId: inferPageElements
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InferRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InferResponse'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Bad request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Not found
        '413':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Payload too large
        '415':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Unsupported media type
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Unprocessable entity
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Service unavailable
        '504':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Gateway timeout
      summary: Run page-elements object detection inference
  /v1/table-structure:
    post:
      operationId: inferTableStructure
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InferRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InferResponse'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Bad request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Not found
        '413':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Payload too large
        '415':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Unsupported media type
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Unprocessable entity
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Service unavailable
        '504':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Gateway timeout
      summary: Run table-structure object detection inference
  /v1/version:
    get:
      operationId: getVersion
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VersionInfo'
          description: OK
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Not found
        '405':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Method not allowed
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NimErrorResponse'
          description: Internal server error
      summary: Get NIM release and API version
servers:
- url: http://localhost:8000
