cookbook · Extractor · Contract review
Pull the key terms out of a contract
Legal and procurement teams read every agreement for the same handful of terms: who the parties are, when it starts, how long it runs, what it costs, how either side can get out, and which law applies. This recipe asks for those terms over a services agreement and gets them back typed, with clauses quoted word for word so a reviewer can find them. The agreement has no non-compete and says nothing about renewal, so both come back null.
Request
POST /v1/extract, documented in the Extractor reference.
curl https://meragpt.com/v1/extract \
-H "Authorization: Bearer $MERAGPT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "extractor-1",
"text": "MASTER SERVICES AGREEMENT (excerpt)\n\nThis Agreement is made on 3 February 2026 between Larkspur Analytics Inc., a Delaware corporation (\"Provider\"), and Ostrander Foods LLC (\"Client\").\n\n2. Term. This Agreement starts on 1 March 2026 and continues for twenty-four (24) months unless terminated earlier under Section 9.\n\n4. Fees. Client shall pay Provider a fixed fee of USD 18,000 per calendar month, invoiced monthly in arrears and payable within forty-five (45) days of invoice.\n\n7. Limitation of Liability. Except for breaches of Section 8 (Confidentiality), neither party'\''s total liability under this Agreement will exceed the fees paid by Client in the twelve (12) months before the claim.\n\n9. Termination. Either party may terminate this Agreement for convenience on sixty (60) days'\'' written notice to the other party. Either party may terminate immediately if the other party materially breaches this Agreement and fails to cure the breach within thirty (30) days of notice.\n\n12. Governing Law. This Agreement is governed by the laws of the State of New York.",
"schema": {
"type": "object",
"properties": {
"provider": {
"type": "string"
},
"client": {
"type": "string"
},
"effective_date": {
"type": "string",
"format": "date",
"description": "When the services start."
},
"term_months": {
"type": "integer"
},
"monthly_fee_usd": {
"type": "number"
},
"payment_days": {
"type": "integer",
"description": "Days after the invoice that payment is due."
},
"termination_for_convenience": {
"type": "string",
"description": "The clause letting a party end the agreement without cause, quoted."
},
"liability_cap": {
"type": "string",
"description": "The limitation of liability clause, quoted."
},
"governing_law": {
"type": "string"
},
"non_compete": {
"type": "string",
"description": "Any clause restricting either party from competing, quoted."
},
"auto_renewal": {
"type": "boolean",
"description": "Does the agreement renew automatically?"
}
}
}
}'What came back
The real output from running this recipe, unedited.
{
"provider": "Larkspur Analytics Inc.",
"client": "Ostrander Foods LLC",
"effective_date": "2026-03-01",
"term_months": 24,
"monthly_fee_usd": 18000,
"payment_days": 45,
"termination_for_convenience": "Either party may terminate this Agreement for convenience on sixty (60) days' written notice to the other party.",
"liability_cap": "Except for breaches of Section 8 (Confidentiality), neither party's total liability under this Agreement will exceed the fees paid by Client in the twelve (12) months before the claim.",
"governing_law": "This Agreement is governed by the laws of the State of New York.",
"non_compete": null,
"auto_renewal": null
}Python
import os, requests
API = "https://meragpt.com/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['MERAGPT_API_KEY']}"}
contract = open("msa.txt").read()
schema = {
"type": "object",
"properties": {
"provider": {
"type": "string"
},
"client": {
"type": "string"
},
"effective_date": {
"type": "string",
"format": "date",
"description": "When the services start."
},
"term_months": {
"type": "integer"
},
"monthly_fee_usd": {
"type": "number"
},
"payment_days": {
"type": "integer",
"description": "Days after the invoice that payment is due."
},
"termination_for_convenience": {
"type": "string",
"description": "The clause letting a party end the agreement without cause, quoted."
},
"liability_cap": {
"type": "string",
"description": "The limitation of liability clause, quoted."
},
"governing_law": {
"type": "string"
},
"non_compete": {
"type": "string",
"description": "Any clause restricting either party from competing, quoted."
},
"auto_renewal": {
"type": "boolean",
"description": "Does the agreement renew automatically?"
}
}
}
r = requests.post(f"{API}/extract", headers=HEADERS, json={"model": "extractor-1", "text": contract, "schema": schema}).json()
terms = r["data"]
for clause in ("termination_for_convenience", "liability_cap"):
if terms[clause] and terms[clause] not in contract:
print("check by hand:", clause) # a quote should be found verbatim
missing = [k for k, v in terms.items() if v is None]
print("not in this agreement:", missing)
TypeScript
const API = "https://meragpt.com/v1";
const headers = {
Authorization: `Bearer ${process.env.MERAGPT_API_KEY}`,
"Content-Type": "application/json",
};
import { readFileSync } from "node:fs";
const contract = readFileSync("msa.txt", "utf8");
const schema = {
"type": "object",
"properties": {
"provider": {
"type": "string"
},
"client": {
"type": "string"
},
"effective_date": {
"type": "string",
"format": "date",
"description": "When the services start."
},
"term_months": {
"type": "integer"
},
"monthly_fee_usd": {
"type": "number"
},
"payment_days": {
"type": "integer",
"description": "Days after the invoice that payment is due."
},
"termination_for_convenience": {
"type": "string",
"description": "The clause letting a party end the agreement without cause, quoted."
},
"liability_cap": {
"type": "string",
"description": "The limitation of liability clause, quoted."
},
"governing_law": {
"type": "string"
},
"non_compete": {
"type": "string",
"description": "Any clause restricting either party from competing, quoted."
},
"auto_renewal": {
"type": "boolean",
"description": "Does the agreement renew automatically?"
}
}
};
const r = await fetch(`${API}/extract`, {
method: "POST",
headers,
body: JSON.stringify({ model: "extractor-1", text: contract, schema }),
}).then((res) => res.json());
const missing = Object.entries(r.data).filter(([, v]) => v === null).map(([k]) => k);
console.log("not in this agreement:", missing);
When to trust it
Every field was right, and the two nulls are correct: there is no non-compete and no renewal language. Quoted clauses are copied from the text, so search for them to confirm. Treat this as a first pass that tells a reviewer what to read, not as legal advice; for long agreements, the response's windows field tells you how many passes the model made.
Try it without code in the playground, or see more Extractor recipes: read an invoice into your ap system, turn a support email into a ticket, get action items out of meeting notes, turn a receipt photo into an expense entry, extract memories from a conversation.