cd /news/computer-vision/openrouter-object-detection-with-rob… · home › topics › computer-vision › article
[ARTICLE · art-178852] src=roboflow.com ↗ pub= topic=computer-vision verified=true sentiment=· neutral

OpenRouter Object Detection with Roboflow Workflows

Roboflow published a guide for building an OpenRouter object-detection pipeline in Roboflow Workflows, comparing six vision-language models on a construction-site image and configuring bounding-box formats before training an RF-DETR detector. The walkthrough uses the OpenRouter block with model ID amazon/nova-pro-v1, Task Type set to Unprompted Object Detection, classes hard_hat and safety_vest, and the default Detection Format of Named keys, 0–1. Roboflow notes that models may return differing coordinate orders such as xyxy or yxyx, miss small objects, or box the wrong regions, so detections should be inspected and saved as draft annotations before training.

recommendation

Match the Detection Format to the model's coordinate order and scale, then inspect detections and save them as draft annotations before training a custom detector.

more in playbook: Verifying model output
by read13 min views8 publishedNov 30, 2026
OpenRouter Object Detection with Roboflow Workflows
Image: Roboflow (auto-discovered)

You can use vision-language models to detect objects before training a custom detector. Give a supported model an image and a list of classes, such as hard hats and safety vests, and ask it to return bounding boxes. OpenRouter provides access to models from multiple providers through one API, making it easier to test which models work on your images.

Getting useful detections takes more than choosing a model. Models can return different coordinate formats, miss small objects, or draw boxes around the wrong regions. Your application needs consistent predictions, and you need a way to inspect their accuracy.

In this guide, we’ll build an OpenRouter object detection pipeline with Roboflow Workflows (opens in a new tab). We’ll compare six models on a construction-site image, configure bounding-box formats, and visualize the results. Then, we’ll show how to save detections as draft annotations, review them, and train an RF-DETR model for repeated inference on your own images.

Can OpenRouter models do object detection?

Yes. Many vision-language models available through OpenRouter can detect objects in images. In Roboflow Workflows, you can select Unprompted Object Detection under Task Type in the OpenRouter block's configuration, if your chosen model supports it. The model can identify objects in the image and return coordinates showing where they appear.

These coordinates can be returned in formats such as xyxy, which gives the left, top, right, and bottom edges of a box. Other models can use yxyx or name each coordinate separately.

Even with the correct format, a model might miss a safety vest or draw a box around the wrong object. Always check the detections before using them.

Object detection with the OpenRouter Block

For our construction-site example, we'll use the OpenRouter block in Roboflow Workflows with these settings:

Model ID: amazon/nova-pro-v1.

Task Type: Select Unprompted Object Detection.

Classes: Enter hard_hat, safety_vest to tell the model which objects to find.

Detection Format: Select Named keys, 0–1 (default).

The Detection Format setting tells Roboflow how to read the model's coordinates. The default (Named keys, 0–1) expects named coordinates such as x_min and y_min, with values between 0 and 1. Other options include xyxy_0_1000 and yxyx_0_1000, which use a scale of 0 to 1000 but arrange the coordinates differently.

The OpenRouter block returns the detected objects and their bounding-box coordinates through its predictions output. You can use these results directly in other Workflow blocks without adding the older VLM as Detector block (opens in a new tab).

How OpenRouter bounding-box formats work

Consider a 640 × 480 image with an object whose bounding box starts at pixel (100, 50) and ends at pixel (300, 250).

The same box can be represented in several formats:

Format

Coordinate order

Values

Pixel XYXY

Left, top, right, bottom

[100, 50, 300, 250]

Pixel YXYX

Top, left, bottom, right

[50, 100, 250, 300]

Normalized XYXY

Left, top, right, bottom

[0.156, 0.104, 0.469, 0.521]

Normalized YXYX

Top, left, bottom, right

[0.104, 0.156, 0.521, 0.469]

