Skip to main content
This page takes one question, “who has to mark content that an AI system made?”, from nothing to a passage you can cite. The first call finds the source. The second reads it and finds the passage. The third opens that passage again, as a reader of your report would.

Get a key

Create an API key at https://app.getclean.ai and put it in your environment. The SDKs and the commands on this page read it from there.
Replace YOUR_API_KEY with your key.

Install an SDK

The cURL commands on this page need no install. For Python or TypeScript, install the SDK.

Find the source

Send the question to search in 4 wordings and 3 languages, and ask for official and primary sources first.
The results come in rank order. This response is cut to the first result and to the fields that say what it is.
201 Created
The first result is the regulation itself. Its publisher is a state body, it is a primary source, and 2 other sites have the same text.

Find the passage in the source

Fetch the address of that result, and send your question with the fetch as a highlight. With max_characters set to 0, the response has the outline of the source and the place of the passage, and no page text.
In the cURL command, replace SOURCE_URL with the url of the first result. The response is a record, the stored copy of the source. This one is cut to the highlight and to one row of the outline, and the words of the passage are shortened.
201 Created
The question has no words in common with the article that bears on it, so a model chose the passage, and basis says judged. text has the regulation’s own words, never the model’s. The highlight names its place: the section “Article 50”, and one block in it.

Open the passage again

The record’s id and the block’s id are a citation. Anyone who has them can read the passage from the stored copy, at no charge.
In the cURL command, replace CONTENTS_ID with the id of the record and BLOCK_ID with the block_id of the highlight. The response has the whole block, as the source has it. A sentence of your report that rests on this passage can name the record and the block, and a reviewer can open it with this call.

Check what the 3 calls cost

The search is charged one search unit, one unit for each datasource it ran on, and 2 model steps: one for the ranking and one for the choice of datasources. The fetch is charged one unit and one model step, because a model judged the highlight. The read of the block costs nothing. Every charged response has cost, with the units and the amount. For the whole run, from a question to a checked report, see From a question to a checked report.