Documents
GAAI document analysis — clause-level risk findings with citations.
Internally wraps: DocumentAnalyzer.analyze
POST
/v1/documents/analyzeGAAI document analysis with legal risk findings + citations
Submit a document (as plain text or base64-encoded PDF/DOCX) and receive a clause-level risk analysis with an overall risk rating and supporting citations.
Required scope:
documents~2 credit(s)/callSDK: documents.analyze(...)- Provide either
document_textordocument_base64— not both. analysis_typeis one offull,risk,compliance,summary.
Request body
{
"document_text": "This Non-Disclosure Agreement is entered into by and between ...",
"jurisdiction": "US",
"analysis_type": "full"
}Response body
{
"request_id": "req_a92e...",
"tenant_id": "apikey:usr_123",
"jurisdiction": "US",
"document_title": "Uploaded Document",
"summary": "A mutual NDA with a 3-year confidentiality term and a narrow carve-out for public information.",
"clauses": [
{
"clause_number": 1,
"clause_text": "Confidential Information shall not include information that ...",
"risk_level": "low",
"findings": "Standard exclusion language; consistent with market practice.",
"citation_ids": []
}
],
"overall_risk": "low",
"citations": [],
"citation_validation_passed": true,
"warnings": [],
"disclaimer": "This response is generated by an AI legal assistant for informational purposes only and does not constitute legal advice. Consult a qualified legal professional before relying on it."
}curl -X POST https://cailegal-backend-production-7edb.up.railway.app/v1/documents/analyze \
-H "Authorization: Bearer cai_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"document_text": "This Non-Disclosure Agreement is entered into by and between ...",
"jurisdiction": "US",
"analysis_type": "full"
}'