Roboflow Roboflow Inference Server API

The Roboflow Inference Server API from Roboflow — 1 operation(s) for roboflow inference server.

OpenAPI Specification

roboflow-roboflow-inference-server-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Roboflow Inference Server API
  description: Roboflow inference server
  termsOfService: https://roboflow.com/terms
  contact:
    name: Roboflow Inc.
    url: https://roboflow.com/contact
    email: help@roboflow.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.3.8
tags:
- name: Roboflow Inference Server
paths:
  /{dataset_id}/{version_id}:
    post:
      summary: Legacy Infer From Request
      description: "Legacy inference endpoint for object detection, instance segmentation, and classification.\n\
        \nArgs:\n    background_tasks: (BackgroundTasks) pool of fastapi background tasks\n    dataset_id\
        \ (str): ID of a Roboflow dataset corresponding to the model to use for inference OR workspace\
        \ ID\n    version_id (str): ID of a Roboflow dataset version corresponding to the model to use\
        \ for inference OR model ID\n    api_key (Optional[str], default None): Roboflow API Key passed\
        \ to the model during initialization for artifact retrieval.\n    # Other parameters described\
        \ in the function signature...\n\nReturns:\n    Union[InstanceSegmentationInferenceResponse, KeypointsDetectionInferenceRequest,\
        \ ObjectDetectionInferenceResponse, ClassificationInferenceResponse, MultiLabelClassificationInferenceResponse,\
        \ SemanticSegmentationInferenceResponse, Any]: The response containing the inference results."
      operationId: legacy_infer_from_request__dataset_id___version_id__post
      parameters:
      - name: dataset_id
        in: path
        required: true
        schema:
          type: string
          description: ID of a Roboflow dataset corresponding to the model to use for inference OR workspace
            ID
          title: Dataset Id
        description: ID of a Roboflow dataset corresponding to the model to use for inference OR workspace
          ID
      - name: version_id
        in: path
        required: true
        schema:
          type: string
          description: ID of a Roboflow dataset version corresponding to the model to use for inference
            OR model ID
          title: Version Id
        description: ID of a Roboflow dataset version corresponding to the model to use for inference
          OR model ID
      - name: api_key
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Roboflow API Key that will be passed to the model during initialization for artifact
            retrieval
          title: Api Key
        description: Roboflow API Key that will be passed to the model during initialization for artifact
          retrieval
      - name: confidence
        in: query
        required: false
        schema:
          anyOf:
          - type: number
          - enum:
            - best
            - default
            type: string
          description: The confidence threshold used to filter out predictions. Pass a float in [0, 1],
            or "best" to use F1-optimal thresholds from model evaluation, or "default" to use the model's
            built-in default.
          default: 0.4
          title: Confidence
        description: The confidence threshold used to filter out predictions. Pass a float in [0, 1],
          or "best" to use F1-optimal thresholds from model evaluation, or "default" to use the model's
          built-in default.
      - name: keypoint_confidence
        in: query
        required: false
        schema:
          type: number
          description: The confidence threshold used to filter out keypoints that are not visible based
            on model confidence
          default: 0.0
          title: Keypoint Confidence
        description: The confidence threshold used to filter out keypoints that are not visible based
          on model confidence
      - name: format
        in: query
        required: false
        schema:
          type: string
          description: One of 'json' or 'image'. If 'json' prediction data is return as a JSON string.
            If 'image' prediction data is visualized and overlayed on the original input image.
          default: json
          title: Format
        description: One of 'json' or 'image'. If 'json' prediction data is return as a JSON string. If
          'image' prediction data is visualized and overlayed on the original input image.
      - name: image
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: The publically accessible URL of an image to use for inference.
          title: Image
        description: The publically accessible URL of an image to use for inference.
      - name: image_type
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: One of base64 or numpy. Note, numpy input is not supported for Roboflow Hosted
            Inference.
          default: base64
          title: Image Type
        description: One of base64 or numpy. Note, numpy input is not supported for Roboflow Hosted Inference.
      - name: labels
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          description: If true, labels will be include in any inference visualization.
          default: false
          title: Labels
        description: If true, labels will be include in any inference visualization.
      - name: mask_decode_mode
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: One of 'accurate' or 'fast'. If 'accurate' the mask will be decoded using the original
            image size. If 'fast' the mask will be decoded using the original mask size. 'accurate' is
            slower but more accurate.
          default: accurate
          title: Mask Decode Mode
        description: One of 'accurate' or 'fast'. If 'accurate' the mask will be decoded using the original
          image size. If 'fast' the mask will be decoded using the original mask size. 'accurate' is slower
          but more accurate.
      - name: tradeoff_factor
        in: query
        required: false
        schema:
          anyOf:
          - type: number
          - type: 'null'
          description: The amount to tradeoff between 0='fast' and 1='accurate'
          default: 0.0
          title: Tradeoff Factor
        description: The amount to tradeoff between 0='fast' and 1='accurate'
      - name: max_detections
        in: query
        required: false
        schema:
          type: integer
          description: The maximum number of detections to return. This is used to limit the number of
            predictions returned by the model. The model may return more predictions than this number,
            but only the top `max_detections` predictions will be returned.
          default: 300
          title: Max Detections
        description: The maximum number of detections to return. This is used to limit the number of predictions
          returned by the model. The model may return more predictions than this number, but only the
          top `max_detections` predictions will be returned.
      - name: overlap
        in: query
        required: false
        schema:
          type: number
          description: The IoU threhsold that must be met for a box pair to be considered duplicate during
            NMS
          default: 0.3
          title: Overlap
        description: The IoU threhsold that must be met for a box pair to be considered duplicate during
          NMS
      - name: stroke
        in: query
        required: false
        schema:
          type: integer
          description: The stroke width used when visualizing predictions
          default: 1
          title: Stroke
        description: The stroke width used when visualizing predictions
      - name: disable_preproc_auto_orient
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          description: If true, disables automatic image orientation
          default: false
          title: Disable Preproc Auto Orient
        description: If true, disables automatic image orientation
      - name: disable_preproc_contrast
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          description: If true, disables automatic contrast adjustment
          default: false
          title: Disable Preproc Contrast
        description: If true, disables automatic contrast adjustment
      - name: disable_preproc_grayscale
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          description: If true, disables automatic grayscale conversion
          default: false
          title: Disable Preproc Grayscale
        description: If true, disables automatic grayscale conversion
      - name: disable_preproc_static_crop
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          description: If true, disables automatic static crop
          default: false
          title: Disable Preproc Static Crop
        description: If true, disables automatic static crop
      - name: disable_active_learning
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          description: If true, the predictions will be prevented from registration by Active Learning
            (if the functionality is enabled)
          default: false
          title: Disable Active Learning
        description: If true, the predictions will be prevented from registration by Active Learning (if
          the functionality is enabled)
      - name: active_learning_target_dataset
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Parameter to be used when Active Learning data registration should happen against
            different dataset than the one pointed by model_id
          title: Active Learning Target Dataset
        description: Parameter to be used when Active Learning data registration should happen against
          different dataset than the one pointed by model_id
      - name: source
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: The source of the inference request
          default: external
          title: Source
        description: The source of the inference request
      - name: source_info
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: The detailed source information of the inference request
          default: external
          title: Source Info
        description: The detailed source information of the inference request
      - name: response_mask_format
        in: query
        required: false
        schema:
          anyOf:
          - enum:
            - polygon
            - rle
            type: string
          - type: 'null'
          description: The format of the prediction mask - polygon (default) or rle - applicable for instance
            segmentation models.
          default: polygon
          title: Response Mask Format
        description: The format of the prediction mask - polygon (default) or rle - applicable for instance
          segmentation models.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/InstanceSegmentationInferenceResponse'
                - $ref: '#/components/schemas/KeypointsDetectionInferenceResponse'
                - $ref: '#/components/schemas/ObjectDetectionInferenceResponse'
                - $ref: '#/components/schemas/ClassificationInferenceResponse'
                - $ref: '#/components/schemas/MultiLabelClassificationInferenceResponse'
                - $ref: '#/components/schemas/SemanticSegmentationInferenceResponse'
                - $ref: '#/components/schemas/StubResponse'
                - {}
                title: Response Legacy Infer From Request  Dataset Id   Version Id  Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Roboflow Inference Server
    get:
      summary: Legacy Infer From Request
      description: "Legacy inference endpoint for object detection, instance segmentation, and classification.\n\
        \nArgs:\n    background_tasks: (BackgroundTasks) pool of fastapi background tasks\n    dataset_id\
        \ (str): ID of a Roboflow dataset corresponding to the model to use for inference OR workspace\
        \ ID\n    version_id (str): ID of a Roboflow dataset version corresponding to the model to use\
        \ for inference OR model ID\n    api_key (Optional[str], default None): Roboflow API Key passed\
        \ to the model during initialization for artifact retrieval.\n    # Other parameters described\
        \ in the function signature...\n\nReturns:\n    Union[InstanceSegmentationInferenceResponse, KeypointsDetectionInferenceRequest,\
        \ ObjectDetectionInferenceResponse, ClassificationInferenceResponse, MultiLabelClassificationInferenceResponse,\
        \ SemanticSegmentationInferenceResponse, Any]: The response containing the inference results."
      operationId: legacy_infer_from_request__dataset_id___version_id__get
      parameters:
      - name: dataset_id
        in: path
        required: true
        schema:
          type: string
          description: ID of a Roboflow dataset corresponding to the model to use for inference OR workspace
            ID
          title: Dataset Id
        description: ID of a Roboflow dataset corresponding to the model to use for inference OR workspace
          ID
      - name: version_id
        in: path
        required: true
        schema:
          type: string
          description: ID of a Roboflow dataset version corresponding to the model to use for inference
            OR model ID
          title: Version Id
        description: ID of a Roboflow dataset version corresponding to the model to use for inference
          OR model ID
      - name: api_key
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Roboflow API Key that will be passed to the model during initialization for artifact
            retrieval
          title: Api Key
        description: Roboflow API Key that will be passed to the model during initialization for artifact
          retrieval
      - name: confidence
        in: query
        required: false
        schema:
          anyOf:
          - type: number
          - enum:
            - best
            - default
            type: string
          description: The confidence threshold used to filter out predictions. Pass a float in [0, 1],
            or "best" to use F1-optimal thresholds from model evaluation, or "default" to use the model's
            built-in default.
          default: 0.4
          title: Confidence
        description: The confidence threshold used to filter out predictions. Pass a float in [0, 1],
          or "best" to use F1-optimal thresholds from model evaluation, or "default" to use the model's
          built-in default.
      - name: keypoint_confidence
        in: query
        required: false
        schema:
          type: number
          description: The confidence threshold used to filter out keypoints that are not visible based
            on model confidence
          default: 0.0
          title: Keypoint Confidence
        description: The confidence threshold used to filter out keypoints that are not visible based
          on model confidence
      - name: format
        in: query
        required: false
        schema:
          type: string
          description: One of 'json' or 'image'. If 'json' prediction data is return as a JSON string.
            If 'image' prediction data is visualized and overlayed on the original input image.
          default: json
          title: Format
        description: One of 'json' or 'image'. If 'json' prediction data is return as a JSON string. If
          'image' prediction data is visualized and overlayed on the original input image.
      - name: image
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: The publically accessible URL of an image to use for inference.
          title: Image
        description: The publically accessible URL of an image to use for inference.
      - name: image_type
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: One of base64 or numpy. Note, numpy input is not supported for Roboflow Hosted
            Inference.
          default: base64
          title: Image Type
        description: One of base64 or numpy. Note, numpy input is not supported for Roboflow Hosted Inference.
      - name: labels
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          description: If true, labels will be include in any inference visualization.
          default: false
          title: Labels
        description: If true, labels will be include in any inference visualization.
      - name: mask_decode_mode
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: One of 'accurate' or 'fast'. If 'accurate' the mask will be decoded using the original
            image size. If 'fast' the mask will be decoded using the original mask size. 'accurate' is
            slower but more accurate.
          default: accurate
          title: Mask Decode Mode
        description: One of 'accurate' or 'fast'. If 'accurate' the mask will be decoded using the original
          image size. If 'fast' the mask will be decoded using the original mask size. 'accurate' is slower
          but more accurate.
      - name: tradeoff_factor
        in: query
        required: false
        schema:
          anyOf:
          - type: number
          - type: 'null'
          description: The amount to tradeoff between 0='fast' and 1='accurate'
          default: 0.0
          title: Tradeoff Factor
        description: The amount to tradeoff between 0='fast' and 1='accurate'
      - name: max_detections
        in: query
        required: false
        schema:
          type: integer
          description: The maximum number of detections to return. This is used to limit the number of
            predictions returned by the model. The model may return more predictions than this number,
            but only the top `max_detections` predictions will be returned.
          default: 300
          title: Max Detections
        description: The maximum number of detections to return. This is used to limit the number of predictions
          returned by the model. The model may return more predictions than this number, but only the
          top `max_detections` predictions will be returned.
      - name: overlap
        in: query
        required: false
        schema:
          type: number
          description: The IoU threhsold that must be met for a box pair to be considered duplicate during
            NMS
          default: 0.3
          title: Overlap
        description: The IoU threhsold that must be met for a box pair to be considered duplicate during
          NMS
      - name: stroke
        in: query
        required: false
        schema:
          type: integer
          description: The stroke width used when visualizing predictions
          default: 1
          title: Stroke
        description: The stroke width used when visualizing predictions
      - name: disable_preproc_auto_orient
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          description: If true, disables automatic image orientation
          default: false
          title: Disable Preproc Auto Orient
        description: If true, disables automatic image orientation
      - name: disable_preproc_contrast
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          description: If true, disables automatic contrast adjustment
          default: false
          title: Disable Preproc Contrast
        description: If true, disables automatic contrast adjustment
      - name: disable_preproc_grayscale
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          description: If true, disables automatic grayscale conversion
          default: false
          title: Disable Preproc Grayscale
        description: If true, disables automatic grayscale conversion
      - name: disable_preproc_static_crop
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          description: If true, disables automatic static crop
          default: false
          title: Disable Preproc Static Crop
        description: If true, disables automatic static crop
      - name: disable_active_learning
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          description: If true, the predictions will be prevented from registration by Active Learning
            (if the functionality is enabled)
          default: false
          title: Disable Active Learning
        description: If true, the predictions will be prevented from registration by Active Learning (if
          the functionality is enabled)
      - name: active_learning_target_dataset
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Parameter to be used when Active Learning data registration should happen against
            different dataset than the one pointed by model_id
          title: Active Learning Target Dataset
        description: Parameter to be used when Active Learning data registration should happen against
          different dataset than the one pointed by model_id
      - name: source
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: The source of the inference request
          default: external
          title: Source
        description: The source of the inference request
      - name: source_info
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: The detailed source information of the inference request
          default: external
          title: Source Info
        description: The detailed source information of the inference request
      - name: response_mask_format
        in: query
        required: false
        schema:
          anyOf:
          - enum:
            - polygon
            - rle
            type: string
          - type: 'null'
          description: The format of the prediction mask - polygon (default) or rle - applicable for instance
            segmentation models.
          default: polygon
          title: Response Mask Format
        description: The format of the prediction mask - polygon (default) or rle - applicable for instance
          segmentation models.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/InstanceSegmentationInferenceResponse'
                - $ref: '#/components/schemas/KeypointsDetectionInferenceResponse'
                - $ref: '#/components/schemas/ObjectDetectionInferenceResponse'
                - $ref: '#/components/schemas/ClassificationInferenceResponse'
                - $ref: '#/components/schemas/MultiLabelClassificationInferenceResponse'
                - $ref: '#/components/schemas/SemanticSegmentationInferenceResponse'
                - $ref: '#/components/schemas/StubResponse'
                - {}
                title: Response Legacy Infer From Request  Dataset Id   Version Id  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Roboflow Inference Server
