---
title: "Analyze Build API"
canonical_url: "https://www.nutrient.io/guides/dws-processor/tools-and-api/analyze-build-api/"
md_url: "https://www.nutrient.io/guides/dws-processor/tools-and-api/analyze-build-api.md"
last_updated: "2026-07-06T00:00:00.000Z"
description: "Estimate credit usage for Nutrient DWS Processor API Build requests without executing them. Use the analyze Build API to preview cost and required features."
---

# Analyze Build API

Use the analyze Build API to estimate the credit cost of a Build API request without executing the workflow. The [`/analyze_build` endpoint](https://www.nutrient.io/api/reference/public/#tag/Document-Editing/operation/analyze_build) validates and analyzes Build API instructions and returns the estimated cost and required features.

The analysis request is free of charge. Use it before running large, batch, or expensive workflows such as optical character recognition (OCR), PDF/UA, Office conversion, or multistep processing.

## Analyze a Build API request

The following example estimates the cost of converting a remote PDF to DOCX.

### Shell

### HTTP

## Analyze OCR cost

OCR can have different credit implications depending on page count and workflow configuration. Analyze OCR requests before running them over large document batches.

Use this instructions object to analyze OCR cost:

```json

{
  "parts": [
    {
      "file": {
        "url": "https://example.com/scanned-document.pdf"
      },
      "content_type": "application/pdf"
    }
  ],
  "actions": [
    {
      "type": "ocr",
      "language": "english"
    }
  ]
}

```

## Analyze PDF/UA cost

PDF/UA auto-tagging is a page-based compliance workflow. Use `/analyze_build` to estimate the cost before processing large documents.

Use this instructions object to analyze PDF/UA cost:

```json

{
  "parts": [
    {
      "file": {
        "url": "https://example.com/document.pdf"
      },
      "content_type": "application/pdf"
    }
  ],
  "output": {
    "type": "pdfua"
  }
}

```

## Analyze multistep workflows

You can analyze the same Build API instructions you plan to send to `/build`. The following example estimates a workflow that merges two PDFs, applies OCR, adds a watermark, and linearizes the output.

Use this instructions object to analyze a multistep workflow:

```json

{
  "parts": [
    {
      "file": {
        "url": "https://example.com/part-1.pdf"
      },
      "content_type": "application/pdf"
    },
    {
      "file": {
        "url": "https://example.com/part-2.pdf"
      },
      "content_type": "application/pdf"
    }
  ],
  "actions": [
    {
      "type": "ocr",
      "language": "english"
    },
    {
      "type": "watermark",
      "text": "ARCHIVE",
      "width": "50%",
      "height": "20%",
      "opacity": 0.3,
      "rotation": 45
    }
  ],
  "output": {
    "type": "pdf",
    "optimize": {
      "linearize": true
    }
  }
}

```

## Provide content types for remote files

When you analyze requests with remote files, include `content_type` for each file when possible. This helps the endpoint identify conversion features accurately, especially for Office, image, email, AutoCAD, and PDF inputs.

Use this structure to provide a content type for a remote file:

```json

{
  "parts": [
    {
      "file": {
        "url": "https://example.com/report.docx"
      },
      "content_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
    }
  ]
}

```

Without `content_type`, analysis may not correctly identify some conversion features.

## Understand the response

The response includes the total estimated cost and a breakdown of required features.

The following example shows an analysis response:

```json

{
  "cost": 3.5,
  "required_features": {
    "ocr_api": [
      {
        "unit_cost": 2,
        "unit_type": "per_use",
        "units": 1,
        "cost": 2,
        "usage": ["$.actions[0]"]
      }
    ],
    "document_editor_api": [
      {
        "unit_cost": 1,
        "unit_type": "per_use",
        "units": 1,
        "cost": 1,
        "usage": ["$.parts"]
      }
    ]
  }
}

```

Response fields:

| Field               | Description                                                  |
| ------------------- | ------------------------------------------------------------ |
| `cost`              | Total estimated credit cost if the request is executed.      |
| `required_features` | Breakdown of Processor API features required by the request. |
| `unit_cost`         | Credit cost per feature unit.                                |
| `unit_type`         | Billing unit type, such as `per_use` or `per_output_page`.   |
| `units`             | Number of units used by that feature.                        |
| `cost`              | Estimated cost for that feature.                             |
| `usage`             | JSON paths to the instructions that triggered the feature.   |

Use the `usage` paths to identify which parts of your instructions contribute to the estimated cost.

## Analyze before batch processing

For batch workflows, analyze a representative request before processing the full batch. This helps you:

- Estimate total credit usage.

- Detect unexpectedly expensive workflow steps.

- Confirm that the request uses the expected features.

- Decide whether to split large jobs into smaller requests.

- Check whether OCR, PDF/UA, Office conversion, or optimization settings are needed.

The analysis result is an estimate for the provided instructions. Actual execution can still fail if a remote file is unavailable, a document is password-protected, the input content is invalid, or the output exceeds limits.

## Compare analyze and build

Use `/analyze_build` when you want to estimate cost and required features without producing a document.

Use `/build` when you want to execute the workflow and receive the processed output file.

| Endpoint         | Executes workflow | Returns document | Charges credits |
| ---------------- | ----------------- | ---------------- | --------------- |
| `/analyze_build` | No                | No               | No              |
| `/build`         | Yes               | Yes              | Yes             |

## Check account credits

To check your available credits, use the account or credits endpoints in the API reference. You can combine credit checks with `/analyze_build` to decide whether to run a large workflow.

Run this request to check account information:

```bash

curl -X GET https://api.nutrient.io/account/info \
  -H "Authorization: Bearer $NUTRIENT_API_KEY"

```

## Reference

Analyze Build uses the same `BuildInstructions` structure as `/build`, but it only accepts JSON instructions and doesn’t upload or process local files:

```typescript

type AnalyzeBuildRequest = BuildInstructions;

type AnalyzeBuildResponse = {
  cost?: number,
  required_features?: Record<
    string,
    Array<{
      unit_cost: number,
      unit_type: "per_use" | "per_output_page",
      units: number,
      cost: number,
      usage: string[],
    }>
  >,
};

type BuildInstructions = {
  parts: Part[],
  actions?: BuildAction[],
  output?: BuildOutput,
};

```

## Related API reference operations

- Refer to the [analyze a build request endpoint](https://www.nutrient.io/api/reference/public/#tag/Document-Editing/operation/analyze_build) API reference to estimate Build API credit usage without executing the workflow.

- Refer to the [build document endpoint](https://www.nutrient.io/api/reference/public/#tag/Document-Editing/operation/build-document) API reference to execute the workflow and return the processed output.

- Refer to the [get account information endpoint](https://www.nutrient.io/api/reference/public/#tag/Account/operation/get-account-info) API reference to check account information and available credits.

## Related guides

- Refer to the [Build API workflows](https://www.nutrient.io/guides/dws-processor/developer-guides/combine-workflows.md) guide.

- Refer to the [PDF OCR API](https://www.nutrient.io/guides/dws-processor/tools-and-api/pdf-ocr-api.md) guide.

- Refer to the [PDF/UA auto-tagging API](https://www.nutrient.io/guides/dws-processor/tools-and-api/pdfua-api.md) guide.

- Refer to the [Office-to-PDF API](https://www.nutrient.io/guides/dws-processor/tools-and-api/office-to-pdf-api.md) guide.

- Refer to the [PDF-to-Office API](https://www.nutrient.io/guides/dws-processor/tools-and-api/pdf-to-office-api.md) guide.

- Refer to the [PDF optimization API](https://www.nutrient.io/guides/dws-processor/tools-and-api/pdf-optimization-api.md) guide.

- Refer to the [tools and APIs](https://www.nutrient.io/guides/dws-processor/tools-and-api.md) guide.
---

## Related pages

- [Image-to-PDF API](/guides/dws-processor/tools-and-api/image-to-pdf-api.md)
- [Document-to-image API](/guides/dws-processor/tools-and-api/document-to-image-api.md)
- [DOCX templating API](/guides/dws-processor/tools-and-api/docx-templating-api.md)
- [Import XFDF annotations API](/guides/dws-processor/tools-and-api/import-xfdf-annotations-api.md)
- [Office-to-PDF API](/guides/dws-processor/tools-and-api/office-to-pdf-api.md)
- [Tools and APIs](/guides/dws-processor/tools-and-api.md)
- [Import Instant JSON API](/guides/dws-processor/tools-and-api/import-instant-json-api.md)
- [Markdown-to-PDF API](/guides/dws-processor/tools-and-api/markdown-to-pdf-api.md)
- [PDF flatten API](/guides/dws-processor/tools-and-api/pdf-flatten-api.md)
- [PDF linearization API](/guides/dws-processor/tools-and-api/pdf-linearization-api.md)
- [PDF merge API](/guides/dws-processor/tools-and-api/pdf-merge-api.md)
- [PDF digital signature API](/guides/dws-processor/tools-and-api/pdf-digital-signature-api.md)
- [PDF optimization API](/guides/dws-processor/tools-and-api/pdf-optimization-api.md)
- [PDF form filling API](/guides/dws-processor/tools-and-api/pdf-form-filling-api.md)
- [PDF security API](/guides/dws-processor/tools-and-api/pdf-security-api.md)
- [PDF rotate API](/guides/dws-processor/tools-and-api/pdf-rotate-api.md)
- [PDF page manipulation API](/guides/dws-processor/tools-and-api/pdf-page-manipulation-api.md)
- [PDF-to-image API](/guides/dws-processor/tools-and-api/pdf-to-image-api.md)
- [PDF split API](/guides/dws-processor/tools-and-api/pdf-split-api.md)
- [PDF watermark API](/guides/dws-processor/tools-and-api/pdf-watermark-api.md)
- [PDF OCR API](/guides/dws-processor/tools-and-api/pdf-ocr-api.md)
- [PDF-to-HTML API](/guides/dws-processor/tools-and-api/pdf-to-html-api.md)
- [PDF-to-PDF/A API](/guides/dws-processor/tools-and-api/pdf-to-pdfa-api.md)
- [PDF generator API](/guides/dws-processor/tools-and-api/pdf-generator-api.md)
- [PDF/UA auto-tagging API](/guides/dws-processor/tools-and-api/pdfua-api.md)
- [PDF-to-Markdown API](/guides/dws-processor/tools-and-api/pdf-to-markdown-api.md)
- [PDF-to-Office API](/guides/dws-processor/tools-and-api/pdf-to-office-api.md)
- [Redaction API](/guides/dws-processor/tools-and-api/redaction-api.md)

