# 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.

<figure><img src="/files/WZnrBqNhYyQLbHO50c1C" 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)).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.roboflow.com/deploy/serverless-hosted-api-v2/pricing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
