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

# Request Units

> How request units are calculated for text and image analysis

Request units measure API usage across all Centure endpoints. Each request consumes request units based on the content analyzed.

## When Request Units Are Consumed

Request units are consumed when:

* API endpoints for screening content are called directly
* Tool call results are scanned during MCP proxy usage (server to client direction only)

Request units are not consumed for authentication, API key management, client to server messages, or other non-scanning operations.

## Text Analysis

Text analysis consumes 1 request unit per 1,000 characters. Requests with more than 1,000 characters consume multiple request units.

<CodeGroup>
  ```javascript JavaScript theme={null}
  const requestUnits = Math.ceil(content.length / 1000);
  ```

  ```python Python theme={null}
  import math
  request_units = math.ceil(len(content) / 1000)
  ```

  ```go Go theme={null}
  import "math"

  requestUnits := int(math.Ceil(float64(len(content)) / 1000))
  ```
</CodeGroup>

## Image Analysis

Image analysis consumes 3 request units per 1,024 × 1,024 pixels (1 megapixel). Images with dimensions exceeding 2,048 pixels on either side are automatically resized, which consumes an additional 3 request units.

<CodeGroup>
  ```javascript JavaScript theme={null}
  const pixelCount = imageWidth * imageHeight;
  let requestUnits = Math.ceil((pixelCount * 3) / (1024 * 1024));

  // Add 3 units if image needs resizing (dimensions > 2048px)
  if (imageWidth > 2048 || imageHeight > 2048) {
    requestUnits += 3;
  }
  ```

  ```python Python theme={null}
  import math

  pixel_count = image_width * image_height
  request_units = math.ceil((pixel_count * 3) / (1024 * 1024))

  # Add 3 units if image was resized (dimensions > 2048px)
  if image_width > 2048 or image_height > 2048:
      request_units += 3
  ```

  ```go Go theme={null}
  import "math"

  pixelCount := imageWidth * imageHeight
  requestUnits := int(math.Ceil(float64(pixelCount*3) / (1024 * 1024)))

  // Add 3 units if image was resized (dimensions > 2048px)
  if imageWidth > 2048 || imageHeight > 2048 {
      requestUnits += 3
  }
  ```
</CodeGroup>