Normalization divides horizontal coordinates by the image width and vertical coordinates by its height. This converts the coordinates into values between 0 and 1. XYXY stores the horizontal coordinates first, followed by the vertical coordinates. YXYX reverses that order.

The Detection Format setting tells the OpenRouter block which bounding-box format to request and how to read the model's response. The model's response must follow that format. If the coordinate order or scale differs, the bounding boxes may appear shifted or incorrectly scaled.

Direct OpenRouter API example

You can send an image directly to OpenRouter's Chat Completions API and request object detections in a defined JSON format using JSON Schema.

The following example demonstrates what an OpenRouter request would look like.

Shell

curl -X POST https://openrouter.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "YOUR_SUPPORTED_VISION_MODEL",
    "provider": {
      "require_parameters": true
    },
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "Detect all visible hard hats and safety vests. Return one detection per object, with bounding-box coordinates normalized between 0 and 1. Use the top-left corner as the coordinate origin."
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "https://example.com/construction-site.jpg"
            }
          }
        ]
      }
    ],
    "response_format": {
      "type": "json_schema",
      "json_schema": {
        "name": "object_detections",
        "strict": true,
        "schema": {
          "type": "object",
          "properties": {
            "detections": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "class": {
                    "type": "string",
                    "enum": ["hard_hat", "safety_vest"]
                  },
                  "bbox": {
                    "type": "object",
                    "properties": {
                      "x_min": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "y_min": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "x_max": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "y_max": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      }
                    },
                    "required": ["x_min", "y_min", "x_max", "y_max"],
                    "additionalProperties": false
                  }
                },
                "required": ["class", "bbox"],
                "additionalProperties": false
              }
            }
          },
          "required": ["detections"],
          "additionalProperties": false
        }
      }
    }
  }'

The request uses an OpenRouter API key and a vision model that supports structured outputs. The model field specifies which model handles the request, while the image URL points to the image being analyzed. JSON Schema defines the response structure, but does not guarantee detection accuracy. Review the predicted classes and bounding boxes against the original image.

This direct request uses an OpenRouter API key. The Roboflow example below uses a separate Roboflow API key and Workflow endpoint to execute the complete Workflow.

Tutorial: Detect Objects with a VLM

Let's test OpenRouter object detection on a synthetic construction-site image showing three workers. Each worker is wearing a hard hat and a reflective safety vest, giving us six objects to detect.

Step 1: Create the Workflow

Open Roboflow Workflows and select Create Workflow (opens in a new tab). Start with a blank Workflow, which already includes Inputs and Outputs blocks by default. Add an OpenRouter block between them and connect it to the image input. Use the Nova Pro configuration from the previous section, with hard_hat and safety_vest as the classes.

Add a Bounding Box Visualization block (opens in a new tab) and connect the OpenRouter block's predictions output to its Predictions input. Connect the original image to its Image input to draw boxes around the detected objects.

Next, add a Label Visualization block (opens in a new tab) to show class names such as hard_hat and safety_vest. Connect the bounding box visualization's output image to its Image input, and the OpenRouter predictions to its Predictions input.

Finally, connect the Label Visualization output to the Workflow's Outputs block to return the annotated image. Add the OpenRouter block's predictions and error_status outputs as separate outputs. This tutorial uses OpenRouter block v3, which provides structured detection predictions. The error_status output helps you check whether the OpenRouter block processed the response successfully. If error_status is false and the predictions list is empty, the model returns no detections.

Step 3: Run the Workflow and Check the Results

Run the Workflow using the construction-site image.

Compare the detections with the original image. Each hard hat and safety vest should have a bounding box that fits the object without including too much background. In our test, Nova Pro detected all three hard hats and three safety vests.

Compare OpenRouter models for object detection

We compared six models using a new construction-site image, which shows four workers, three hard hats, and three safety vests. We ran the test on November 5, 2026, using a 1672 × 941-pixel image.

All models were tested using the OpenRouter block's Unprompted Object Detection task, with hard_hat and safety_vest as the target classes. For each model, we changed only the Model ID and Detection Format. All other settings were left unchanged.

