> ## Documentation Index
> Fetch the complete documentation index at: /llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Make your first Field Sight API call in 5 minutes

This guide walks you through sending an image to the `/detect` endpoint and reading the result.

## Before you begin

You need:

* A Field Sight API key. [Learn how to get one](/api/authentication.md#get-your-api-key).
* An image file to test with (`.jpg` or `.png`).

**1. Set your API key**

Store your key in an environment variable so it stays out of your code:

```bash
export FIELDSIGHT_API_KEY="YOUR_API_KEY"
```

**2. Send your first request**

Call `POST /detect` with your image:

```bash curl
curl --location --request POST https://api.novumlogictechnologies.com/detect?check_blur=false \
  --header "x-api-key: $FIELDSIGHT_API_KEY" \
  --form 'file=@"/path/to/image.jpg"'
```

```javascript JavaScript (Node.js 18+)
import fs from "node:fs";

const form = new FormData();
form.append("file", new Blob([fs.readFileSync("/path/to/image.jpg")]), "image.jpg");

const res = await fetch("https://api.novumlogictechnologies.com/detect?check_blur=false", {
  method: "POST",
  headers: { "x-api-key": process.env.FIELDSIGHT_API_KEY },
  body: form,
});

console.log(await res.json());
```

```python Python
import os
import requests

with open("/path/to/image.jpg", "rb") as f:
    res = requests.post(
        "https://api.novumlogictechnologies.com/detect?check_blur=false",
        params={"check_blur": "false"},
        headers={"x-api-key": os.environ["FIELDSIGHT_API_KEY"]},
        files={"file": f},
    )

print(res.json())
```

Replace `/path/to/image.jpg` with the path to your own image.

**3. Check the response**

A successful request returns `200 OK` with JSON like this:

```json
{
  "id": "068ebc45-1f3d-47d3-8cf2-f86024bb07ba",
  "source": "api",
  "tokens_charged": 1,
  "status": "completed",
  "created_at": "2026-11-11T10:44:10.410746Z",
  "input": {
    "endpoint": "/detect",
    "image_path": "7f8f6001-a416-42e3-8baa-02683f093060/images/detect 01 demo.jpg",
    "service_name": "Detect Distribution Board"
  },
  "output": {
    "is_open": true,
    "is_blurred": false,
    "is_thermal": false,
    "blur_percentage": 0,
    "predictions": {
      "num_detections": 21,
      "counts": {
        "MCB": 7,
        "RCBO": 13,
        "Main Switch": 1
      },
      "board_direction": "unidentified",
      "was_cropped": true,
      "crop_region": {
        "x": 0,
        "y": 0,
        "w": 768,
        "h": 1024
      },
      "rcd_groups": [],
      "predictions": [
        {
          "detection_id": "295497e9-151c-420d-b24d-f236e1fc162f",
          "class_id": 1,
          "class_name": "Main Switch",
          "confidence": 0.93,
          "x": 276,
          "y": 709.5,
          "width": 94.4,
          "height": 79.8
        },
        {
          "detection_id": "3f846241-303c-4845-9546-6ee497b1f4e9",
          "class_id": 0,
          "class_name": "MCB",
          "confidence": 0.91,
          "x": 224.9,
          "y": 267.2,
          "width": 69.7,
          "height": 26.7
        }
      ]
    }
  }
}
```

### Top-Level Fields

| Field | Type | Description |
| - | - | - |
| `id` | string (UUID) | Unique identifier for the processed request log. |
| `source` | string | Origin source of the request (`api` or `web`). |
| `tokens_charged` | integer | Number of usage tokens deducted for the request. |
| `status` | string | Current processing status (`completed`, `pending`, `failed`). |
| `created_at` | string (ISO 8601) | Timestamp indicating when the request was initiated. |
| `input` | object | Metadata echoing the request input details (`endpoint`, `image_path`, `service_name`). |
| `output` | object | The primary detection analysis result. |

### Output Fields

| Field | Type | Description |
| - | - | - |
| `output.is_open` | boolean | Indicates whether the board cover is open. |
| `output.is_blurred` | boolean | Indicates whether the input image was flagged as blurred. |
| `output.blur_percentage` | number | Blur score / percentage detected on the image. |
| `output.is_thermal` | boolean | Indicates whether the uploaded image is a thermal capture. |
| `output.predictions` | object | Detection details containing detected components and bounding boxes. |

### Predictions Object Fields

| Field | Type | Description |
| - | - | - |
| `predictions.num_detections` | integer | Total count of recognized items in the image. |
| `predictions.counts` | object | Key-value summary of component counts by type (e.g., `MCB`, `RCBO`, `Main Switch`). |
| `predictions.board_direction` | string | Layout orientation of the board (`unidentified`, `left_to_right_group`, `right_to_left_group`). |
| `predictions.was_cropped` | boolean | Indicates if the board region was automatically cropped for inference. |
| `predictions.crop_region` | object | Coordinates (`x`, `y`, `w`, `h`) of the board cropping area. |
| `predictions.rcd_groups` | array | Groups of MCBs protected under each detected RCD unit. |
| `predictions.predictions` | array | Array of detected objects, including their bounding coordinates (`x`, `y`, `width`, `height`), label (`class_name`), class ID (`class_id`), and `confidence` score (0 to 1). |

## Optional parameters

| Parameter | Type | Description |
| - | - | - |
| `check_blur` | query, boolean | \[WHAT IT DOES, e.g. Rejects blurry images when `true`"]. Default: `false` |

## Something went wrong?

| Status | Likely cause |
| - | - |
| `401` | Missing or invalid `x-api-key`. See [Authentication](/api/authentication.md) |
| `400` | Missing `file` field or unsupported file. |

See [Errors](/api/errors.md) for the full list.

## Next steps

> [card] [Authentication](/api/authentication.md)
>
> Learn how API keys work and how to keep them secure.

> [card] [Errors](/api/errors.md)
>
> Understand error responses and how to handle them.
