Make Requests to a Dedicated Deployment

Use Python SDK

Install the latest version of the Python SDK inference_sdk with pip install --upgrade inference-sdk.

When your dedicated deployment is ready, copy its URL and paste it to the parameter api_url when initializing InferenceHTTPClient.

Here is an example for running model inference:

from inference_sdk import InferenceHTTPClient

CLIENT = InferenceHTTPClient(
    api_url="https://dev-testing.roboflow.cloud",
    api_key="ROBOFLOW_API_KEY"
)

image_url = "https://source.roboflow.com/pwYAXv9BTpqLyFfgQoPZ/u48G0UpWfk8giSw7wrU8/original.jpg"
result = CLIENT.infer(image_url, model_id="soccer-players-5fuqs/1")

Use HTTP API

You can also access the HTTP APIs which are listed under /docs, e.g., https://dev-testing.roboflow.cloud/docs.

Please attach your workspace api_key as a query parameter when accessing these endpoints.

Here is an example for making the same request as above using the HTTP API:

import requests
import json

api_url = "https://dev-testing.roboflow.cloud"
model_id = "soccer-players-5fuqs/1"
image_url = "https://source.roboflow.com/pwYAXv9BTpqLyFfgQoPZ/u48G0UpWfk8giSw7wrU8/original.jpg"

resp = requests.get(f"{api_url}/{model_id}", params = {"api_key": "ROBOFLOW_API_KEY", "image": image_url})
result = json.loads(resp.content)

Use Workflow UI

A dedicated deployment can also be used as the backend server for running Roboflow Workflows. Roboflow Workflows is a low-code, web-based application builder for creating computer vision applications.

After creating your workflow, click on the Running on Hosted API link in the top left corner.

Click Dedicated Deployments to see the list of your dedicated deployments, select the target deployment, then click Connect.

Now you are ready to use your dedicated deployment in the workflow editor.