The average time was calculated from two runs using Roboflow's reported Workflow processing time. This is a Workflow-level processing time, not isolated model inference time.

A detection was counted as correct when its class label matched the object and its bounding box aligned with that specific object without including a lot of background or a neighboring object. We reviewed box placement visually rather than assigning a score based on an IoU threshold.

Model ID

Detection Format

Correct Detections (Hard Hats / Vests)

Missed Objects

False Positives

Localization Issues

Avg. Time

amazon/nova-pro-v1

Named keys, 0–1

3/3, 2/3

Operator's vest

None observed on this image

No major shifts

6.637 s

openai/gpt-4o-mini

YXYX, 0–1000

1/3, 1/3

Blue/yellow hats; two vests

Blue shirt as vest; torso as hard hat

Oversized, misplaced boxes

6.896 s

anthropic/claude-opus-5.5

Named keys, 0–1

3/3, 3/3

None observed on this image

None observed on this image

Slightly oversized vest boxes

7.056 s

anthropic/claude-opus-4.6

Named keys, 0–1

2/3, 3/3

Blue hard hat

Extra hard hats

Oversized, shifted boxes

8.312 s

google/gemini-2.5-pro

YXYX, 0–1000

3/3, 3/3

None observed on this image

None observed on this image

Slightly oversized vest boxes

18.067 s

qwen/qwen3.6-27b

YXYX, 0–1000

3/3, 3/3

None observed on this image

None observed on this image

Small box around the middle worker's hard hat

18.081 s

The OpenRouter block uses Roboflow credits by default. You can also provide your own OpenRouter API key for billing directly through OpenRouter.

The results show how six OpenRouter models performed on the construction-site image. The comparison covers one image and cannot establish which model performs best across object-detection tasks. For a broader evaluation, see Roboflow's Object Detection benchmark (opens in a new tab), which compares predicted bounding boxes against ground-truth annotations using mAP@50, mAP@75, and mAP@50:95 across different IoU thresholds.

The image below shows the detections returned by claude-opus-5.5 on the difficult image.

Nova Pro detected all three hard hats but missed the orange safety vest worn by the excavator operator.

Test a few supported models on images from your site, including cases where workers are partially hidden. Compare missed objects and box placement.

Troubleshoot OpenRouter object detection

If boxes are shifted or scaled incorrectly, check the Detection Format setting. Make sure the coordinate order and scale match the model's response, then rerun the Workflow and compare the boxes with the original image.

If an object is missing, check that its class is included in the Classes field in the block. If it is, try a closer crop, another supported vision model, or add the missing bounding box during annotation review.

If the model returns an unexpected class, check the requested Classes field in the block and inspect the raw prediction. Remove detections outside the target class list or correct their labels during annotation review. If the model keeps returning unrelated classes, test another supported model.

If the response is empty, check error_status and inspect the raw response. True indicates a parsing error. False with an empty predictions list means the Workflow returned no detections.

Reasoning can use up the available output-token budget before the model returns JSON, leaving no usable response. Roboflow documented this issue with Mistral Large 4 on openrouter@v3. Check token usage before treating an empty response as a successful run with no detections.

When to use VLM detection vs. a trained detector

OpenRouter object detection is useful when you don't have labeled images to train your own model on. A VLM can identify new or rare object classes through zero-shot detection, such as a specific type of safety equipment on a construction site. You can then review the predicted bounding boxes and use the corrected annotations to start building a training dataset.

Comparison

OpenRouter VLM

RF-DETR

Best for

Quick testing of new or rare object classes and initial auto-labeling

Consistent detection of trained classes across many images

Training data

No labeled dataset needed for zero-shot detection

Requires labeled images for training

Speed and cost

External VLM requests can be slow and costly when processing many images

Designed for real-time detection and can offer lower costs per image at scale

Deployment

Requires access to the VLM provider

Can run in the cloud or locally on your own hardware