components:
  schemas:
    MultiLabelClassificationInferenceResponse:
      properties:
        visualization:
          anyOf:
          - type: string
          - type: 'null'
          title: Visualization
          description: Base64 encoded string containing prediction visualization image data
        inference_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Inference Id
          description: Unique identifier of inference
        frame_id:
          anyOf:
          - type: integer
          - type: 'null'
          title: Frame Id
          description: The frame id of the image used in inference if the input was a video
        time:
          anyOf:
          - type: number
          - type: 'null'
          title: Time
          description: The time in seconds it took to produce the predictions including image preprocessing
        image:
          anyOf:
          - items:
              $ref: '#/components/schemas/InferenceResponseImage'
            type: array
          - $ref: '#/components/schemas/InferenceResponseImage'
          title: Image
        predictions:
          additionalProperties:
            $ref: '#/components/schemas/MultiLabelClassificationPrediction'
          type: object
          title: Predictions
        predicted_classes:
          items:
            type: string
          type: array
          title: Predicted Classes
          description: The list of predicted classes
        parent_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Parent Id
          description: Identifier of parent image region. Useful when stack of detection-models is in
            use to refer the RoI being the input to inference
      type: object
      required:
      - image
      - predictions
      - predicted_classes
      title: MultiLabelClassificationInferenceResponse
      description: "Multi-label Classification inference response.\n\nAttributes:\n    predictions (Dict[str,\
        \ inference.core.entities.responses.inference.MultiLabelClassificationPrediction]): Dictionary\
        \ of multi-label classification predictions.\n    predicted_classes (List[str]): The list of predicted\
        \ classes."
    Point-Output:
      properties:
        x:
          type: number
          title: X
          description: The x-axis pixel coordinate of the point
        y:
          type: number
          title: Y
          description: The y-axis pixel coordinate of the point
      type: object
      required:
      - x
      - y
      title: Point
      description: "Point coordinates.\n\nAttributes:\n    x (float): The x-axis pixel coordinate of the\
        \ point.\n    y (float): The y-axis pixel coordinate of the point."
    ObjectDetectionInferenceResponse:
      properties:
        visualization:
          anyOf:
          - type: string
          - type: 'null'
          title: Visualization
          description: Base64 encoded string containing prediction visualization image data
        inference_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Inference Id
          description: Unique identifier of inference
        frame_id:
          anyOf:
          - type: integer
          - type: 'null'
          title: Frame Id
          description: The frame id of the image used in inference if the input was a video
        time:
          anyOf:
          - type: number
          - type: 'null'
          title: Time
          description: The time in seconds it took to produce the predictions including image preprocessing
        image:
          anyOf:
          - items:
              $ref: '#/components/schemas/InferenceResponseImage'
            type: array
          - $ref: '#/components/schemas/InferenceResponseImage'
          title: Image
        predictions:
          items:
            $ref: '#/components/schemas/ObjectDetectionPrediction'
          type: array
          title: Predictions
      type: object
      required:
      - image
      - predictions
      title: ObjectDetectionInferenceResponse
      description: "Object Detection inference response.\n\nAttributes:\n    predictions (List[inference.core.entities.responses.inference.ObjectDetectionPrediction]):\
        \ List of object detection predictions."
    InstanceSegmentationPrediction:
      properties:
        x:
          type: number
          title: X
          description: The center x-axis pixel coordinate of the prediction
        y:
          type: number
          title: Y
          description: The center y-axis pixel coordinate of the prediction
        width:
          type: number
          title: Width
          description: The width of the prediction bounding box in number of pixels
        height:
          type: number
          title: Height
          description: The height of the prediction bounding box in number of pixels
        confidence:
          type: number
          title: Confidence
          description: The detection confidence as a fraction between 0 and 1
        class:
          type: string
          title: Class
          description: The predicted class label
        class_id:
          type: integer
          title: Class Id
          description: The class id of the prediction
        detection_id:
          type: string
          title: Detection Id
          description: Unique identifier of detection
        parent_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Parent Id
          description: Identifier of parent image region
        class_confidence:
          anyOf:
          - type: number
          - type: 'null'
          title: Class Confidence
          description: The class label confidence as a fraction between 0 and 1
        points:
          items:
            $ref: '#/components/schemas/Point-Output'
          type: array
          title: Points
          description: The list of points that make up the instance polygon
        mask_format:
          type: string
          const: polygon
          title: Mask Format
          description: Type of mask format
          default: polygon
      type: object
      required:
      - x
      - y
      - width
      - height
      - confidence
      - class
      - class_id
      - points
      title: InstanceSegmentationPrediction
    ClassificationPrediction:
      properties:
        class:
          type: string
          title: Class
          description: The predicted class label
        class_id:
          type: integer
          title: Class Id
          description: Numeric ID associated with the class label
        confidence:
          type: number
          title: Confidence
          description: The class label confidence as a fraction between 0 and 1
      type: object
      required:
      - class
      - class_id
      - confidence
      title: ClassificationPrediction
      description: "Classification prediction.\n\nAttributes:\n    class_name (str): The predicted class\
        \ label.\n    class_id (int): Numeric ID associated with the class label.\n    confidence (flo

# --- truncated at 32 KB (49 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/roboflow/refs/heads/main/openapi/roboflow-roboflow-inference-server-api-openapi.yml