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

# tissue-seg prediction



## OpenAPI

````yaml /api-reference/openapi.json post /api/predict/tissue-seg
openapi: 3.1.0
info:
  description: >
    Multi-model inference server for Bioptimus models. Remove entries from the
    ``models`` section below to skip loading and endpoint creation for specific
    models.

    **Available models:** - **H1** — tile embeddings - **M-Optimus** — spatial
    gene expression prediction - **tissue-seg** — tissue segmentation mask
  title: Bioptimus Model Server
  version: 1.0.0
servers: []
security: []
paths:
  /api/predict/tissue-seg:
    post:
      tags:
        - Models
      summary: tissue-seg prediction
      operationId: tissue_seg_predict_api_predict_tissue_seg_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModelRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    ModelRequest:
      description: |-
        Payload sent to the model endpoint for a single tile.

        The tile image is base64-encoded for JSON transport. Bulk RNA
        counts can optionally be included for multimodal models.

        Attributes:
            image_data: Base64-encoded tile image (PNG).
            bulk_rna: Optional bulk RNA counts vector.
            slide_name: Stem of the source slide filename.
            x: Tile x-coordinate in the slide.
            y: Tile y-coordinate in the slide.
            width: Tile width in pixels.
            height: Tile height in pixels.
            tissue_ratio: Fraction of tissue in the tile.
            patch_idx: Index of this tile in the extraction plan.
      properties:
        bulk_rna:
          anyOf:
            - items:
                type: number
              type: array
            - type: 'null'
          title: Bulk Rna
        height:
          title: Height
          type: integer
        image_data:
          title: Image Data
          type: string
        patch_idx:
          title: Patch Idx
          type: integer
        resolution:
          anyOf:
            - type: number
            - type: 'null'
          title: Resolution
        slide_name:
          title: Slide Name
          type: string
        tissue_ratio:
          anyOf:
            - type: number
            - type: 'null'
          title: Tissue Ratio
        width:
          title: Width
          type: integer
        x:
          title: X
          type: integer
        'y':
          title: 'Y'
          type: integer
      required:
        - image_data
        - slide_name
        - x
        - 'y'
        - width
        - height
        - patch_idx
      title: ModelRequest
      type: object
    ModelResponse:
      description: |-
        Payload returned by the model endpoint for a single tile.

        Carries the model output together with the full tile metadata
        from the originating request, so that downstream writers can
        persist everything without needing a separate schema.

        Attributes:
            output: Model output vector for this tile.
            slide_name: Stem of the source slide filename.
            x: Tile x-coordinate in the slide.
            y: Tile y-coordinate in the slide.
            width: Tile width in pixels.
            height: Tile height in pixels.
            tissue_ratio: Fraction of tissue in the tile.
            patch_idx: Index of this tile in the extraction plan.
            resolution: Extraction resolution (MPP) if available.
            embedding: The tile embedding, returned alongside ``output`` only for
                the ``prediction_with_embedding`` mode (both come from the same
                forward pass). ``None`` for the single-output modes.
      properties:
        embedding:
          anyOf:
            - items:
                type: number
              type: array
            - type: 'null'
          title: Embedding
        height:
          title: Height
          type: integer
        output:
          items:
            type: number
          title: Output
          type: array
        patch_idx:
          title: Patch Idx
          type: integer
        resolution:
          anyOf:
            - type: number
            - type: 'null'
          title: Resolution
        slide_name:
          title: Slide Name
          type: string
        tissue_ratio:
          anyOf:
            - type: number
            - type: 'null'
          title: Tissue Ratio
        width:
          title: Width
          type: integer
        x:
          title: X
          type: integer
        'y':
          title: 'Y'
          type: integer
      required:
        - output
        - slide_name
        - x
        - 'y'
        - width
        - height
        - patch_idx
      title: ModelResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````