# Pricing

The [roboflow.com/credits](https://roboflow.com/credits) page mentions that 1 credit corresponds to 500 seconds of inference time. A more accurate formula is the following:

```matlab
if x-remote-processing-time header is set:
   credits = (100ms + x-remote-processing-time) / 500,000ms
else:
   credits = max(x-processing-time, 100ms) / 500,000ms
```

Where `x-processing-time` and `x-remote-processing-time` are HTTP Response headers, in float format (seconds). See [roboflow.com/pricing](https://roboflow.com/pricing) for credit pricing.

### <sub>Model Inference</sub>

In the example below, we run inference on [coco/39 model](https://universe.roboflow.com/microsoft/coco/model/39) (RF-DETR Small, 560x560).  In response headers we can find `x-processing-time` , which is 81ms. In this case, we'd have `credits = max(81, 100) / 500,000 = 0.0002 credits` , or 0.2 credits per 1000 images.

```shellscript
curl -X POST "https://serverless.roboflow.com/coco/39?api_key=API_KEY&image=https://media.roboflow.com/notebooks/examples/dog.jpeg" -I
HTTP/2 200 
content-type: application/json
content-length: 995
x-model-cold-start: false
x-model-id: coco/39
x-processing-time: 0.08100700378417969
x-workspace-id: my-workspace-id
```

#### Cold start

If you run the same request a 10 minutes later, it could happen that the model has been unloaded and needs to be loaded to the GPU again - a cold start. Model loading can take up to a few seconds, and is highly correlated with the delay between inferences.

```bash
curl -X POST "https://serverless.roboflow.com/coco/39?api_key=API_KEY&image=https://media.roboflow.com/notebooks/examples/dog.jpeg" -I
HTTP/2 200 
content-type: application/json
content-length: 995
x-model-cold-start: true
x-model-id: coco/39
x-model-load-details: [{"m": "coco/39", "t": 0.7791134570725262}]
x-model-load-time: 0.5791134570725262
x-processing-time: 1.1060344696044922
x-workspace-id: my-workspace-id
```

**Formula**: `credits = max(1106, 100)/500,000 = 0.0022` , or **2.2 credits per 1000** (cold start) images.

### Workflow run

For Workflows, we split model inference from general Workflow processing. This means that Workflow itself will be executed on (cheaper) CPU-only machines, and only use GPU machines for model inference, resulting in a more cost-effective processing.&#x20;

<figure><img src="https://662926385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M6S9nPJhEX9FYH6clfW%2Fuploads%2FXQbvps5GpzFdJBX665lz%2Fworkflow.png?alt=media&#x26;token=47ae4df5-e35b-4470-a383-bffa6f8627d9" alt=""><figcaption><p>License plate recognition Workflow with 2x object detection model, dynamic cropping, multiple visualizations, and Gemini for OCR</p></figcaption></figure>

```bash
curl --location 'https://serverless.roboflow.com/my-workspace-id/workflows/lpr-workflow' -i \
--header 'Content-Type: application/json' \
--data '{
    "api_key": "API_KEY",
    "inputs": {
        "image": {"type": "url", "value": "https://storage.googleapis.com/com-roboflow-marketing/docs/cars-highway.png"}
    }
}'

HTTP/2 200 
content-type: application/json
content-length: 2277416
x-model-cold-start: false
x-processing-time: 6.334797143936157
x-remote-processing-time: 1.0542614459991455
x-remote-processing-times: [{"m": "vehicle-detection-bz0yu/4", "t": 1.0091230869293213}, {"m": "license-plate-w8chc/1", "t": 0.017786026000976562}, {"m": "license-plate-w8chc/1", "t": 0.01506495475769043}, {"m": "license-plate-w8chc/1", "t": 0.012287378311157227}]
x-workspace-id: my-workspace-id
```

**Formula**: `credits = (100ms + 1054ms)/500,000` , so **0.0023 credits** for processing, and some tiny amount for the Gemini API call (depending on token count, see [roboflow.com/credits](https://roboflow.com/credits)).