For a construction site with several cameras monitoring workers throughout the day, RF-DETR might be a better long-term choice. It can process images locally without sending every frame to an external VLM. Before deploying it, test it on footage from your own cameras to see how well it detects safety equipment on workers who are far away or partly hidden.

Then add a Roboflow Dataset Upload block (opens in a new tab) to your Workflow and select the project. Connect the original image to its Image input and the OpenRouter predictions to its Predictions input. Enable Persist Predictions to save the detected boxes as annotations.

Collect more construction-site images showing workers at different distances and under different lighting conditions. Include examples where workers aren't wearing hard hats or safety vests.

Open the uploaded images in Roboflow Annotate and review the bounding boxes. Check that each hard hat and safety vest has the correct class label.

Add boxes around objects the VLM missed and remove any incorrect detections. Adjust any boxes that don't fit the objects properly, then save the corrected annotations before training. Once the annotations are ready, generate a dataset version (opens in a new tab) in Roboflow and select Custom Training to train RF-DETR. After training, test the model on images it hasn't seen before.

After training RF-DETR, you can set up a Workflow to check the confidence score of each detection. Images with low-confidence scores can be sent to a VLM or a person for review, while those with higher scores continue without that extra step.

RF-DETR may miss objects entirely, leaving no confidence score to check. Review some images where the model found no objects. If you find any missed hard hats or safety vests, label them and add the corrected images to your dataset for future training.

Run OpenRouter object detection through an API

To run your OpenRouter Workflow in the cloud, click Use in the top-right corner of the Workflow editor. Select Cloud API, then choose cURL, Python, or JavaScript to view the API request example. Add your API key and image URL, then send the request to the Serverless Cloud API (opens in a new tab) to get the detection results.

To run the Workflow using Python and a local image, install the Roboflow Inference SDK:

Shell

pip install inference-sdk

The example uses a Roboflow API key and the Roboflow Serverless endpoint to execute the published Workflow. The Workflow runs its configured OpenRouter block. A direct OpenRouter API request uses a separate OpenRouter API key and the OpenRouter Chat Completions endpoint.

Python

import json

from inference_sdk import InferenceHTTPClient, InferenceConfiguration

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key="YOUR_ROBOFLOW_API_KEY"
).configure(InferenceConfiguration(
    api_key_transport="header"  # Header-based auth (Inference SDK v1.5.0+)
))

result = client.run_workflow(
    workspace_name="YOUR_WORKSPACE_NAME",
    workflow_id="YOUR_WORKFLOW_ID",
    images={
        "image": "PATH/TO/YOUR/IMAGE.png"
    },
    use_cache=False  # Disable caching for a fresh request
)
result = result[0]

predictions = result["predictions"]
detections = predictions["predictions"]

print("Error status:", result["error_status"])
print("Number of detections:", len(detections))
print(json.dumps(predictions, indent=2))

In this test, the Workflow returned six detections, with error_status set to false.

Each prediction includes class, the detected object label (such as safety_vest), and class_id, its numeric identifier. The x and y values give the bounding-box center in pixels, while width and height specify its dimensions. The confidence value gives the model's confidence score for that detection.

The OpenRouter block relies on an external VLM provider, so it still requires an internet connection. If you've trained RF-DETR, you can deploy it locally or in the cloud without sending images to an external VLM.

Conclusion

On the harder image, Gemini 2.5 Pro, Opus 5.5, and Qwen3.6-27B detected all six objects. Opus 5.5 averaged around 7 seconds per image, compared with around 18 seconds for Gemini 2.5 Pro and Qwen3.6-27B.

Nova Pro missed a safety vest, while Opus 4.6 and GPT-4o-mini made detection errors. These results show why you should check the Detection Format and review predictions before using them as training annotations.

Try OpenRouter object detection in Roboflow Workflows by adding an OpenRouter block with a supported VLM to detect objects in your own images.

── more in #computer-vision 4 stories · sorted by recency
── more on @roboflow 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/openrouter-object-de…] indexed:0 read:13min 2026-11-30 · —