A running Inference Server publishes an OpenAPI specification that matches the version of the server you are running.
Start a server, then open its API reference in your browser:
pip install inference-cli
inference server startThe API reference below uses http://localhost:9001, the default address for a local Inference Server. Replace this base URL with the address of the server you want to call:
- Use
https://serverless.roboflow.comfor the Serverless Hosted API. - Use the assigned URL for a Dedicated Deployment.
- Use the IP address or hostname and port for another self-hosted Inference Server.
This is the API for running models and Workflows. For the Roboflow Platform API for workspaces, projects, versions, and training, see the Platform API OpenAPI reference.
Server
Healthz
Health endpoint for Kubernetes liveness probe.
Verifies CUDA context health when running on GPU. Returns 503 if CUDA is corrupted (unrecoverable - requires process restart).
200Successful Responseapplication/json
GET /healthz HTTP/1.1
Host: localhost:9001
Accept: application/jsoncurl -L \
--request GET \
--url 'http://localhost:9001/healthz' \
--header 'Accept: application/json'const response = await fetch("http://localhost:9001/healthz", {
method: "GET",
headers: {
"Accept": "application/json"
}
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/healthz"
headers = {
"Accept": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())"anything"Readiness
Readiness endpoint for Kubernetes readiness probe.
200Successful Responseapplication/json
GET /readiness HTTP/1.1
Host: localhost:9001
Accept: application/jsoncurl -L \
--request GET \
--url 'http://localhost:9001/readiness' \
--header 'Accept: application/json'const response = await fetch("http://localhost:9001/readiness", {
method: "GET",
headers: {
"Accept": "application/json"
}
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/readiness"
headers = {
"Accept": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())"anything"Info
Get the server name and version number
200Successful Responseapplication/json
Roboflow Inference Server0.0.19c18c6f4-2266-41fb-8a0f-c12ae28f6fbeGET /info HTTP/1.1
Host: localhost:9001
Accept: application/jsoncurl -L \
--request GET \
--url 'http://localhost:9001/info' \
--header 'Accept: application/json'const response = await fetch("http://localhost:9001/info", {
method: "GET",
headers: {
"Accept": "application/json"
}
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/info"
headers = {
"Accept": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json()){
"name": "Roboflow Inference Server",
"version": "0.0.1",
"uuid": "9c18c6f4-2266-41fb-8a0f-c12ae28f6fbe"
}Metrics
Endpoint that serves Prometheus metrics.
200Successful Responseapplication/json
GET /metrics HTTP/1.1
Host: localhost:9001
Accept: application/jsoncurl -L \
--request GET \
--url 'http://localhost:9001/metrics' \
--header 'Accept: application/json'const response = await fetch("http://localhost:9001/metrics", {
method: "GET",
headers: {
"Accept": "application/json"
}
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/metrics"
headers = {
"Accept": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())"anything"Get Recent Logs
Get recent application logs for debugging
Maximum number of log entries to return
100Filter by log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
Return logs since this ISO timestamp
200Successful Responseapplication/json
422Validation Errorapplication/json
Show propertiesHide properties
GET /logs HTTP/1.1
Host: localhost:9001
Accept: application/jsoncurl -L \
--request GET \
--url 'http://localhost:9001/logs' \
--header 'Accept: application/json'const response = await fetch("http://localhost:9001/logs", {
method: "GET",
headers: {
"Accept": "application/json"
}
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/logs"
headers = {
"Accept": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())"anything"{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}Dashboard Guard
200Successful Responseapplication/json
GET /dashboard.html HTTP/1.1
Host: localhost:9001
Accept: application/jsoncurl -L \
--request GET \
--url 'http://localhost:9001/dashboard.html' \
--header 'Accept: application/json'const response = await fetch("http://localhost:9001/dashboard.html", {
method: "GET",
headers: {
"Accept": "application/json"
}
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/dashboard.html"
headers = {
"Accept": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())"anything"Dashboard Guard
200Successful Responseapplication/json
HEAD /dashboard.html HTTP/1.1
Host: localhost:9001
Accept: application/jsoncurl -L \
--request HEAD \
--url 'http://localhost:9001/dashboard.html' \
--header 'Accept: application/json'const response = await fetch("http://localhost:9001/dashboard.html", {
method: "HEAD",
headers: {
"Accept": "application/json"
}
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/dashboard.html"
headers = {
"Accept": "application/json"
}
response = requests.head(url, headers=headers)
print(response.json())"anything"Get model keys
Get the ID of each loaded model
200Successful Responseapplication/json
List of models that are loaded by model manager.
Show propertiesHide properties
Identifier of the model
some-project/3Type of the task that the model performs
classificationBatch size accepted by the model (if registered).
Image input height accepted by the model (if registered).
Image input width accepted by the model (if registered).
Estimated GPU VRAM consumed by this model in bytes (measured during load).
Other model IDs that resolved to this model.
HTTP request paths that triggered inference on this model (e.g. /door-glyph-locator/10, /infer/object_detection).
Total estimated VRAM consumed by all loaded models in bytes.
Current GPU memory in use in bytes (device-level, includes all runtimes).
Total GPU memory available in bytes.
Live tensor memory allocated by PyTorch's CUDA allocator in bytes.
Total memory reserved by PyTorch's CUDA allocator in bytes.
Reserved but currently unallocated PyTorch CUDA memory in bytes.
Device memory not reserved by PyTorch in bytes. This includes native runtimes, CUDA context overhead, and allocations from other processes.
GET /model/registry HTTP/1.1
Host: localhost:9001
Accept: application/jsoncurl -L \
--request GET \
--url 'http://localhost:9001/model/registry' \
--header 'Accept: application/json'const response = await fetch("http://localhost:9001/model/registry", {
method: "GET",
headers: {
"Accept": "application/json"
}
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/model/registry"
headers = {
"Accept": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json()){
"models": [
{
"model_id": "some-project/3",
"task_type": "classification",
"batch_size": 1,
"input_height": 1,
"input_width": 1,
"vram_bytes": 1,
"request_aliases": [
"text"
],
"request_paths": [
"text"
]
}
],
"total_vram_bytes": 1,
"gpu_memory_used": 1,
"gpu_memory_total": 1,
"torch_cuda_allocated": 1,
"torch_cuda_reserved": 1,
"torch_cuda_allocator_cache": 1,
"non_torch_gpu_memory": 1
}Core inference
Legacy Infer From Request
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, SemanticSegmentationInferenceResponse, Any]: The response containing the inference results.
ID of a Roboflow dataset corresponding to the model to use for inference OR workspace ID
ID of a Roboflow dataset version corresponding to the model to use for inference OR model ID
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
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.
0.4Show propertiesHide properties
bestdefaultThe confidence threshold used to filter out keypoints that are not visible based on model confidence
0One 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.
jsonThe publically accessible URL of an image to use for inference.
One of base64 or numpy. Note, numpy input is not supported for Roboflow Hosted Inference.
base64If true, labels will be include in any inference visualization.
falseOne 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.
accurateThe amount to tradeoff between 0='fast' and 1='accurate'
0The 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.
300The IoU threhsold that must be met for a box pair to be considered duplicate during NMS
0.3The stroke width used when visualizing predictions
1If true, disables automatic image orientation
falseIf true, disables automatic contrast adjustment
falseIf true, disables automatic grayscale conversion
falseIf true, disables automatic static crop
falseIf true, the predictions will be prevented from registration by Active Learning (if the functionality is enabled)
falseParameter to be used when Active Learning data registration should happen against different dataset than the one pointed by model_id
The source of the inference request
externalThe detailed source information of the inference request
externalThe format of the prediction mask - polygon (default) or rle - applicable for instance segmentation models.
polygonpolygonrle200Successful Responseapplication/json
Show propertiesHide properties
Instance Segmentation inference response.
Attributes: predictions (List[Union[ inference.core.entities.responses.inference.InstanceSegmentationPrediction, inference.core.entities.responses.inference.InstanceSegmentationRLEPrediction ]]): List of instance segmentation predictions.
Show propertiesHide properties
Base64 encoded string containing prediction visualization image data
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
Show propertiesHide properties
Base64 encoded string containing prediction visualization image data
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
Object Detection inference response.
Attributes: predictions (List[inference.core.entities.responses.inference.ObjectDetectionPrediction]): List of object detection predictions.
Show propertiesHide properties
Base64 encoded string containing prediction visualization image data
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
Object Detection prediction.
Attributes: x (float): The center x-axis pixel coordinate of the prediction. y (float): The center y-axis pixel coordinate of the prediction. width (float): The width of the prediction bounding box in number of pixels. height (float): The height of the prediction bounding box in number of pixels. confidence (float): The detection confidence as a fraction between 0 and 1. class_name (str): The predicted class label. class_confidence (Union[float, None]): The class label confidence as a fraction between 0 and 1. class_id (int): The class id of the prediction
Classification inference response.
Attributes: predictions (List[inference.core.entities.responses.inference.ClassificationPrediction]): List of classification predictions. top (str): The top predicted class label. confidence (float): The confidence of the top predicted class label.
Show propertiesHide properties
Base64 encoded string containing prediction visualization image data
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
Classification prediction.
Attributes: class_name (str): The predicted class label. class_id (int): Numeric ID associated with the class label. confidence (float): The class label confidence as a fraction between 0 and 1.
The top predicted class label
The confidence of the top predicted class label
0Identifier of parent image region. Useful when stack of detection-models is in use to refer the RoI being the input to inference
Multi-label Classification inference response.
Attributes: predictions (Dict[str, inference.core.entities.responses.inference.MultiLabelClassificationPrediction]): Dictionary of multi-label classification predictions. predicted_classes (List[str]): The list of predicted classes.
Show propertiesHide properties
Base64 encoded string containing prediction visualization image data
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
The list of predicted classes
Identifier of parent image region. Useful when stack of detection-models is in use to refer the RoI being the input to inference
Semantic Segmentation inference response.
Attributes: predictions (inference.core.entities.responses.inference.SemanticSegmentationPrediction): Semantic segmentation predictions.
Show propertiesHide properties
Base64 encoded string containing prediction visualization image data
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
Show propertiesHide properties
Base64 encoded string containing prediction visualization image data
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
Field to mark prediction type as stub
Identifier of a model stub that was called
Task type of the project
422Validation Errorapplication/json
Show propertiesHide properties
GET /{dataset_id}/{version_id} HTTP/1.1
Host: localhost:9001
Accept: application/jsoncurl -L \
--request GET \
--url 'http://localhost:9001/{dataset_id}/{version_id}' \
--header 'Accept: application/json'const response = await fetch("http://localhost:9001/{dataset_id}/{version_id}", {
method: "GET",
headers: {
"Accept": "application/json"
}
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/{dataset_id}/{version_id}"
headers = {
"Accept": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json()){
"visualization": "text",
"inference_id": "text",
"frame_id": 1,
"time": 1,
"image": [
{
"width": 1,
"height": 1
}
],
"predictions": [
"anything"
]
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}Legacy Infer From Request
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, SemanticSegmentationInferenceResponse, Any]: The response containing the inference results.
ID of a Roboflow dataset corresponding to the model to use for inference OR workspace ID
ID of a Roboflow dataset version corresponding to the model to use for inference OR model ID
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
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.
0.4Show propertiesHide properties
bestdefaultThe confidence threshold used to filter out keypoints that are not visible based on model confidence
0One 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.
jsonThe publically accessible URL of an image to use for inference.
One of base64 or numpy. Note, numpy input is not supported for Roboflow Hosted Inference.
base64If true, labels will be include in any inference visualization.
falseOne 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.
accurateThe amount to tradeoff between 0='fast' and 1='accurate'
0The 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.
300The IoU threhsold that must be met for a box pair to be considered duplicate during NMS
0.3The stroke width used when visualizing predictions
1If true, disables automatic image orientation
falseIf true, disables automatic contrast adjustment
falseIf true, disables automatic grayscale conversion
falseIf true, disables automatic static crop
falseIf true, the predictions will be prevented from registration by Active Learning (if the functionality is enabled)
falseParameter to be used when Active Learning data registration should happen against different dataset than the one pointed by model_id
The source of the inference request
externalThe detailed source information of the inference request
externalThe format of the prediction mask - polygon (default) or rle - applicable for instance segmentation models.
polygonpolygonrle200Successful Responseapplication/json
Show propertiesHide properties
Instance Segmentation inference response.
Attributes: predictions (List[Union[ inference.core.entities.responses.inference.InstanceSegmentationPrediction, inference.core.entities.responses.inference.InstanceSegmentationRLEPrediction ]]): List of instance segmentation predictions.
Show propertiesHide properties
Base64 encoded string containing prediction visualization image data
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
Show propertiesHide properties
Base64 encoded string containing prediction visualization image data
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
Object Detection inference response.
Attributes: predictions (List[inference.core.entities.responses.inference.ObjectDetectionPrediction]): List of object detection predictions.
Show propertiesHide properties
Base64 encoded string containing prediction visualization image data
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
Object Detection prediction.
Attributes: x (float): The center x-axis pixel coordinate of the prediction. y (float): The center y-axis pixel coordinate of the prediction. width (float): The width of the prediction bounding box in number of pixels. height (float): The height of the prediction bounding box in number of pixels. confidence (float): The detection confidence as a fraction between 0 and 1. class_name (str): The predicted class label. class_confidence (Union[float, None]): The class label confidence as a fraction between 0 and 1. class_id (int): The class id of the prediction
Classification inference response.
Attributes: predictions (List[inference.core.entities.responses.inference.ClassificationPrediction]): List of classification predictions. top (str): The top predicted class label. confidence (float): The confidence of the top predicted class label.
Show propertiesHide properties
Base64 encoded string containing prediction visualization image data
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
Classification prediction.
Attributes: class_name (str): The predicted class label. class_id (int): Numeric ID associated with the class label. confidence (float): The class label confidence as a fraction between 0 and 1.
The top predicted class label
The confidence of the top predicted class label
0Identifier of parent image region. Useful when stack of detection-models is in use to refer the RoI being the input to inference
Multi-label Classification inference response.
Attributes: predictions (Dict[str, inference.core.entities.responses.inference.MultiLabelClassificationPrediction]): Dictionary of multi-label classification predictions. predicted_classes (List[str]): The list of predicted classes.
Show propertiesHide properties
Base64 encoded string containing prediction visualization image data
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
The list of predicted classes
Identifier of parent image region. Useful when stack of detection-models is in use to refer the RoI being the input to inference
Semantic Segmentation inference response.
Attributes: predictions (inference.core.entities.responses.inference.SemanticSegmentationPrediction): Semantic segmentation predictions.
Show propertiesHide properties
Base64 encoded string containing prediction visualization image data
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
Show propertiesHide properties
Base64 encoded string containing prediction visualization image data
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
Field to mark prediction type as stub
Identifier of a model stub that was called
Task type of the project
422Validation Errorapplication/json
Show propertiesHide properties
POST /{dataset_id}/{version_id} HTTP/1.1
Host: localhost:9001
Accept: application/jsoncurl -L \
--request POST \
--url 'http://localhost:9001/{dataset_id}/{version_id}' \
--header 'Accept: application/json'const response = await fetch("http://localhost:9001/{dataset_id}/{version_id}", {
method: "POST",
headers: {
"Accept": "application/json"
}
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/{dataset_id}/{version_id}"
headers = {
"Accept": "application/json"
}
response = requests.post(url, headers=headers)
print(response.json()){
"visualization": "text",
"inference_id": "text",
"frame_id": 1,
"time": 1,
"image": [
{
"width": 1,
"height": 1
}
],
"predictions": [
"anything"
]
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}Depth Estimation
Run the depth estimation model to generate a depth map.
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseThe type of the model, usually referring to what task the model performs
Show propertiesHide properties
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
The version ID of the depth estimation model
smallSerialization format for normalized_depth in the response: json (default, wire-compatible with older clients) returns the nested float list; png16 returns a base64 16-bit grayscale PNG (quantization step 1/65535, typically >10x smaller payload - inference_sdk decodes it back to a numpy array when requested via depth_map_format='png16'); png8 returns a base64 8-bit grayscale PNG (256 depth levels, roughly another order of magnitude smaller - fine for visualization/thresholding, lossy for geometric use).
jsonjsonpng16png8200Successful Responseapplication/json
Per-image normalized ordinal depth as a 2D array of floats between 0 and 1, where 1 is nearest and 0 is farthest. Values are not physical distances or directly comparable across images or model families without calibration. The normalized depth map: a 2D array of floats between 0 and 1 (json format, default) or a base64 grayscale PNG string (png16/png8), per the request's depth_map_format
Show propertiesHide properties
The serialization format used for normalized_depth
jsonjsonpng16png8Base64 encoded visualization of the depth map if visualize_predictions is True
422Validation Errorapplication/json
Show propertiesHide properties
POST /infer/depth-estimation HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"model_id": "text",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"depth_version_id": "small",
"depth_map_format": "json"
}curl -L \
--request POST \
--url 'http://localhost:9001/infer/depth-estimation' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"model_id": "text",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"depth_version_id": "small",
"depth_map_format": "json"
}'const response = await fetch("http://localhost:9001/infer/depth-estimation", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"model_id": "text",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"depth_version_id": "small",
"depth_map_format": "json"
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/infer/depth-estimation"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"model_id": "text",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"depth_version_id": "small",
"depth_map_format": "json"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"normalized_depth": "text",
"depth_map_format": "json",
"image": "text"
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}Depth Estimation with model ID in path
Run depth estimation. Model ID is specified in the URL path and can contain slashes.
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseThe type of the model, usually referring to what task the model performs
Show propertiesHide properties
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
The version ID of the depth estimation model
smallSerialization format for normalized_depth in the response: json (default, wire-compatible with older clients) returns the nested float list; png16 returns a base64 16-bit grayscale PNG (quantization step 1/65535, typically >10x smaller payload - inference_sdk decodes it back to a numpy array when requested via depth_map_format='png16'); png8 returns a base64 8-bit grayscale PNG (256 depth levels, roughly another order of magnitude smaller - fine for visualization/thresholding, lossy for geometric use).
jsonjsonpng16png8200Successful Responseapplication/json
Per-image normalized ordinal depth as a 2D array of floats between 0 and 1, where 1 is nearest and 0 is farthest. Values are not physical distances or directly comparable across images or model families without calibration. The normalized depth map: a 2D array of floats between 0 and 1 (json format, default) or a base64 grayscale PNG string (png16/png8), per the request's depth_map_format
Show propertiesHide properties
The serialization format used for normalized_depth
jsonjsonpng16png8Base64 encoded visualization of the depth map if visualize_predictions is True
422Validation Errorapplication/json
Show propertiesHide properties
POST /infer/depth-estimation/{model_id} HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"model_id": "text",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"depth_version_id": "small",
"depth_map_format": "json"
}curl -L \
--request POST \
--url 'http://localhost:9001/infer/depth-estimation/{model_id}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"model_id": "text",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"depth_version_id": "small",
"depth_map_format": "json"
}'const response = await fetch("http://localhost:9001/infer/depth-estimation/{model_id}", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"model_id": "text",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"depth_version_id": "small",
"depth_map_format": "json"
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/infer/depth-estimation/{model_id}"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"model_id": "text",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"depth_version_id": "small",
"depth_map_format": "json"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"normalized_depth": "text",
"depth_map_format": "json",
"image": "text"
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}Large multi-modal model infer
Run inference with the specified large multi-modal model
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseA unique model identifier
The type of the model, usually referring to what task the model performs
Show propertiesHide properties
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
If true, the auto orient preprocessing step is disabled for this call.
falseIf true, the auto contrast preprocessing step is disabled for this call.
falseIf true, the grayscale preprocessing step is disabled for this call.
falseIf true, the static crop preprocessing step is disabled for this call.
falseIf set, use this prompt to guide the LMM
If true, enables thinking/reasoning mode for models that support it (e.g. Qwen3.5). The model's reasoning will be included in the response.
falseMaximum number of tokens to generate. If not set, the model's default will be used.
200Successful Responseapplication/json
Show propertiesHide properties
Show propertiesHide properties
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
Text/structured response generated by model
Show propertiesHide properties
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
Text/structured response generated by model
Show propertiesHide properties
Base64 encoded string containing prediction visualization image data
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
Field to mark prediction type as stub
Identifier of a model stub that was called
Task type of the project
422Validation Errorapplication/json
Show propertiesHide properties
POST /infer/lmm HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"model_id": "raccoon-detector-1",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"disable_preproc_auto_orient": false,
"disable_preproc_contrast": false,
"disable_preproc_grayscale": false,
"disable_preproc_static_crop": false,
"prompt": "caption",
"enable_thinking": false,
"max_new_tokens": 1
}curl -L \
--request POST \
--url 'http://localhost:9001/infer/lmm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"model_id": "raccoon-detector-1",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"disable_preproc_auto_orient": false,
"disable_preproc_contrast": false,
"disable_preproc_grayscale": false,
"disable_preproc_static_crop": false,
"prompt": "caption",
"enable_thinking": false,
"max_new_tokens": 1
}'const response = await fetch("http://localhost:9001/infer/lmm", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"model_id": "raccoon-detector-1",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"disable_preproc_auto_orient": false,
"disable_preproc_contrast": false,
"disable_preproc_grayscale": false,
"disable_preproc_static_crop": false,
"prompt": "caption",
"enable_thinking": false,
"max_new_tokens": 1
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/infer/lmm"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"model_id": "raccoon-detector-1",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"disable_preproc_auto_orient": False,
"disable_preproc_contrast": False,
"disable_preproc_grayscale": False,
"disable_preproc_static_crop": False,
"prompt": "caption",
"enable_thinking": False,
"max_new_tokens": 1
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"inference_id": "text",
"frame_id": 1,
"time": 1,
"image": [
{
"width": 1,
"height": 1
}
],
"response": "text"
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}Large multi-modal model infer with model ID in path
Run inference with the specified large multi-modal model. Model ID is specified in the URL path (can contain slashes).
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseA unique model identifier
The type of the model, usually referring to what task the model performs
Show propertiesHide properties
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
If true, the auto orient preprocessing step is disabled for this call.
falseIf true, the auto contrast preprocessing step is disabled for this call.
falseIf true, the grayscale preprocessing step is disabled for this call.
falseIf true, the static crop preprocessing step is disabled for this call.
falseIf set, use this prompt to guide the LMM
If true, enables thinking/reasoning mode for models that support it (e.g. Qwen3.5). The model's reasoning will be included in the response.
falseMaximum number of tokens to generate. If not set, the model's default will be used.
200Successful Responseapplication/json
Show propertiesHide properties
Show propertiesHide properties
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
Text/structured response generated by model
Show propertiesHide properties
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
Text/structured response generated by model
Show propertiesHide properties
Base64 encoded string containing prediction visualization image data
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
Field to mark prediction type as stub
Identifier of a model stub that was called
Task type of the project
422Validation Errorapplication/json
Show propertiesHide properties
POST /infer/lmm/{model_id} HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"model_id": "raccoon-detector-1",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"disable_preproc_auto_orient": false,
"disable_preproc_contrast": false,
"disable_preproc_grayscale": false,
"disable_preproc_static_crop": false,
"prompt": "caption",
"enable_thinking": false,
"max_new_tokens": 1
}curl -L \
--request POST \
--url 'http://localhost:9001/infer/lmm/{model_id}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"model_id": "raccoon-detector-1",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"disable_preproc_auto_orient": false,
"disable_preproc_contrast": false,
"disable_preproc_grayscale": false,
"disable_preproc_static_crop": false,
"prompt": "caption",
"enable_thinking": false,
"max_new_tokens": 1
}'const response = await fetch("http://localhost:9001/infer/lmm/{model_id}", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"model_id": "raccoon-detector-1",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"disable_preproc_auto_orient": false,
"disable_preproc_contrast": false,
"disable_preproc_grayscale": false,
"disable_preproc_static_crop": false,
"prompt": "caption",
"enable_thinking": false,
"max_new_tokens": 1
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/infer/lmm/{model_id}"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"model_id": "raccoon-detector-1",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"disable_preproc_auto_orient": False,
"disable_preproc_contrast": False,
"disable_preproc_grayscale": False,
"disable_preproc_static_crop": False,
"prompt": "caption",
"enable_thinking": False,
"max_new_tokens": 1
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"inference_id": "text",
"frame_id": 1,
"time": 1,
"image": [
{
"width": 1,
"height": 1
}
],
"response": "text"
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}Embeddings and comparison
CLIP Compare
Run the Open AI CLIP model to compute similarity scores.
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseThe version ID of CLIP to be used for this request. Must be one of RN101, RN50, RN50x16, RN50x4, RN50x64, ViT-B-16, ViT-B-32, ViT-L-14-336px, and ViT-L-14.
ViT-B-16The type of image data provided, one of 'url' or 'base64'
urlShow propertiesHide properties
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
The type of subject, one of 'image' or 'text'
imageShow propertiesHide properties
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
The type of prompt, one of 'image' or 'text'
text200Successful Responseapplication/json
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the similarity scores including preprocessing
Show propertiesHide properties
Identifier of parent image region. Useful when stack of detection-models is in use to refer the RoI being the input to inference
422Validation Errorapplication/json
Show propertiesHide properties
POST /clip/compare HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"clip_version_id": "ViT-B-16",
"model_id": "text",
"subject": "url",
"subject_type": "image",
"prompt": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"prompt_type": "text"
}curl -L \
--request POST \
--url 'http://localhost:9001/clip/compare' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"clip_version_id": "ViT-B-16",
"model_id": "text",
"subject": "url",
"subject_type": "image",
"prompt": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"prompt_type": "text"
}'const response = await fetch("http://localhost:9001/clip/compare", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"clip_version_id": "ViT-B-16",
"model_id": "text",
"subject": "url",
"subject_type": "image",
"prompt": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"prompt_type": "text"
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/clip/compare"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"clip_version_id": "ViT-B-16",
"model_id": "text",
"subject": "url",
"subject_type": "image",
"prompt": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"prompt_type": "text"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"inference_id": "text",
"frame_id": 1,
"time": 1,
"similarity": [
1
],
"parent_id": "text"
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}CLIP Image Embeddings
Run the Open AI CLIP model to embed image data.
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseThe version ID of CLIP to be used for this request. Must be one of RN101, RN50, RN50x16, RN50x4, RN50x64, ViT-B-16, ViT-B-32, ViT-L-14-336px, and ViT-L-14.
ViT-B-16Show propertiesHide properties
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
200Successful Responseapplication/json
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the embeddings including preprocessing
A list of embeddings, each embedding is a list of floats
[[0.12, 0.23, 0.34, ..., 0.43]]422Validation Errorapplication/json
Show propertiesHide properties
POST /clip/embed_image HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"clip_version_id": "ViT-B-16",
"model_id": "text",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
]
}curl -L \
--request POST \
--url 'http://localhost:9001/clip/embed_image' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"clip_version_id": "ViT-B-16",
"model_id": "text",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
]
}'const response = await fetch("http://localhost:9001/clip/embed_image", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"clip_version_id": "ViT-B-16",
"model_id": "text",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
]
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/clip/embed_image"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"clip_version_id": "ViT-B-16",
"model_id": "text",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
]
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"inference_id": "text",
"frame_id": 1,
"time": 1,
"embeddings": "[[0.12, 0.23, 0.34, ..., 0.43]]"
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}CLIP Text Embeddings
Run the Open AI CLIP model to embed text data.
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseThe version ID of CLIP to be used for this request. Must be one of RN101, RN50, RN50x16, RN50x4, RN50x64, ViT-B-16, ViT-B-32, ViT-L-14-336px, and ViT-L-14.
ViT-B-16A string or list of strings
The quick brown fox jumps over the lazy dogShow propertiesHide properties
200Successful Responseapplication/json
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the embeddings including preprocessing
A list of embeddings, each embedding is a list of floats
[[0.12, 0.23, 0.34, ..., 0.43]]422Validation Errorapplication/json
Show propertiesHide properties
POST /clip/embed_text HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"clip_version_id": "ViT-B-16",
"model_id": "text",
"text": "The quick brown fox jumps over the lazy dog"
}curl -L \
--request POST \
--url 'http://localhost:9001/clip/embed_text' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"clip_version_id": "ViT-B-16",
"model_id": "text",
"text": "The quick brown fox jumps over the lazy dog"
}'const response = await fetch("http://localhost:9001/clip/embed_text", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"clip_version_id": "ViT-B-16",
"model_id": "text",
"text": "The quick brown fox jumps over the lazy dog"
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/clip/embed_text"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"clip_version_id": "ViT-B-16",
"model_id": "text",
"text": "The quick brown fox jumps over the lazy dog"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"inference_id": "text",
"frame_id": 1,
"time": 1,
"embeddings": "[[0.12, 0.23, 0.34, ..., 0.43]]"
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}Perception Encoder Compare
Run the Meta Perception Encoder model to compute similarity scores.
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseThe version ID of PERCEPTION_ENCODER to be used for this request. Must be one of RN101, RN50, RN50x16, RN50x4, RN50x64, ViT-B-16, ViT-B-32, ViT-L-14-336px, and ViT-L-14.
PE-Core-L14-336The type of image data provided, one of 'url' or 'base64'
urlShow propertiesHide properties
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
The type of subject, one of 'image' or 'text'
imageShow propertiesHide properties
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
The type of prompt, one of 'image' or 'text'
text200Successful Responseapplication/json
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the similarity scores including preprocessing
Show propertiesHide properties
Identifier of parent image region. Useful when stack of detection-models is in use to refer the RoI being the input to inference
422Validation Errorapplication/json
Show propertiesHide properties
POST /perception_encoder/compare HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"perception_encoder_version_id": "PE-Core-L14-336",
"model_id": "text",
"subject": "url",
"subject_type": "image",
"prompt": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"prompt_type": "text"
}curl -L \
--request POST \
--url 'http://localhost:9001/perception_encoder/compare' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"perception_encoder_version_id": "PE-Core-L14-336",
"model_id": "text",
"subject": "url",
"subject_type": "image",
"prompt": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"prompt_type": "text"
}'const response = await fetch("http://localhost:9001/perception_encoder/compare", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"perception_encoder_version_id": "PE-Core-L14-336",
"model_id": "text",
"subject": "url",
"subject_type": "image",
"prompt": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"prompt_type": "text"
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/perception_encoder/compare"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"perception_encoder_version_id": "PE-Core-L14-336",
"model_id": "text",
"subject": "url",
"subject_type": "image",
"prompt": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"prompt_type": "text"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"inference_id": "text",
"frame_id": 1,
"time": 1,
"similarity": [
1
],
"parent_id": "text"
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}PE Image Embeddings
Run the Meta Perception Encoder model to embed image data.
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseThe version ID of PERCEPTION_ENCODER to be used for this request. Must be one of RN101, RN50, RN50x16, RN50x4, RN50x64, ViT-B-16, ViT-B-32, ViT-L-14-336px, and ViT-L-14.
PE-Core-L14-336Show propertiesHide properties
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
200Successful Responseapplication/json
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the embeddings including preprocessing
A list of embeddings, each embedding is a list of floats
[[0.12, 0.23, 0.34, ..., 0.43]]422Validation Errorapplication/json
Show propertiesHide properties
POST /perception_encoder/embed_image HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"perception_encoder_version_id": "PE-Core-L14-336",
"model_id": "text",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
]
}curl -L \
--request POST \
--url 'http://localhost:9001/perception_encoder/embed_image' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"perception_encoder_version_id": "PE-Core-L14-336",
"model_id": "text",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
]
}'const response = await fetch("http://localhost:9001/perception_encoder/embed_image", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"perception_encoder_version_id": "PE-Core-L14-336",
"model_id": "text",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
]
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/perception_encoder/embed_image"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"perception_encoder_version_id": "PE-Core-L14-336",
"model_id": "text",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
]
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"inference_id": "text",
"frame_id": 1,
"time": 1,
"embeddings": "[[0.12, 0.23, 0.34, ..., 0.43]]"
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}Perception Encoder Text Embeddings
Run the Meta Perception Encoder model to embed text data.
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseThe version ID of PERCEPTION_ENCODER to be used for this request. Must be one of RN101, RN50, RN50x16, RN50x4, RN50x64, ViT-B-16, ViT-B-32, ViT-L-14-336px, and ViT-L-14.
PE-Core-L14-336A string or list of strings
The quick brown fox jumps over the lazy dogShow propertiesHide properties
200Successful Responseapplication/json
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the embeddings including preprocessing
A list of embeddings, each embedding is a list of floats
[[0.12, 0.23, 0.34, ..., 0.43]]422Validation Errorapplication/json
Show propertiesHide properties
POST /perception_encoder/embed_text HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"perception_encoder_version_id": "PE-Core-L14-336",
"model_id": "text",
"text": "The quick brown fox jumps over the lazy dog"
}curl -L \
--request POST \
--url 'http://localhost:9001/perception_encoder/embed_text' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"perception_encoder_version_id": "PE-Core-L14-336",
"model_id": "text",
"text": "The quick brown fox jumps over the lazy dog"
}'const response = await fetch("http://localhost:9001/perception_encoder/embed_text", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"perception_encoder_version_id": "PE-Core-L14-336",
"model_id": "text",
"text": "The quick brown fox jumps over the lazy dog"
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/perception_encoder/embed_text"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"perception_encoder_version_id": "PE-Core-L14-336",
"model_id": "text",
"text": "The quick brown fox jumps over the lazy dog"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"inference_id": "text",
"frame_id": 1,
"time": 1,
"embeddings": "[[0.12, 0.23, 0.34, ..., 0.43]]"
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}Segmentation and detection
Grounding DINO inference.
Run the Grounding DINO zero-shot object detection model.
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseThe type of the model, usually referring to what task the model performs
Show propertiesHide properties
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
If true, the auto orient preprocessing step is disabled for this call.
falseIf true, the auto contrast preprocessing step is disabled for this call.
falseIf true, the grayscale preprocessing step is disabled for this call.
falseIf true, the static crop preprocessing step is disabled for this call.
falseA list of strings
["person","dog","cat"]0.5default0.5false200Successful Responseapplication/json
Base64 encoded string containing prediction visualization image data
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
Show propertiesHide properties
Inference response image information.
Attributes: width (int): The original width of the image used in inference. height (int): The original height of the image used in inference.
Show propertiesHide properties
The original width of the image used in inference
The original height of the image used in inference
Inference response image information.
Attributes: width (int): The original width of the image used in inference. height (int): The original height of the image used in inference.
Show propertiesHide properties
The original width of the image used in inference
The original height of the image used in inference
Object Detection prediction.
Attributes: x (float): The center x-axis pixel coordinate of the prediction. y (float): The center y-axis pixel coordinate of the prediction. width (float): The width of the prediction bounding box in number of pixels. height (float): The height of the prediction bounding box in number of pixels. confidence (float): The detection confidence as a fraction between 0 and 1. class_name (str): The predicted class label. class_confidence (Union[float, None]): The class label confidence as a fraction between 0 and 1. class_id (int): The class id of the prediction
Show propertiesHide properties
The center x-axis pixel coordinate of the prediction
The center y-axis pixel coordinate of the prediction
The width of the prediction bounding box in number of pixels
The height of the prediction bounding box in number of pixels
The detection confidence as a fraction between 0 and 1
The predicted class label
The class label confidence as a fraction between 0 and 1
The class id of the prediction
The tracker id of the prediction if tracking is enabled
Unique identifier of detection
Identifier of parent image region. Useful when stack of detection-models is in use to refer the RoI being the input to inference
422Validation Errorapplication/json
Show propertiesHide properties
POST /grounding_dino/infer HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"model_id": "text",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"disable_preproc_auto_orient": false,
"disable_preproc_contrast": false,
"disable_preproc_grayscale": false,
"disable_preproc_static_crop": false,
"text": [
"person",
"dog",
"cat"
],
"box_threshold": 0.5,
"grounding_dino_version_id": "default",
"text_threshold": 0.5,
"class_agnostic_nms": false
}curl -L \
--request POST \
--url 'http://localhost:9001/grounding_dino/infer' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"model_id": "text",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"disable_preproc_auto_orient": false,
"disable_preproc_contrast": false,
"disable_preproc_grayscale": false,
"disable_preproc_static_crop": false,
"text": [
"person",
"dog",
"cat"
],
"box_threshold": 0.5,
"grounding_dino_version_id": "default",
"text_threshold": 0.5,
"class_agnostic_nms": false
}'const response = await fetch("http://localhost:9001/grounding_dino/infer", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"model_id": "text",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"disable_preproc_auto_orient": false,
"disable_preproc_contrast": false,
"disable_preproc_grayscale": false,
"disable_preproc_static_crop": false,
"text": [
"person",
"dog",
"cat"
],
"box_threshold": 0.5,
"grounding_dino_version_id": "default",
"text_threshold": 0.5,
"class_agnostic_nms": false
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/grounding_dino/infer"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"model_id": "text",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"disable_preproc_auto_orient": False,
"disable_preproc_contrast": False,
"disable_preproc_grayscale": False,
"disable_preproc_static_crop": False,
"text": [
"person",
"dog",
"cat"
],
"box_threshold": 0.5,
"grounding_dino_version_id": "default",
"text_threshold": 0.5,
"class_agnostic_nms": False
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"visualization": "text",
"inference_id": "text",
"frame_id": 1,
"time": 1,
"image": [
{
"width": 1,
"height": 1
}
],
"predictions": [
{
"x": 1,
"y": 1,
"width": 1,
"height": 1,
"confidence": 1,
"class": "text",
"class_confidence": 1,
"class_id": 1,
"tracker_id": 1,
"detection_id": "text",
"parent_id": "text"
}
]
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}Owlv2 image prompting
Run the google owlv2 model to few-shot object detect
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseThe version ID of owlv2 to be used for this request.
owlv2-large-patch14-ensembleModel id to be used in the request.
Images to run the model on
Show propertiesHide properties
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
Training images for the owlvit model to learn form
Show propertiesHide properties
List of boxes and corresponding classes of examples for the model to learn from
Show propertiesHide properties
Center x coordinate in pixels of train box
Center y coordinate in pixels of train box
Width in pixels of train box
Height in pixels of train box
Class name of object this box encloses
Whether this object is a positive or negative example for this class
falseImage data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
Default confidence threshold for owlvit predictions. Needs to be much higher than you're used to, probably 0.99 - 0.9999
0.99If true, the predictions will be drawn on the original image and returned as a base64 string
falseIf true, labels will be rendered on prediction visualizations
falseThe stroke width used when visualizing predictions
1200Successful Responseapplication/json
Base64 encoded string containing prediction visualization image data
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
Show propertiesHide properties
Inference response image information.
Attributes: width (int): The original width of the image used in inference. height (int): The original height of the image used in inference.
Show propertiesHide properties
The original width of the image used in inference
The original height of the image used in inference
Inference response image information.
Attributes: width (int): The original width of the image used in inference. height (int): The original height of the image used in inference.
Show propertiesHide properties
The original width of the image used in inference
The original height of the image used in inference
Object Detection prediction.
Attributes: x (float): The center x-axis pixel coordinate of the prediction. y (float): The center y-axis pixel coordinate of the prediction. width (float): The width of the prediction bounding box in number of pixels. height (float): The height of the prediction bounding box in number of pixels. confidence (float): The detection confidence as a fraction between 0 and 1. class_name (str): The predicted class label. class_confidence (Union[float, None]): The class label confidence as a fraction between 0 and 1. class_id (int): The class id of the prediction
Show propertiesHide properties
The center x-axis pixel coordinate of the prediction
The center y-axis pixel coordinate of the prediction
The width of the prediction bounding box in number of pixels
The height of the prediction bounding box in number of pixels
The detection confidence as a fraction between 0 and 1
The predicted class label
The class label confidence as a fraction between 0 and 1
The class id of the prediction
The tracker id of the prediction if tracking is enabled
Unique identifier of detection
Identifier of parent image region. Useful when stack of detection-models is in use to refer the RoI being the input to inference
422Validation Errorapplication/json
Show propertiesHide properties
POST /owlv2/infer HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"owlv2_version_id": "owlv2-base-patch16-ensemble",
"model_id": "text",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"training_data": [
{
"boxes": [
{
"x": 1,
"y": 1,
"w": 1,
"h": 1,
"cls": "text",
"negative": false
}
],
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
}
}
],
"confidence": 0.99,
"visualize_predictions": false,
"visualization_labels": false,
"visualization_stroke_width": 1
}curl -L \
--request POST \
--url 'http://localhost:9001/owlv2/infer' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"owlv2_version_id": "owlv2-base-patch16-ensemble",
"model_id": "text",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"training_data": [
{
"boxes": [
{
"x": 1,
"y": 1,
"w": 1,
"h": 1,
"cls": "text",
"negative": false
}
],
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
}
}
],
"confidence": 0.99,
"visualize_predictions": false,
"visualization_labels": false,
"visualization_stroke_width": 1
}'const response = await fetch("http://localhost:9001/owlv2/infer", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"owlv2_version_id": "owlv2-base-patch16-ensemble",
"model_id": "text",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"training_data": [
{
"boxes": [
{
"x": 1,
"y": 1,
"w": 1,
"h": 1,
"cls": "text",
"negative": false
}
],
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
}
}
],
"confidence": 0.99,
"visualize_predictions": false,
"visualization_labels": false,
"visualization_stroke_width": 1
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/owlv2/infer"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"owlv2_version_id": "owlv2-base-patch16-ensemble",
"model_id": "text",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"training_data": [
{
"boxes": [
{
"x": 1,
"y": 1,
"w": 1,
"h": 1,
"cls": "text",
"negative": False
}
],
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
}
}
],
"confidence": 0.99,
"visualize_predictions": False,
"visualization_labels": False,
"visualization_stroke_width": 1
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"visualization": "text",
"inference_id": "text",
"frame_id": 1,
"time": 1,
"image": [
{
"width": 1,
"height": 1
}
],
"predictions": [
{
"x": 1,
"y": 1,
"width": 1,
"height": 1,
"confidence": 1,
"class": "text",
"class_confidence": 1,
"class_id": 1,
"tracker_id": 1,
"detection_id": "text",
"parent_id": "text"
}
]
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}YOLO-World inference.
Run the YOLO-World zero-shot object detection model.
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseThe type of the model, usually referring to what task the model performs
Show propertiesHide properties
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
If true, the auto orient preprocessing step is disabled for this call.
falseIf true, the auto contrast preprocessing step is disabled for this call.
falseIf true, the grayscale preprocessing step is disabled for this call.
falseIf true, the static crop preprocessing step is disabled for this call.
falseA list of strings
["person","dog","cat"]l0.4200Successful Responseapplication/json
Base64 encoded string containing prediction visualization image data
Unique identifier of inference
The frame id of the image used in inference if the input was a video
The time in seconds it took to produce the predictions including image preprocessing
Show propertiesHide properties
Inference response image information.
Attributes: width (int): The original width of the image used in inference. height (int): The original height of the image used in inference.
Show propertiesHide properties
The original width of the image used in inference
The original height of the image used in inference
Inference response image information.
Attributes: width (int): The original width of the image used in inference. height (int): The original height of the image used in inference.
Show propertiesHide properties
The original width of the image used in inference
The original height of the image used in inference
Object Detection prediction.
Attributes: x (float): The center x-axis pixel coordinate of the prediction. y (float): The center y-axis pixel coordinate of the prediction. width (float): The width of the prediction bounding box in number of pixels. height (float): The height of the prediction bounding box in number of pixels. confidence (float): The detection confidence as a fraction between 0 and 1. class_name (str): The predicted class label. class_confidence (Union[float, None]): The class label confidence as a fraction between 0 and 1. class_id (int): The class id of the prediction
Show propertiesHide properties
The center x-axis pixel coordinate of the prediction
The center y-axis pixel coordinate of the prediction
The width of the prediction bounding box in number of pixels
The height of the prediction bounding box in number of pixels
The detection confidence as a fraction between 0 and 1
The predicted class label
The class label confidence as a fraction between 0 and 1
The class id of the prediction
The tracker id of the prediction if tracking is enabled
Unique identifier of detection
Identifier of parent image region. Useful when stack of detection-models is in use to refer the RoI being the input to inference
422Validation Errorapplication/json
Show propertiesHide properties
POST /yolo_world/infer HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"model_id": "text",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"disable_preproc_auto_orient": false,
"disable_preproc_contrast": false,
"disable_preproc_grayscale": false,
"disable_preproc_static_crop": false,
"text": [
"person",
"dog",
"cat"
],
"yolo_world_version_id": "l",
"confidence": 0.4
}curl -L \
--request POST \
--url 'http://localhost:9001/yolo_world/infer' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"model_id": "text",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"disable_preproc_auto_orient": false,
"disable_preproc_contrast": false,
"disable_preproc_grayscale": false,
"disable_preproc_static_crop": false,
"text": [
"person",
"dog",
"cat"
],
"yolo_world_version_id": "l",
"confidence": 0.4
}'const response = await fetch("http://localhost:9001/yolo_world/infer", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"model_id": "text",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"disable_preproc_auto_orient": false,
"disable_preproc_contrast": false,
"disable_preproc_grayscale": false,
"disable_preproc_static_crop": false,
"text": [
"person",
"dog",
"cat"
],
"yolo_world_version_id": "l",
"confidence": 0.4
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/yolo_world/infer"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"model_id": "text",
"model_type": "object-detection",
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"disable_preproc_auto_orient": False,
"disable_preproc_contrast": False,
"disable_preproc_grayscale": False,
"disable_preproc_static_crop": False,
"text": [
"person",
"dog",
"cat"
],
"yolo_world_version_id": "l",
"confidence": 0.4
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"visualization": "text",
"inference_id": "text",
"frame_id": 1,
"time": 1,
"image": [
{
"width": 1,
"height": 1
}
],
"predictions": [
{
"x": 1,
"y": 1,
"width": 1,
"height": 1,
"confidence": 1,
"class": "text",
"class_confidence": 1,
"class_id": 1,
"tracker_id": 1,
"detection_id": "text",
"parent_id": "text"
}
]
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}SAM Image Embeddings
Run the Meta AI Segmant Anything Model to embed image data.
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseThe version ID of SAM to be used for this request. Must be one of vit_h, vit_l, or vit_b.
vit_hThe image to be embedded
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
The ID of the image to be embedded used to cache the embedding.
The format of the response. Must be one of json or binary. If binary, embedding is returned as a binary numpy array.
json200Successful Responseapplication/json
If request format is json, embeddings is a series of nested lists representing the SAM embedding. If request format is binary, embeddings is a binary numpy array. The dimensions of the embedding are 1 x 256 x 64 x 64.
[[[[0.1, 0.2, 0.3, ...] ...] ...]]Show propertiesHide properties
The time in seconds it took to produce the embeddings including preprocessing
422Validation Errorapplication/json
Show propertiesHide properties
POST /sam/embed_image HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"sam_version_id": "vit_h",
"model_id": "text",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id",
"format": "json"
}curl -L \
--request POST \
--url 'http://localhost:9001/sam/embed_image' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"sam_version_id": "vit_h",
"model_id": "text",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id",
"format": "json"
}'const response = await fetch("http://localhost:9001/sam/embed_image", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"sam_version_id": "vit_h",
"model_id": "text",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id",
"format": "json"
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/sam/embed_image"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"sam_version_id": "vit_h",
"model_id": "text",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id",
"format": "json"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"embeddings": "[[[[0.1, 0.2, 0.3, ...] ...] ...]]",
"time": 1
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}SAM Image Segmentation
Run the Meta AI Segmant Anything Model to generate segmenations for image data.
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseThe version ID of SAM to be used for this request. Must be one of vit_h, vit_l, or vit_b.
vit_hThe embeddings to be decoded. The dimensions of the embeddings are 1 x 256 x 64 x 64. If embeddings is not provided, image must be provided.
[[[[0.1, 0.2, 0.3, ...] ...] ...]]Show propertiesHide properties
The format of the embeddings. Must be one of json or binary. If binary, embeddings are expected to be a binary numpy array.
jsonThe format of the response. Must be one of json or binary. If binary, masks are returned as binary numpy arrays. If json, masks are converted to polygons, then returned as json.
jsonThe image to be segmented. Only required if embeddings are not provided.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
The ID of the image to be segmented used to retrieve cached embeddings. If an embedding is cached, it will be used instead of generating a new embedding. If no embedding is cached, a new embedding will be generated and cached.
Whether or not the request includes a mask input. If true, the mask input must be provided.
falseThe set of output masks. If request format is json, masks is a list of polygons, where each polygon is a list of points, where each point is a tuple containing the x,y pixel coordinates of the point. If request format is binary, masks is a list of binary numpy arrays. The dimensions of each mask are 256 x 256. This is the same as the output, low resolution mask from the previous inference.
Show propertiesHide properties
The format of the mask input. Must be one of json or binary. If binary, mask input is expected to be a binary numpy array.
jsonThe original size of the image used to generate the embeddings. This is only required if the image is not provided.
The coordinates of the interactive points used during decoding. Each point (x,y pair) corresponds to a label in point_labels.
[[0,0]]The labels of the interactive points used during decoding. A 1 represents a positive point (part of the object to be segmented). A -1 represents a negative point (not part of the object to be segmented). Each label corresponds to a point in point_coords.
[-1]Whether or not to use the mask input cache. If true, the mask input cache will be used if it exists. If false, the mask input cache will not be used.
true200Successful Responseapplication/json
The set of output masks. If request format is json, masks is a list of polygons, where each polygon is a list of points, where each point is a tuple containing the x,y pixel coordinates of the point. If request format is binary, masks is a list of binary numpy arrays. The dimensions of each mask are the same as the dimensions of the input image.
Show propertiesHide properties
The set of output masks. If request format is json, masks is a list of polygons, where each polygon is a list of points, where each point is a tuple containing the x,y pixel coordinates of the point. If request format is binary, masks is a list of binary numpy arrays. The dimensions of each mask are 256 x 256
Show propertiesHide properties
The time in seconds it took to produce the segmentation including preprocessing
422Validation Errorapplication/json
Show propertiesHide properties
POST /sam/segment_image HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"sam_version_id": "vit_h",
"model_id": "text",
"embeddings": "[[[[0.1, 0.2, 0.3, ...] ...] ...]]",
"embeddings_format": "json",
"format": "json",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id",
"has_mask_input": true,
"mask_input": [
[
[
1
]
]
],
"mask_input_format": "json",
"orig_im_size": [
640,
320
],
"point_coords": [
[
10,
10
]
],
"point_labels": [
1
],
"use_mask_input_cache": true
}curl -L \
--request POST \
--url 'http://localhost:9001/sam/segment_image' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"sam_version_id": "vit_h",
"model_id": "text",
"embeddings": "[[[[0.1, 0.2, 0.3, ...] ...] ...]]",
"embeddings_format": "json",
"format": "json",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id",
"has_mask_input": true,
"mask_input": [
[
[
1
]
]
],
"mask_input_format": "json",
"orig_im_size": [
640,
320
],
"point_coords": [
[
10,
10
]
],
"point_labels": [
1
],
"use_mask_input_cache": true
}'const response = await fetch("http://localhost:9001/sam/segment_image", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"sam_version_id": "vit_h",
"model_id": "text",
"embeddings": "[[[[0.1, 0.2, 0.3, ...] ...] ...]]",
"embeddings_format": "json",
"format": "json",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id",
"has_mask_input": true,
"mask_input": [
[
[
1
]
]
],
"mask_input_format": "json",
"orig_im_size": [
640,
320
],
"point_coords": [
[
10,
10
]
],
"point_labels": [
1
],
"use_mask_input_cache": true
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/sam/segment_image"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"sam_version_id": "vit_h",
"model_id": "text",
"embeddings": "[[[[0.1, 0.2, 0.3, ...] ...] ...]]",
"embeddings_format": "json",
"format": "json",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id",
"has_mask_input": True,
"mask_input": [
[
[
1
]
]
],
"mask_input_format": "json",
"orig_im_size": [
640,
320
],
"point_coords": [
[
10,
10
]
],
"point_labels": [
1
],
"use_mask_input_cache": True
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"masks": [
[
[
1
]
]
],
"low_res_masks": [
[
[
1
]
]
],
"time": 1
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}SAM2 Image Embeddings
Run the Meta AI Segment Anything 2 Model to embed image data.
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseThe version ID of SAM to be used for this request. Must be one of hiera_tiny, hiera_small, hiera_large, hiera_b_plus
hiera_largeThe image to be embedded
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
The ID of the image to be embedded used to cache the embedding.
200Successful Responseapplication/json
Image id embeddings are cached to
The time in seconds it took to produce the embeddings including preprocessing
422Validation Errorapplication/json
Show propertiesHide properties
POST /sam2/embed_image HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"sam2_version_id": "hiera_large",
"model_id": "text",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id"
}curl -L \
--request POST \
--url 'http://localhost:9001/sam2/embed_image' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"sam2_version_id": "hiera_large",
"model_id": "text",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id"
}'const response = await fetch("http://localhost:9001/sam2/embed_image", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"sam2_version_id": "hiera_large",
"model_id": "text",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id"
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/sam2/embed_image"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"sam2_version_id": "hiera_large",
"model_id": "text",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"image_id": "text",
"time": 1
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}SAM2 Image Segmentation
Run the Meta AI Segment Anything 2 Model to generate segmenations for image data.
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseThe version ID of SAM to be used for this request. Must be one of hiera_tiny, hiera_small, hiera_large, hiera_b_plus
hiera_largeThe format of the response. Must be one of 'json', 'rle', or 'binary'. If binary, masks are returned as binary numpy arrays. If json, masks are converted to polygons. If rle, masks are converted to RLE format.
jsonImage data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
The ID of the image to be segmented used to retrieve cached embeddings. If an embedding is cached, it will be used instead of generating a new embedding. If no embedding is cached, a new embedding will be generated and cached.
Show propertiesHide properties
An optional list of prompts for masks to predict. Each prompt can include a bounding box and / or a set of postive or negative points
Show propertiesHide properties
If true, the model will return three masks. For ambiguous input prompts (such as a single click), this will often produce better masks than a single prediction. If only a single mask is needed, the model's predicted quality score can be used to select the best mask. For non-ambiguous prompts, such as multiple input prompts, multimask_output=False can give better results.
trueIf True, saves the low-resolution logits to the cache for potential future use. This can speed up subsequent requests with similar prompts on the same image. This feature is ignored if DISABLE_SAM2_LOGITS_CACHE env variable is set True
falseIf True, attempts to load previously cached low-resolution logits for the given image and prompt set. This can significantly speed up inference when making multiple similar requests on the same image. This feature is ignored if DISABLE_SAM2_LOGITS_CACHE env variable is set True
false200Successful Responseapplication/json
SAM segmentation prediction.
Attributes: masks (Union[List[List[List[int]]], Dict[str, Any], Any]): Mask data - either polygon coordinates or RLE encoding. confidence (float): Masks confidences. format (Optional[str]): Format of the mask data: 'polygon' or 'rle'.
Show propertiesHide properties
If polygon format, masks is a list of polygons, where each polygon is a list of points, where each point is a tuple containing the x,y pixel coordinates of the point. If rle format, masks is a dictionary with the keys 'size' and 'counts' containing the size and counts of the RLE encoding.
Show propertiesHide properties
Masks confidences
Format of the mask data: 'polygon' or 'rle'
polygonThe time in seconds it took to produce the segmentation including preprocessing
422Validation Errorapplication/json
Show propertiesHide properties
POST /sam2/segment_image HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"sam2_version_id": "hiera_large",
"model_id": "text",
"format": "json",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id",
"prompts": {
"prompts": [
{
"box": {
"x": 1,
"y": 1,
"width": 1,
"height": 1
},
"points": [
{
"x": 1,
"y": 1,
"positive": true
}
]
}
]
},
"multimask_output": true,
"save_logits_to_cache": false,
"load_logits_from_cache": false
}curl -L \
--request POST \
--url 'http://localhost:9001/sam2/segment_image' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"sam2_version_id": "hiera_large",
"model_id": "text",
"format": "json",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id",
"prompts": {
"prompts": [
{
"box": {
"x": 1,
"y": 1,
"width": 1,
"height": 1
},
"points": [
{
"x": 1,
"y": 1,
"positive": true
}
]
}
]
},
"multimask_output": true,
"save_logits_to_cache": false,
"load_logits_from_cache": false
}'const response = await fetch("http://localhost:9001/sam2/segment_image", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"sam2_version_id": "hiera_large",
"model_id": "text",
"format": "json",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id",
"prompts": {
"prompts": [
{
"box": {
"x": 1,
"y": 1,
"width": 1,
"height": 1
},
"points": [
{
"x": 1,
"y": 1,
"positive": true
}
]
}
]
},
"multimask_output": true,
"save_logits_to_cache": false,
"load_logits_from_cache": false
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/sam2/segment_image"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"sam2_version_id": "hiera_large",
"model_id": "text",
"format": "json",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id",
"prompts": {
"prompts": [
{
"box": {
"x": 1,
"y": 1,
"width": 1,
"height": 1
},
"points": [
{
"x": 1,
"y": 1,
"positive": True
}
]
}
]
},
"multimask_output": True,
"save_logits_to_cache": False,
"load_logits_from_cache": False
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"predictions": [
{
"masks": [
[
[
1
]
]
],
"confidence": 1,
"format": "polygon"
}
],
"time": 1
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}Seg preview Image Embeddings
Run the Model to embed image data.
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseThe version ID of SAM to be used for this request. Must be one of hiera_tiny, hiera_small, hiera_large, hiera_b_plus
hiera_largeThe image to be embedded
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
The ID of the image to be embedded used to cache the embedding.
200Successful Responseapplication/json
Image id embeddings are cached to
The time in seconds it took to produce the embeddings including preprocessing
422Validation Errorapplication/json
Show propertiesHide properties
POST /sam3/embed_image HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"sam2_version_id": "hiera_large",
"model_id": "text",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id"
}curl -L \
--request POST \
--url 'http://localhost:9001/sam3/embed_image' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"sam2_version_id": "hiera_large",
"model_id": "text",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id"
}'const response = await fetch("http://localhost:9001/sam3/embed_image", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"sam2_version_id": "hiera_large",
"model_id": "text",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id"
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/sam3/embed_image"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"sam2_version_id": "hiera_large",
"model_id": "text",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"image_id": "text",
"time": 1
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}SAM3 PCS (promptable concept segmentation)
Run the SAM3 PCS (promptable concept segmentation) to generate segmentations for image data.
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
The source of the inference request
The detailed source information of the inference request
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseThe model ID of SAM3. Use 'sam3/sam3_final' to target the generic base model.
sam3/sam3_finalOne of 'polygon', 'rle'
polygonImage data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
Optional ID for caching embeddings.
Score threshold for outputs.
0.5List of prompts (text and/or visual)
Show propertiesHide properties
Optional hint: 'text' or 'visual'. 'visual' requires at least one box.
Concept to segment as a short noun phrase (e.g. 'person'). All matching instances are returned. Can be combined with exemplar boxes in the same prompt.
Score threshold for this prompt's outputs. Overrides request-level threshold if set.
Exemplar boxes in absolute pixels, as XYWH entries ({x, y, width, height}, top-left anchored) or XYXY entries ({x0, y0, x1, y1}). Each box marks an example object; the model segments every instance matching the exemplars (and text, if provided), not just the boxed objects. Requires box_labels.
Per-box exemplar labels, one per entry in boxes: 1/true marks a positive exemplar (segment objects like this), 0/false marks a negative exemplar (exclude objects like this). Required when boxes is set.
IoU threshold for cross-prompt NMS. If None, NMS is disabled. Must be in [0.0, 1.0] when set.
200Successful Responseapplication/json
Show propertiesHide properties
Show propertiesHide properties
Show propertiesHide properties
Mask data - either polygon coordinates or RLE encoding
Masks confidence
Format of the mask data: 'polygon' or 'rle'
polygonThe time in seconds it took to produce the segmentation including preprocessing
422Validation Errorapplication/json
Show propertiesHide properties
POST /sam3/concept_segment HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"model_id": "sam3/sam3_final",
"format": "polygon",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "text",
"output_prob_thresh": 0.5,
"prompts": [
{
"type": "text",
"text": "text",
"output_prob_thresh": 1,
"boxes": [
null
],
"box_labels": [
null
]
}
],
"nms_iou_threshold": 1
}curl -L \
--request POST \
--url 'http://localhost:9001/sam3/concept_segment' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"model_id": "sam3/sam3_final",
"format": "polygon",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "text",
"output_prob_thresh": 0.5,
"prompts": [
{
"type": "text",
"text": "text",
"output_prob_thresh": 1,
"boxes": [
null
],
"box_labels": [
null
]
}
],
"nms_iou_threshold": 1
}'const response = await fetch("http://localhost:9001/sam3/concept_segment", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"model_id": "sam3/sam3_final",
"format": "polygon",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "text",
"output_prob_thresh": 0.5,
"prompts": [
{
"type": "text",
"text": "text",
"output_prob_thresh": 1,
"boxes": [
null
],
"box_labels": [
null
]
}
],
"nms_iou_threshold": 1
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/sam3/concept_segment"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"model_id": "sam3/sam3_final",
"format": "polygon",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "text",
"output_prob_thresh": 0.5,
"prompts": [
{
"type": "text",
"text": "text",
"output_prob_thresh": 1,
"boxes": [
None
],
"box_labels": [
None
]
}
],
"nms_iou_threshold": 1
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"prompt_results": [
{
"prompt_index": 1,
"echo": {
"prompt_index": 1,
"type": "text",
"text": "text",
"num_boxes": 1
},
"predictions": [
{
"masks": [
[
[
1
]
]
],
"confidence": 1,
"format": "polygon"
}
]
}
],
"time": 1
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}SAM3 PVS (promptable visual segmentation)
Run the SAM3 PVS (promptable visual segmentation) to generate segmentations for image data.
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
The source of the inference request
The detailed source information of the inference request
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseThe version ID of SAM to be used for this request. Must be one of hiera_tiny, hiera_small, hiera_large, hiera_b_plus
hiera_largeThe format of the response. Must be one of 'json', 'rle', or 'binary'. If binary, masks are returned as binary numpy arrays. If json, masks are converted to polygons. If rle, masks are converted to RLE format.
jsonImage data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
The ID of the image to be segmented used to retrieve cached embeddings. If an embedding is cached, it will be used instead of generating a new embedding. If no embedding is cached, a new embedding will be generated and cached.
Show propertiesHide properties
An optional list of prompts for masks to predict. Each prompt can include a bounding box and / or a set of postive or negative points
Show propertiesHide properties
If true, the model will return three masks. For ambiguous input prompts (such as a single click), this will often produce better masks than a single prediction. If only a single mask is needed, the model's predicted quality score can be used to select the best mask. For non-ambiguous prompts, such as multiple input prompts, multimask_output=False can give better results.
trueIf True, saves the low-resolution logits to the cache for potential future use. This can speed up subsequent requests with similar prompts on the same image. This feature is ignored if DISABLE_SAM2_LOGITS_CACHE env variable is set True
falseIf True, attempts to load previously cached low-resolution logits for the given image and prompt set. This can significantly speed up inference when making multiple similar requests on the same image. This feature is ignored if DISABLE_SAM2_LOGITS_CACHE env variable is set True
false200Successful Responseapplication/json
SAM segmentation prediction.
Attributes: masks (Union[List[List[List[int]]], Dict[str, Any], Any]): Mask data - either polygon coordinates or RLE encoding. confidence (float): Masks confidences. format (Optional[str]): Format of the mask data: 'polygon' or 'rle'.
Show propertiesHide properties
If polygon format, masks is a list of polygons, where each polygon is a list of points, where each point is a tuple containing the x,y pixel coordinates of the point. If rle format, masks is a dictionary with the keys 'size' and 'counts' containing the size and counts of the RLE encoding.
Show propertiesHide properties
Masks confidences
Format of the mask data: 'polygon' or 'rle'
polygonThe time in seconds it took to produce the segmentation including preprocessing
422Validation Errorapplication/json
Show propertiesHide properties
POST /sam3/visual_segment HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"sam2_version_id": "hiera_large",
"model_id": "text",
"format": "json",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id",
"prompts": {
"prompts": [
{
"box": {
"x": 1,
"y": 1,
"width": 1,
"height": 1
},
"points": [
{
"x": 1,
"y": 1,
"positive": true
}
]
}
]
},
"multimask_output": true,
"save_logits_to_cache": false,
"load_logits_from_cache": false
}curl -L \
--request POST \
--url 'http://localhost:9001/sam3/visual_segment' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"sam2_version_id": "hiera_large",
"model_id": "text",
"format": "json",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id",
"prompts": {
"prompts": [
{
"box": {
"x": 1,
"y": 1,
"width": 1,
"height": 1
},
"points": [
{
"x": 1,
"y": 1,
"positive": true
}
]
}
]
},
"multimask_output": true,
"save_logits_to_cache": false,
"load_logits_from_cache": false
}'const response = await fetch("http://localhost:9001/sam3/visual_segment", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"sam2_version_id": "hiera_large",
"model_id": "text",
"format": "json",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id",
"prompts": {
"prompts": [
{
"box": {
"x": 1,
"y": 1,
"width": 1,
"height": 1
},
"points": [
{
"x": 1,
"y": 1,
"positive": true
}
]
}
]
},
"multimask_output": true,
"save_logits_to_cache": false,
"load_logits_from_cache": false
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/sam3/visual_segment"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"sam2_version_id": "hiera_large",
"model_id": "text",
"format": "json",
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"image_id": "image_id",
"prompts": {
"prompts": [
{
"box": {
"x": 1,
"y": 1,
"width": 1,
"height": 1
},
"points": [
{
"x": 1,
"y": 1,
"positive": True
}
]
}
]
},
"multimask_output": True,
"save_logits_to_cache": False,
"load_logits_from_cache": False
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"predictions": [
{
"masks": [
[
[
1
]
]
],
"confidence": 1,
"format": "polygon"
}
],
"time": 1
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}SAM3 3D Object Generation
Generate 3D meshes and Gaussian splatting from 2D images with mask prompts.
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseImage data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
Mask input in any supported format: polygon [x1,y1,x2,y2,...], binary mask (base64), RLE dict, or list of these.
The model ID for SAM3_3D.
sam3-3d-objectsSAM3 3D always outputs object gaussians, and can optionally output object meshes if output_meshes is True.
trueOutput the combined scene reconstruction in addition to individual object reconstructions.
trueEnable mesh postprocessing.
trueEnable texture baking for meshes.
trueUse the distilled versions of the model components.
false200Successful Responseapplication/json
422Validation Errorapplication/json
Show propertiesHide properties
POST /sam3_3d/infer HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"mask_input": "anything",
"model_id": "sam3-3d-objects",
"output_meshes": true,
"output_scene": true,
"with_mesh_postprocess": true,
"with_texture_baking": true,
"use_distillations": false
}curl -L \
--request POST \
--url 'http://localhost:9001/sam3_3d/infer' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"mask_input": "anything",
"model_id": "sam3-3d-objects",
"output_meshes": true,
"output_scene": true,
"with_mesh_postprocess": true,
"with_texture_baking": true,
"use_distillations": false
}'const response = await fetch("http://localhost:9001/sam3_3d/infer", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"mask_input": "anything",
"model_id": "sam3-3d-objects",
"output_meshes": true,
"output_scene": true,
"with_mesh_postprocess": true,
"with_texture_baking": true,
"use_distillations": false
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/sam3_3d/infer"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"image": {
"type": "url",
"value": "http://www.example-image-url.com"
},
"mask_input": "anything",
"model_id": "sam3-3d-objects",
"output_meshes": True,
"output_scene": True,
"with_mesh_postprocess": True,
"with_texture_baking": True,
"use_distillations": False
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())"anything"{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}OCR
DocTR OCR response
Run the DocTR OCR model to retrieve text in an image.
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseShow propertiesHide properties
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
defaultfalse200Successful Responseapplication/json
Show propertiesHide properties
OCR Inference response.
Attributes: result (str): The combined OCR recognition result. predictions (List[ObjectDetectionPrediction]): List of objects detected by OCR time (float): The time in seconds it took to produce the inference including preprocessing
Show propertiesHide properties
The combined OCR recognition result.
Metadata about input image dimensions
List of objects detected by OCR
The time in seconds it took to produce the inference including preprocessing.
Identifier of parent image region. Useful when stack of detection-models is in use to refer the RoI being the input to inference
OCR Inference response.
Attributes: result (str): The combined OCR recognition result. predictions (List[ObjectDetectionPrediction]): List of objects detected by OCR time (float): The time in seconds it took to produce the inference including preprocessing
Show propertiesHide properties
The combined OCR recognition result.
Metadata about input image dimensions
List of objects detected by OCR
The time in seconds it took to produce the inference including preprocessing.
Identifier of parent image region. Useful when stack of detection-models is in use to refer the RoI being the input to inference
422Validation Errorapplication/json
Show propertiesHide properties
POST /doctr/ocr HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"doctr_version_id": "default",
"model_id": "text",
"generate_bounding_boxes": false
}curl -L \
--request POST \
--url 'http://localhost:9001/doctr/ocr' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"doctr_version_id": "default",
"model_id": "text",
"generate_bounding_boxes": false
}'const response = await fetch("http://localhost:9001/doctr/ocr", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"doctr_version_id": "default",
"model_id": "text",
"generate_bounding_boxes": false
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/doctr/ocr"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"doctr_version_id": "default",
"model_id": "text",
"generate_bounding_boxes": False
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"result": "text",
"image": {
"width": 1,
"height": 1
},
"predictions": [
{
"x": 1,
"y": 1,
"width": 1,
"height": 1,
"confidence": 1,
"class": "text",
"class_confidence": 1,
"class_id": 1,
"tracker_id": 1,
"detection_id": "text",
"parent_id": "text"
}
],
"time": 1,
"parent_id": "text"
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}EasyOCR OCR response
Run the EasyOCR model to retrieve text in an image.
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseShow propertiesHide properties
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
english_g2["en"]Quantized models are smaller and faster, but may be less accurate and won't work correctly on all hardware.
false200Successful Responseapplication/json
Show propertiesHide properties
OCR Inference response.
Attributes: result (str): The combined OCR recognition result. predictions (List[ObjectDetectionPrediction]): List of objects detected by OCR time (float): The time in seconds it took to produce the inference including preprocessing
Show propertiesHide properties
The combined OCR recognition result.
Metadata about input image dimensions
List of objects detected by OCR
The time in seconds it took to produce the inference including preprocessing.
Identifier of parent image region. Useful when stack of detection-models is in use to refer the RoI being the input to inference
OCR Inference response.
Attributes: result (str): The combined OCR recognition result. predictions (List[ObjectDetectionPrediction]): List of objects detected by OCR time (float): The time in seconds it took to produce the inference including preprocessing
Show propertiesHide properties
The combined OCR recognition result.
Metadata about input image dimensions
List of objects detected by OCR
The time in seconds it took to produce the inference including preprocessing.
Identifier of parent image region. Useful when stack of detection-models is in use to refer the RoI being the input to inference
422Validation Errorapplication/json
Show propertiesHide properties
POST /easy_ocr/ocr HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"easy_ocr_version_id": "english_g2",
"model_id": "text",
"language_codes": [
"en"
],
"quantize": false
}curl -L \
--request POST \
--url 'http://localhost:9001/easy_ocr/ocr' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"easy_ocr_version_id": "english_g2",
"model_id": "text",
"language_codes": [
"en"
],
"quantize": false
}'const response = await fetch("http://localhost:9001/easy_ocr/ocr", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"easy_ocr_version_id": "english_g2",
"model_id": "text",
"language_codes": [
"en"
],
"quantize": false
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/easy_ocr/ocr"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"easy_ocr_version_id": "english_g2",
"model_id": "text",
"language_codes": [
"en"
],
"quantize": False
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"result": "text",
"image": {
"width": 1,
"height": 1
},
"predictions": [
{
"x": 1,
"y": 1,
"width": 1,
"height": 1,
"confidence": 1,
"class": "text",
"class_confidence": 1,
"class_id": 1,
"tracker_id": 1,
"detection_id": "text",
"parent_id": "text"
}
],
"time": 1,
"parent_id": "text"
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}PP-OCRv6 OCR response
Run PP-OCRv6 two-stage OCR to retrieve text in an image.
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseShow propertiesHide properties
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
__unset____unset__200Successful Responseapplication/json
The combined OCR recognition result.
Metadata about input image dimensions
Show propertiesHide properties
The original width of the image used in inference
The original height of the image used in inference
List of objects detected by OCR
Show propertiesHide properties
The center x-axis pixel coordinate of the prediction
The center y-axis pixel coordinate of the prediction
The width of the prediction bounding box in number of pixels
The height of the prediction bounding box in number of pixels
The detection confidence as a fraction between 0 and 1
The predicted class label
The class label confidence as a fraction between 0 and 1
The class id of the prediction
The tracker id of the prediction if tracking is enabled
Unique identifier of detection
Identifier of parent image region. Useful when stack of detection-models is in use to refer the RoI being the input to inference
The time in seconds it took to produce the inference including preprocessing.
Identifier of parent image region. Useful when stack of detection-models is in use to refer the RoI being the input to inference
422Validation Errorapplication/json
Show propertiesHide properties
POST /ocr/pp-ocr HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"text_detection": "__unset__",
"text_recognition": "__unset__",
"pp_ocr_version_id": "text",
"model_id": "text"
}curl -L \
--request POST \
--url 'http://localhost:9001/ocr/pp-ocr' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"text_detection": "__unset__",
"text_recognition": "__unset__",
"pp_ocr_version_id": "text",
"model_id": "text"
}'const response = await fetch("http://localhost:9001/ocr/pp-ocr", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"text_detection": "__unset__",
"text_recognition": "__unset__",
"pp_ocr_version_id": "text",
"model_id": "text"
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/ocr/pp-ocr"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"text_detection": "__unset__",
"text_recognition": "__unset__",
"pp_ocr_version_id": "text",
"model_id": "text"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"result": "text",
"image": {
"width": 1,
"height": 1
},
"predictions": [
{
"x": 1,
"y": 1,
"width": 1,
"height": 1,
"confidence": 1,
"class": "text",
"class_confidence": 1,
"class_id": 1,
"tracker_id": 1,
"detection_id": "text",
"parent_id": "text"
}
],
"time": 1,
"parent_id": "text"
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}TrOCR OCR response
Run the TrOCR model to retrieve text in an image.
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
trueInternal stream-pipeline frame pairing id. Not part of the public API.
If true, disables model monitoring for this request
falseShow propertiesHide properties
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
Image data for inference request.
Attributes: type (str): The type of image data provided, one of 'url', 'base64', or 'numpy'. value (Optional[Any]): Image data corresponding to the image type.
Show propertiesHide properties
The type of image data provided, one of 'url', 'base64', or 'numpy'
urlImage data corresponding to the image type, if type = 'url' then value is a string containing the url of an image, else if type = 'base64' then value is a string containing base64 encoded image data, else if type = 'numpy' then value is binary numpy data serialized using pickle.dumps(); array should 3 dimensions, channels last, with values in the range [0,255].
trocr-base-printed200Successful Responseapplication/json
The combined OCR recognition result.
Metadata about input image dimensions
Show propertiesHide properties
The original width of the image used in inference
The original height of the image used in inference
List of objects detected by OCR
Show propertiesHide properties
The center x-axis pixel coordinate of the prediction
The center y-axis pixel coordinate of the prediction
The width of the prediction bounding box in number of pixels
The height of the prediction bounding box in number of pixels
The detection confidence as a fraction between 0 and 1
The predicted class label
The class label confidence as a fraction between 0 and 1
The class id of the prediction
The tracker id of the prediction if tracking is enabled
Unique identifier of detection
Identifier of parent image region. Useful when stack of detection-models is in use to refer the RoI being the input to inference
The time in seconds it took to produce the inference including preprocessing.
Identifier of parent image region. Useful when stack of detection-models is in use to refer the RoI being the input to inference
422Validation Errorapplication/json
Show propertiesHide properties
POST /ocr/trocr HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"trocr_version_id": "trocr-base-printed",
"model_id": "text"
}curl -L \
--request POST \
--url 'http://localhost:9001/ocr/trocr' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"trocr_version_id": "trocr-base-printed",
"model_id": "text"
}'const response = await fetch("http://localhost:9001/ocr/trocr", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"id": "text",
"api_key": "text",
"usage_billable": true,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": false,
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"trocr_version_id": "trocr-base-printed",
"model_id": "text"
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/ocr/trocr"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"id": "text",
"api_key": "text",
"usage_billable": True,
"start": 1,
"source": "text",
"source_info": "text",
"stream_pipeline_context_id": "text",
"disable_model_monitoring": False,
"image": [
{
"type": "url",
"value": "http://www.example-image-url.com"
}
],
"trocr_version_id": "trocr-base-printed",
"model_id": "text"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"result": "text",
"image": {
"width": 1,
"height": 1
},
"predictions": [
{
"x": 1,
"y": 1,
"width": 1,
"height": 1,
"confidence": 1,
"class": "text",
"class_confidence": 1,
"class_id": 1,
"tracker_id": 1,
"detection_id": "text",
"parent_id": "text"
}
],
"time": 1,
"parent_id": "text"
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}Gaze detection
Gaze Detection (deprecated)Deprecated
Deprecated. Always returns HTTP 410 Gone. The endpoint stub will be removed end of Q2 2026.
200Successful Responseapplication/json
POST /gaze/gaze_detection HTTP/1.1
Host: localhost:9001
Accept: application/jsoncurl -L \
--request POST \
--url 'http://localhost:9001/gaze/gaze_detection' \
--header 'Accept: application/json'const response = await fetch("http://localhost:9001/gaze/gaze_detection", {
method: "POST",
headers: {
"Accept": "application/json"
}
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/gaze/gaze_detection"
headers = {
"Accept": "application/json"
}
response = requests.post(url, headers=headers)
print(response.json())"anything"WebRTC
[EXPERIMENTAL] Establishes WebRTC peer connection and processes video stream in spawned process or modal function
[EXPERIMENTAL] Establishes WebRTC peer connection and processes video stream in spawned process or modal function
Show propertiesHide properties
WorkflowConfigurationimagefalse4truevideo_metadatafalseShow propertiesHide properties
Show propertiesHide properties
Show propertiesHide properties
Show propertiesHide properties
Show propertiesHide properties
true3600webrtc-gpu-small200Successful Responseapplication/json
Operation status
Show propertiesHide properties
Server-side request ID
Identifier of pipeline connected to operation
422Validation Errorapplication/json
Show propertiesHide properties
POST /initialise_webrtc_worker HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"api_key": "text",
"workflow_configuration": {
"type": "WorkflowConfiguration",
"workflow_specification": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"workspace_name": "text",
"workflow_id": "text",
"workflow_version_id": "text",
"image_input_name": "image",
"workflows_parameters": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"disable_sinks": false,
"workflows_thread_pool_workers": 4,
"cancel_thread_pool_tasks_on_exit": true,
"video_metadata_input_name": "video_metadata"
},
"is_preview": false,
"webrtc_offer": {
"type": "text",
"sdp": "text"
},
"webrtc_config": {
"iceServers": [
{
"urls": "text",
"username": "text",
"credential": "text"
}
]
},
"webrtc_turn_config": {
"urls": "text",
"username": "text",
"credential": "text"
},
"webrtc_realtime_processing": true,
"stream_output": [
"text"
],
"data_output": [
"text"
],
"declared_fps": 1,
"rtsp_url": "text",
"mjpeg_url": "text",
"processing_timeout": 3600,
"processing_session_started": "text",
"requested_plan": "webrtc-gpu-small",
"requested_gpu": "text",
"requested_region": "text",
"workspace_id": "text",
"session_id": "text"
}curl -L \
--request POST \
--url 'http://localhost:9001/initialise_webrtc_worker' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"api_key": "text",
"workflow_configuration": {
"type": "WorkflowConfiguration",
"workflow_specification": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"workspace_name": "text",
"workflow_id": "text",
"workflow_version_id": "text",
"image_input_name": "image",
"workflows_parameters": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"disable_sinks": false,
"workflows_thread_pool_workers": 4,
"cancel_thread_pool_tasks_on_exit": true,
"video_metadata_input_name": "video_metadata"
},
"is_preview": false,
"webrtc_offer": {
"type": "text",
"sdp": "text"
},
"webrtc_config": {
"iceServers": [
{
"urls": "text",
"username": "text",
"credential": "text"
}
]
},
"webrtc_turn_config": {
"urls": "text",
"username": "text",
"credential": "text"
},
"webrtc_realtime_processing": true,
"stream_output": [
"text"
],
"data_output": [
"text"
],
"declared_fps": 1,
"rtsp_url": "text",
"mjpeg_url": "text",
"processing_timeout": 3600,
"processing_session_started": "text",
"requested_plan": "webrtc-gpu-small",
"requested_gpu": "text",
"requested_region": "text",
"workspace_id": "text",
"session_id": "text"
}'const response = await fetch("http://localhost:9001/initialise_webrtc_worker", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"api_key": "text",
"workflow_configuration": {
"type": "WorkflowConfiguration",
"workflow_specification": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"workspace_name": "text",
"workflow_id": "text",
"workflow_version_id": "text",
"image_input_name": "image",
"workflows_parameters": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"disable_sinks": false,
"workflows_thread_pool_workers": 4,
"cancel_thread_pool_tasks_on_exit": true,
"video_metadata_input_name": "video_metadata"
},
"is_preview": false,
"webrtc_offer": {
"type": "text",
"sdp": "text"
},
"webrtc_config": {
"iceServers": [
{
"urls": "text",
"username": "text",
"credential": "text"
}
]
},
"webrtc_turn_config": {
"urls": "text",
"username": "text",
"credential": "text"
},
"webrtc_realtime_processing": true,
"stream_output": [
"text"
],
"data_output": [
"text"
],
"declared_fps": 1,
"rtsp_url": "text",
"mjpeg_url": "text",
"processing_timeout": 3600,
"processing_session_started": "text",
"requested_plan": "webrtc-gpu-small",
"requested_gpu": "text",
"requested_region": "text",
"workspace_id": "text",
"session_id": "text"
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/initialise_webrtc_worker"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"api_key": "text",
"workflow_configuration": {
"type": "WorkflowConfiguration",
"workflow_specification": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"workspace_name": "text",
"workflow_id": "text",
"workflow_version_id": "text",
"image_input_name": "image",
"workflows_parameters": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"disable_sinks": False,
"workflows_thread_pool_workers": 4,
"cancel_thread_pool_tasks_on_exit": True,
"video_metadata_input_name": "video_metadata"
},
"is_preview": False,
"webrtc_offer": {
"type": "text",
"sdp": "text"
},
"webrtc_config": {
"iceServers": [
{
"urls": "text",
"username": "text",
"credential": "text"
}
]
},
"webrtc_turn_config": {
"urls": "text",
"username": "text",
"credential": "text"
},
"webrtc_realtime_processing": True,
"stream_output": [
"text"
],
"data_output": [
"text"
],
"declared_fps": 1,
"rtsp_url": "text",
"mjpeg_url": "text",
"processing_timeout": 3600,
"processing_session_started": "text",
"requested_plan": "webrtc-gpu-small",
"requested_gpu": "text",
"requested_region": "text",
"workspace_id": "text",
"session_id": "text"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"status": "text",
"context": {
"request_id": "text",
"pipeline_id": "text"
},
"sdp": "text",
"type": "text"
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}WebRTC session heartbeat
Receive heartbeat for an active WebRTC session.
This endpoint is called periodically to indicate that their session is still active. The session will be removed from the quota count if no heartbeat is received within the TTL period.
Requires api_key for authentication.
200Successful Responseapplication/json
422Validation Errorapplication/json
Show propertiesHide properties
POST /webrtc/session/heartbeat HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"session_id": "text",
"api_key": "text"
}curl -L \
--request POST \
--url 'http://localhost:9001/webrtc/session/heartbeat' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"session_id": "text",
"api_key": "text"
}'const response = await fetch("http://localhost:9001/webrtc/session/heartbeat", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"session_id": "text",
"api_key": "text"
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/webrtc/session/heartbeat"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"session_id": "text",
"api_key": "text"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"ANY_ADDITIONAL_PROPERTY": "anything"
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}End WebRTC session
End a WebRTC session and immediately free the quota slot.
Requires api_key for authentication.
200Successful Responseapplication/json
422Validation Errorapplication/json
Show propertiesHide properties
POST /webrtc/session/heartbeat/end HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Accept: application/json
{
"session_id": "text",
"api_key": "text"
}curl -L \
--request POST \
--url 'http://localhost:9001/webrtc/session/heartbeat/end' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"session_id": "text",
"api_key": "text"
}'const response = await fetch("http://localhost:9001/webrtc/session/heartbeat/end", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"session_id": "text",
"api_key": "text"
})
});
const data = await response.json();
console.log(data);import requests
url = "http://localhost:9001/webrtc/session/heartbeat/end"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"session_id": "text",
"api_key": "text"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()){
"ANY_ADDITIONAL_PROPERTY": "anything"
}{
"detail": [
{
"loc": [
"anything"
],
"msg": "text",
"type": "text"
}
]
}