Chunk and de-duplicate records into corpus rows
Optionally redacts each record first, then splits it into chunks of at most chunk_chars characters (preferring paragraph, line then word boundaries) with optional overlap, and drops chunks whose normalised text was already seen. Offsets are character offsets into the (possibly redacted) record text. Each record is metered, as corpus.build.
/v1/corpus/buildAuthorizationBearer token (JWT) · headerrequiredBearer API key issued for your account. Send Authorization: Bearer <key>.
application/jsonrecordsCorpusRecord[]requiredShow propertiesHide properties
CorpusRecordidstringOptional; defaults to rec-<n>.
textstringrequiredchunk_charsintegeroverlapintegerAt most half of chunk_chars.
dedupbooleanredactbooleanRedact each record before chunking.
Corpus rows and statistics
rowsobject[]requiredShow propertiesHide properties
objectidstringrequiredchunk_indexintegerrequiredstartintegerrequiredCharacter offset.
endintegerrequiredhashstringrequiredHash of the normalised text; equal hashes are duplicates.
textstringrequiredstatsobjectrequiredShow propertiesHide properties
records_inintegerrequiredchunks_totalintegerrequiredrows_outintegerrequiredduplicates_droppedintegerrequiredredactedbooleanrequiredfindings_totalintegerrequiredBad request
stringMissing or invalid bearer token
stringBilling or plan entitlement blocked the request
stringUpstream service (arXiv, YouTube, web page) failed
stringThe backing service is not configured or is busy
string