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

# Validate Supply From Photo

> Upload an image of an incoming electrical supply connection or source to validate whether it meets acceptable installation standards.

### What is validated
- **Compliance / Validity:** Evaluates whether the supply connection is valid (`is_valid: true/false`).
- **Enclosure State:** Detects whether the supply cover or enclosure is open (`is_open: true/false`).
- **Thermal Check:** Identifies whether the capture is a thermal image (`is_thermal: true/false`).

### Supported files
- **Formats:** `.jpg`, `.jpeg`, `.png`
- **Max file size:** 10 MB
- **Content type:** `multipart/form-data` under the `file` field




## OpenAPI

````yaml /api/api-reference/detection.yml post /supply-from-validation
openapi: 3.0.3
info:
  title: Field Sight API
  version: 1.0.0
  description: Field Sight electrical board analysis API.
servers:
  - url: https://api.novumlogictechnologies.com
security:
  - ApiKeyAuth: []
paths:
  /supply-from-validation:
    post:
      tags:
        - Validation
      summary: Validate Supply From Photo
      description: >
        Upload an image of an incoming electrical supply connection or source to
        validate whether it meets acceptable installation standards.


        ### What is validated

        - **Compliance / Validity:** Evaluates whether the supply connection is
        valid (`is_valid: true/false`).

        - **Enclosure State:** Detects whether the supply cover or enclosure is
        open (`is_open: true/false`).

        - **Thermal Check:** Identifies whether the capture is a thermal image
        (`is_thermal: true/false`).


        ### Supported files

        - **Formats:** `.jpg`, `.jpeg`, `.png`

        - **Max file size:** 10 MB

        - **Content type:** `multipart/form-data` under the `file` field
      operationId: validateSupplyFrom
      parameters:
        - name: check_blur
          in: query
          required: false
          description: >-
            When set to `true`, enables image sharpness and blur level analysis.
            Defaults to `false`.
          schema:
            type: boolean
            default: false
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: >-
                    The supply origin / connection image to validate (.jpg,
                    .jpeg, .png).
      responses:
        '200':
          description: Supply from photo validated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SupplyFromValidationResponse'
              example:
                id: b4df1951-73f7-4f83-8109-1d741748409e
                source: api
                tokens_charged: 1
                status: completed
                created_at: '2026-11-11T12:04:07.479753Z'
                input:
                  endpoint: /supply-from-validation
                  image_path: >-
                    901b68dd-ed2d-49c0-9f65-fee163f9bcb2/images/supply-form-validation
                    demo 01.png
                  service_name: Supply Form Validation
                output:
                  is_open: true
                  is_valid: false
                  is_blurred: false
                  is_thermal: false
                  blur_percentage: 0
        '400':
          description: Bad request (invalid query parameter or missing multipart file).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: BAD_REQUEST
                error: 'Invalid input: check_blur must be true or false'
        '401':
          description: Missing, invalid, or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: UNAUTHORIZED
                error: API key not found or no longer valid
        '402':
          description: No active subscription or token balance exhausted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: TOKENS_EXHAUSTED
                error: Available usage was just used up.
        '413':
          description: File size exceeds the 10MB limit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: FILE_TOO_LARGE
                error: file size exceeds 10MB limit
        '415':
          description: Unsupported media type or invalid file content.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: INVALID_FILE_CONTENT
                error: file content is not a valid JPEG or PNG image
        '422':
          description: Unprocessable entity (AI model failed to analyze image).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: UNPROCESSABLE_ENTITY
                error: Unprocessable entity
        '429':
          description: Too many requests in progress.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: TOO_MANY_PENDING_REQUESTS
                error: Too many requests in progress. Please wait a moment and retry.
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: INTERNAL_ERROR
                error: Internal server error
components:
  schemas:
    SupplyFromValidationResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        source:
          type: string
          example: api
        tokens_charged:
          type: integer
          example: 1
        status:
          type: string
          example: completed
        created_at:
          type: string
          format: date-time
        input:
          type: object
          properties:
            endpoint:
              type: string
            image_path:
              type: string
            service_name:
              type: string
        output:
          type: object
          properties:
            is_valid:
              type: boolean
              nullable: true
              description: Whether the supply photo meets validity criteria.
            is_open:
              type: boolean
              nullable: true
              description: Whether the supply enclosure/door is open.
            is_thermal:
              type: boolean
              description: Whether the image is a thermal capture.
            is_blurred:
              type: boolean
              nullable: true
              description: Whether the image was detected as blurry.
            blur_percentage:
              type: number
              format: float
              nullable: true
              description: Blur calculation metric.
    Error:
      type: object
      required:
        - code
        - error
      properties:
        code:
          type: string
          description: Standardized error code identifier.
          example: UNAUTHORIZED
        error:
          type: string
          description: Human-readable error description.
          example: API key not found or no longer valid
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Your Field Sight API key.

````