canonical: https://jentic.com/apis/azure.com/form-recognizer-client

# Microsoft Azure Form Recognizer Client

Jentic publishes the only available OpenAPI specification for the Azure Cognitive Services Form Recognizer client (v2.0 preview), keeping it validated and agent-ready. The API extracts structured key-value pairs and tables from forms, layouts, and prebuilt receipts. It supports training custom models on your own labelled forms, listing and deleting those models, analysing forms with a custom model, analysing the layout of any document, and analysing receipts with the prebuilt receipt model. Analysis calls are asynchronous and return a result id you poll until the operation completes.

## For AI agents

Train custom form models, analyse forms, layouts, and receipts asynchronously, and retrieve the structured extraction results.

## Scope

Does not transcribe speech, classify or describe arbitrary images, translate text, or run general-purpose OCR - use only to train and run Form Recognizer custom models, layout analysis, and the prebuilt receipt model.

## Capabilities

- Train a custom Form Recognizer model from labelled forms in a SAS-accessible blob folder
- List and delete custom Form Recognizer models
- Analyse a form with a custom model and poll for the structured key-value result
- Analyse the layout (text, tables, selection marks) of an arbitrary document
- Extract receipt fields (merchant, total, line items) with the prebuilt receipt model
- Retrieve the structured analysis result for any submitted form, layout, or receipt operation

## Use cases

### Extract Structured Data from Custom Forms

Operations teams need to convert recurring vendor forms into structured data without writing per-template parsers. Train a custom model with POST /custom/models pointing at a folder of labelled examples, then call POST /custom/models/{modelId}/analyze on each new form. The service returns a result id; GET /custom/models/{modelId}/analyzeResults/{resultId} delivers the extracted key-value pairs once the run finishes.

Example prompt: Train a custom model from blob folder https://contoso.blob.core.windows.net/forms/, then analyse the form at https://contoso.blob.core.windows.net/inbox/inv-2025-01.pdf and return the extracted key-value pairs

### Analyse Document Layout for Downstream Pipelines

Document automation pipelines first run layout analysis to capture text, tables, and selection marks before applying domain-specific extraction. POST /layout/analyze submits the document and returns a result id; GET /layout/analyzeResults/{resultId} returns the structured layout once analysis completes, ready to feed the next stage of the pipeline.

Example prompt: Submit contract.pdf to layout analyse, poll the result until succeeded, and return the table cells found on page 2

### Receipt Extraction for Expense Workflows

Expense and accounts-payable workflows ingest scanned receipts and need merchant, date, total, tax, and line items. POST /prebuilt/receipt/analyze runs the prebuilt receipt model and returns a result id; GET /prebuilt/receipt/analyzeResults/{resultId} returns the structured fields once analysis completes, ready to be posted to an expense or accounting system.

Example prompt: Analyse the receipt at https://contoso.blob.core.windows.net/receipts/r-001.jpg with the prebuilt receipt model and return merchantName, total, and line items

### Agent-Driven Document Pipelines

An AI agent processing inbound documents can train a custom model, route incoming files to the right analyser, and return structured fields to an accounting or CRM workflow through Jentic. Intent search returns the train, analyse, and result endpoints with their schemas; the Ocp-Apim-Subscription-Key is held in your Jentic One instance so the agent only ever holds a short-lived scoped token at call time.

Example prompt: Search Jentic for 'analyse a form with Form Recognizer', execute AnalyzeWithCustomModel for the new file, then call GetAnalyzeFormResult on the returned result id until status is succeeded

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /custom/models | Train a custom Form Recognizer model |
| GET | /custom/models | List custom models |
| POST | /custom/models/{modelId}/analyze | Analyse a form with a custom model |
| GET | /custom/models/{modelId}/analyzeResults/{resultId} | Get analyse form result |
| POST | /layout/analyze | Analyse the layout of a document |
| GET | /layout/analyzeResults/{resultId} | Get analyse layout result |
| POST | /prebuilt/receipt/analyze | Analyse a receipt with the prebuilt model |
| GET | /prebuilt/receipt/analyzeResults/{resultId} | Get analyse receipt result |

