Use with the REST API

The Serverless Hosted API has one endpoint for all models and Workflows:

https://serverless.roboflow.com

HTTP endpoints

Legacy Infer From Request

post

Legacy inference endpoint for object detection, instance segmentation, and classification.

Args: background_tasks: (BackgroundTasks) pool of fastapi background tasks dataset_id (str): ID of a Roboflow dataset corresponding to the model to use for inference OR workspace ID version_id (str): ID of a Roboflow dataset version corresponding to the model to use for inference OR model ID api_key (Optional[str], default None): Roboflow API Key passed to the model during initialization for artifact retrieval. # Other parameters described in the function signature...

Returns: Union[InstanceSegmentationInferenceResponse, KeypointsDetectionInferenceRequest, ObjectDetectionInferenceResponse, ClassificationInferenceResponse, MultiLabelClassificationInferenceResponse, Any]: The response containing the inference results.

Path parameters
dataset_idstringRequired

ID of a Roboflow dataset corresponding to the model to use for inference OR workspace ID

version_idstringRequired

ID of a Roboflow dataset version corresponding to the model to use for inference OR model ID

Query parameters
api_keyany ofOptional

Roboflow API Key that will be passed to the model during initialization for artifact retrieval

stringOptional
or
nullOptional
confidencenumberOptional

The confidence threshold used to filter out predictions

Default: 0.4
keypoint_confidencenumberOptional

The confidence threshold used to filter out keypoints that are not visible based on model confidence

Default: 0
formatstringOptional

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
imageany ofOptional

The publically accessible URL of an image to use for inference.

stringOptional
or
nullOptional
image_typeany ofOptional

One of base64 or numpy. Note, numpy input is not supported for Roboflow Hosted Inference.

Default: base64
stringOptional
or
nullOptional
labelsany ofOptional

If true, labels will be include in any inference visualization.

Default: false
booleanOptional
or
nullOptional
mask_decode_modeany ofOptional

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
stringOptional
or
nullOptional
tradeoff_factorany ofOptional

The amount to tradeoff between 0='fast' and 1='accurate'

Default: 0
numberOptional
or
nullOptional
max_detectionsintegerOptional

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
overlapnumberOptional

The IoU threhsold that must be met for a box pair to be considered duplicate during NMS

Default: 0.3
strokeintegerOptional

The stroke width used when visualizing predictions

Default: 1
disable_preproc_auto_orientany ofOptional

If true, disables automatic image orientation

Default: false
booleanOptional
or
nullOptional
disable_preproc_contrastany ofOptional

If true, disables automatic contrast adjustment

Default: false
booleanOptional
or
nullOptional
disable_preproc_grayscaleany ofOptional

If true, disables automatic grayscale conversion

Default: false
booleanOptional
or
nullOptional
disable_preproc_static_cropany ofOptional

If true, disables automatic static crop

Default: false
booleanOptional
or
nullOptional
disable_active_learningany ofOptional

If true, the predictions will be prevented from registration by Active Learning (if the functionality is enabled)

Default: false
booleanOptional
or
nullOptional
active_learning_target_datasetany ofOptional

Parameter to be used when Active Learning data registration should happen against different dataset than the one pointed by model_id

stringOptional
or
nullOptional
sourceany ofOptional

The source of the inference request

Default: external
stringOptional
or
nullOptional
source_infoany ofOptional

The detailed source information of the inference request

Default: external
stringOptional
or
nullOptional
Responses
chevron-right
200

Successful Response

application/json
Responseany of
or
or
or
or
or
or
anyOptional
post
/{dataset_id}/{version_id}

Endpoint to run predefined workflow

post

Checks Roboflow API for workflow definition, once acquired - parses and executes injecting runtime parameters from request body

Path parameters
workspace_namestringRequired
workflow_idstringRequired
Body
api_keyany ofOptional

Roboflow API Key that will be passed to the model during initialization for artifact retrieval

stringOptional
or
nullOptional
excluded_fieldsany ofOptional

List of field that shall be excluded from the response (among those defined in workflow specification)

string[]Optional
or
nullOptional
enable_profilingbooleanOptional

Flag to request Workflow run profiling. Enables Workflow profiler only when server settings allow profiling traces to be exported to clients. Only applies for Workflows definitions saved on Roboflow platform.

Default: false
workflow_idany ofOptional

Optional identifier of workflow

stringOptional
or
nullOptional
use_cachebooleanOptional

Controls usage of cache for workflow definitions. Set this to False when you frequently modify definition saved in Roboflow app and want to fetch the newest version for the request.

Default: true
Responses
chevron-right
200

Successful Response

application/json
post
/{workspace_name}/workflows/{workflow_id}

Last updated

Was this helpful?