Roboflow Docs
DashboardResourcesProducts
  • Product Documentation
  • Developer Reference
  • Changelog
  • Roboflow Documentation
  • Quickstart
  • Workspaces
    • Workspaces, Projects, and Models
    • Create a Workspace
    • Manage Team Members
    • Role-Based Access Control
    • Usage Based Pricing
      • View Plan Usage
      • Purchase Pre-Paid Credits
      • Flex Credit Billing
    • Rename a Workspace
    • Delete a Workspace
  • Workflows
    • What is Workflows?
    • Create a Workflow
    • Build a Workflow
    • Test a Workflow
    • Deploy a Workflow
    • Workflow Examples
      • Multimodal Model Workflow
    • Share a Workflow
    • Workflows AI Assistant
  • Dataset Management
    • Create a Project
    • Upload Images, Videos, and Annotations
      • Import Data from Cloud Providers
        • AWS S3 Bucket
        • Azure Blob Storage
        • Google Cloud Storage
      • Import from Roboflow Universe
    • Manage Datasets
      • Dataset Batches
      • Search a Dataset
      • Set Dataset Classes
      • Add Tags to Images
      • Create an Annotation Attribute
      • Download an Image
      • Delete an Image
    • Dataset Versions
      • Create a Dataset Version
      • Preprocess Images
      • Augment Images
      • Delete a Version
      • Export a Dataset Version
    • Dataset Analytics
    • Merge Projects
    • Rename a Project
    • Delete a Project
    • Project Folders
    • Make a Project Public
  • Annotate
    • Introduction to Roboflow Annotate
    • Annotate an Image
      • Keyboard Shortcuts
      • Comment on an Image
      • Annotation History
      • Similarity Search
    • AI Labeling
      • Label Assist
      • Enhanced Smart Polygon with SAM
        • Smart Polygon (Legacy)
      • Box Prompting
      • Auto Label
    • Set Keypoint Skeletons
    • Annotate Keypoints
    • Annotate Multimodal Data
    • Collaborate on Annotations
    • Annotation Insights
  • Managed Labeling
  • Train
    • Train a Model
      • Train from a Universe Checkpoint
      • Train from Azure Vision
      • Train from Google Cloud
    • Roboflow Instant
    • Cancel a Training Job
    • Stop Training Early
    • View Training Results
    • View Trained Models
    • Evaluate Trained Models
  • Download a Dataset Version
  • Deploy
    • Deploy a Model or Workflow
    • Managed Deployments
    • Serverless Hosted API V2
      • Use in a Workflow
      • Use with the REST API
      • Run an Instant Model
    • Serverless Hosted API
      • Object Detection
      • Classification
      • Instance Segmentation
        • Semantic Segmentation
      • Keypoint Detection
      • Foundation Models
        • CLIP
        • OCR
        • YOLO-World
      • Video Inference
        • Use a Fine-Tuned Model
        • Use CLIP
        • Use Gaze Detection
        • API Reference
        • Video Inference JSON Output Format
      • Pre-Trained Model APIs
        • Blur People API
        • OCR API
        • Logistics API
        • Image Tagging API
        • People Detection API
        • Fish Detection API
        • Bird Detection API
        • PPE Detection API
        • Barcode Detection API
        • License Plate Detection API
        • Ceramic Defect Detection API
        • Metal Defect Detection API
    • Dedicated Deployments
      • Create a Dedicated Deployment
      • Make Requests to a Dedicated Deployment
      • Manage Dedicated Deployments with an API
    • Batch Processing
    • SDKs
      • Python inference-sdk
      • Web Browser
        • inferencejs Reference
        • inferencejs Requirements
      • Lens Studio
        • Changelog - Lens Studio
      • Luxonis OAK
    • Upload Custom Model Weights
    • Download Model Weights
    • Enterprise Deployment
      • License Server
      • Offline Mode
      • Kubernetes
      • Docker Compose
    • Monitor Deployed Models
      • Alerting
  • Universe
    • What is Roboflow Universe?
    • Find a Dataset on Universe
    • Explore Images in a Universe Dataset
    • Fork a Universe Dataset
    • Find a Model on Universe
    • Download a Universe Dataset
  • Set a Project Description
  • View Project Analytics
  • Support
    • Share a Workspace with Support
    • Delete Your Roboflow Account
    • Apply for Academic Credits
Powered by GitBook
On this page

Was this helpful?

  1. Deploy
  2. Serverless Hosted API V2

Use with the REST API

PreviousUse in a WorkflowNextRun an Instant Model

Last updated 9 hours ago

Was this helpful?

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

https://serverless.roboflow.com

This is in contrast to the V1 API which had many different endpoints based on the type of models being inferred.

Model Type
Serverless Hosted API V2
Hosted API V1

Object detection, Keypoint detection

https://serverless.roboflow.com

https://detect.roboflow.com

Instance Segmentation

https://serverless.roboflow.com

https://outline.roboflow.com

Classification

https://serverless.roboflow.com

https://classify.roboflow.com

Semantic Segmentation

Currently not supported

https://segment.roboflow.com

Foundation models (i.e. CLIP, OCR, YOLO-World)

https://serverless.roboflow.com

https://infer.roboflow.com

Make Requests with HTTP

Make Requests with the Python SDK

If you are working in Python, the most convenient way to interact with the Serverless API is to use the Inference Python SDK.

To use the SDK, first install it:

pip install inference-sdk

To make a request to the Serverless Hosted API V2, use the following code:

from inference_sdk import InferenceHTTPClient

CLIENT = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key="API_KEY"
)

result = CLIENT.infer(your_image.jpg, model_id="model-id/1")

Above, specify your and .

model ID
API key
  • Make Requests with HTTP
  • POSTEndpoint to run predefined workflow
  • Make Requests with the Python SDK

Endpoint to run predefined workflow

post

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

Path parameters
workspace_namestringRequired
workflow_idstringRequired
Body
api_keyany ofOptional

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

stringOptional
or
nullOptional
excluded_fieldsany ofOptional

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

string[]Optional
or
nullOptional
enable_profilingbooleanOptional

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

Default: false
workflow_idany ofOptional

Optional identifier of workflow

stringOptional
or
nullOptional
use_cachebooleanOptional

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

Default: true
Responses
200
Successful Response
application/json
422
Validation Error
application/json
post
POST /{workspace_name}/workflows/{workflow_id} HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 156

{
  "api_key": "text",
  "inputs": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "excluded_fields": [
    "text"
  ],
  "enable_profiling": false,
  "workflow_id": "text",
  "use_cache": true
}
{
  "outputs": [
    {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  ],
  "profiler_trace": [
    {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  ]
}