## Key resources

- **Custom Models** — Train, list, get, delete, and analyse with custom models built from labelled forms
- **Layout Analysis** — Submit a document for layout analysis and retrieve the structured result
- **Prebuilt Receipt** — Submit a receipt for prebuilt receipt analysis and retrieve the structured result

## Why Jentic

- **Setup:** Wiring Form Recognizer by hand means holding the Ocp-Apim-Subscription-Key header, targeting the correct regional Cognitive Services endpoint (for example https://westus2.api.cognitive.microsoft.com), and driving the async analyse pattern where each POST returns a result id you poll until it succeeds. Through Jentic you install once, import the Form Recognizer Client from the API Directory, store the subscription key once, and your agent calls it.
- **Permission scoping:** Form Recognizer puts the model id in the URL path (/custom/models/{modelId}/analyze and /custom/models/{modelId}/analyzeResults/{resultId}), so a rule can pin your agent to one custom model for analysis. You choose the operations it may call, so a destructive one like deleting a custom model is not included unless you add it, and you can keep the agent to training, analyse, and result reads.
- **Credential handling:** Your Ocp-Apim-Subscription-Key is stored once, encrypted, by your own Jentic One instance and injected at execution time. The raw subscription key never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'analyse a form with Form Recognizer' or 'extract receipt fields', and Jentic returns the matching custom-model, layout, or prebuilt-receipt operation with its input schema so the agent calls the right endpoint without learning the v2.0 path layout.

## Related APIs

- **Amazon Textract** — AWS document analysis service that extracts text, tables, and forms data from documents.
- **Google Cloud Document AI** — Google Cloud document understanding service with prebuilt and custom processors.
- **Azure Cognitive Services Management** — Provisions and configures the Cognitive Services resource that hosts Form Recognizer.
- **Google Cloud Vision API** — General-purpose OCR and image analysis service from Google Cloud.

## FAQ

### Why is there no official OpenAPI spec for Form Recognizer Client?

Microsoft Azure does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Form Recognizer Client via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Form Recognizer API use?

The API uses an API key in the `Ocp-Apim-Subscription-Key` request header (the apim_key scheme). Through Jentic, that key is stored encrypted in your Jentic One instance and injected on each call so the agent never holds the raw subscription key.

### Can I train a custom Form Recognizer model with this API?

Yes. Call POST /custom/models with a body that points at a SAS-accessible blob folder containing your labelled forms. The service returns a model id; once training completes, call POST /custom/models/{modelId}/analyze to extract data from new documents of the same template.

### How do I get the result of an analyse call?

Analyse calls are asynchronous. The POST /custom/models/{modelId}/analyze, /layout/analyze, and /prebuilt/receipt/analyze endpoints return a result id (in the response headers). Poll the matching GET .../analyzeResults/{resultId} endpoint until the response status is 'succeeded' to retrieve the extracted fields.

### What are the rate limits for the Form Recognizer API?

Form Recognizer applies per-resource quotas tied to the Cognitive Services pricing tier (free or standard). On HTTP 429 back off using the Retry-After header. Training jobs are heavier than analyse calls, so issue them serially per resource.

### How do I run a Form Recognizer pipeline through Jentic?

Run pip install jentic, then search Jentic with 'analyse a form with Form Recognizer'. Load AnalyzeWithCustomModel, supply the modelId and document URL, and execute. Then call GetAnalyzeFormResult with the returned result id until status is succeeded. The Ocp-Apim-Subscription-Key is sourced from the vault on every call.

### Can I limit what my agent is allowed to do with the Azure Form Recognizer API?

Yes. Because you run Jentic One yourself, your own rules decide which Form Recognizer operations the agent may call and which credentials it may use. Since the model id sits in the URL path for POST /custom/models/{modelId}/analyze and GET /custom/models/{modelId}/analyzeResults/{resultId}, you can pin the agent to a single custom model, and you can keep it to training, analysing, and reading results while leaving out a destructive operation like deleting a custom model. Only the operations you explicitly grant are available to the agent.
