Plus plan

Extract With Your Schema

Pull out exactly the fields you describe from any document
POST
/v1/ai/extraction/custom

About this tool

You describe the fields you want, and the tool reads your document and fills them in. You describe them with a schema, which is a list of field names and what kind of value each one holds. The answer is checked against your schema, and each value comes with a quote from the document as proof. An AI reads it, so check the values.
For example, you want the customer name and the delivery date from many different order forms, always in the same layout.

How to use it

  1. Choose this tool.
  2. Add your document or documents with Upload or drag and drop, or paste the text.
  3. Write the schema, the list of fields you want.
  4. Choose whether the result must follow your schema strictly.
  5. Press Generate, then copy or download the result.

What you get back

You get the values for your fields as organised data, with proof from the document. You can copy or download it.
TEST IT LIVE

Try Extract With Your Schema in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
AI
Plan
Plus
Method
POST
Endpoint
/v1/ai/extraction/custom
Tool ID
ai.extraction.custom
Authentication
API key
Accepts
Text and settings
Background jobs
Yes
Usage group
Ai
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/ai/extraction/custom" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'on_unsupported=error' \
  -F 'quality=standard' \
  -F 'json_schema=xx'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.ai.extraction.custom({
    "on_unsupported": "error",
    "quality": "standard",
    "json_schema": "xx"
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->ai()->extraction()->custom([
    'on_unsupported' => 'error',
    'quality' => 'standard',
    'json_schema' => 'xx',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Structured extraction into the JSON Schema you send: the result is validated against it with Ajv and reported with confidence and verified evidence quotes. Readiness: unbenchmarked (see GET /v1/ai/capabilities/extraction.custom).

Classification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction (Poppler), Tesseract OCR for pages without text, page rendering for vision fallback, evidence verification against page text, arithmetic / date / currency / contact validation, JSON Schema validation (Ajv, isolated worker with a timeout).

Extract With Your Schema works from text and settings, so no file is needed. The required inputs are json_schema.

Not on the Free plan: Extract With Your Schema is available on the Plus plan and above. Free accounts can upgrade any time to use it. Each run uses credits from your monthly allowance.

Send a POST request to /v1/ai/extraction/custom with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.