Contract Intelligence API
Analyze, score, and generate contracts programmatically. Simple authentication, credit-based billing.
Quick Start
# Analyze a contract curl -X POST https://docgic.com/api/v1/contracts/analyze \ -H "X-Api-Key: dg_live_abc123" \ -H "Content-Type: application/json" \ -d '{"contract_text": "This Non-Disclosure Agreement..."}'
{ "risk_score": 67, "confidence": 0.89, "confidence_interval": [58, 76], "risk_flags": [ { "clause": "non_compete", "severity": "high", "message": "Unusually broad non-compete scope" } ], "missing_clauses": ["governing_law"], "recommendations": [ "Add governing law clause — 94% include this" ] }
Authentication
1. Sign up
Create a free account at docgic.com/register
2. Generate API key
Go to Dashboard → Developer → Generate Key
3. Start calling
Pass your key in the X-Api-Key header
X-Api-Key: dg_live_xxxxx
Credit-based billing
Each API call deducts credits from your plan. The free tier includes 50 credits/month. If you run out, requests return 402 Payment Required. Upgrade your plan or purchase additional credits from the dashboard.
Core Endpoints
Three endpoints cover the full analysis pipeline.
/api/v1/contracts/analyze5 creditsFull analysis: extracts clauses, computes features, returns risk score, flags, comparables, and actionable recommendations.
Request Body
{
"contract_text": "This Non-Disclosure Agreement...",
"type": "nda",
"jurisdiction": "US-CA",
"industry": "tech",
"include_comparables": true
}| Field | Type | Description |
|---|---|---|
contract_text | string (required) | Full contract text. Minimum 100 characters. |
type | string (optional) | Contract type hint: nda, service_agreement, employment, lease, etc. Auto-detected if omitted. |
jurisdiction | string (optional) | Jurisdiction code (e.g. US-CA, US-NY, GB). Improves benchmark accuracy. |
industry | string (optional) | Industry hint: tech, healthcare, finance, real_estate, etc. |
include_comparables | boolean (optional) | Include similar contracts in response. Default: true. |
Response
{
"risk_score": 67,
"confidence": 0.89,
"confidence_interval": [58, 76],
"risk_flags": [
{ "clause": "non_compete", "severity": "high",
"message": "Unusually broad non-compete scope" }
],
"missing_clauses": ["governing_law", "force_majeure"],
"recommendations": [
"Add governing law clause — 94% include this"
],
"benchmark": { ... },
"clauses": {
"has_non_compete": true,
"has_liability_cap": false,
"has_governing_law": false,
"has_indemnity": true
},
"detected": {
"contract_type": "nda",
"jurisdiction": "US-CA",
"word_count": 2847,
"parties": ["Acme Corp", "Jane Doe"]
},
"comparables": {
"results": [...],
"dataset_size": 10056,
"dispute_rate_percent": 12.3,
"insight": "This NDA has higher risk than 72% ..."
}
}| Field | Type | Description |
|---|---|---|
risk_score | number | Overall risk score from 0 (safe) to 100 (high risk). |
confidence | number | Model confidence from 0 to 1. Higher means more training data for this contract type. |
confidence_interval | [number, number] | 95% confidence interval for the risk score, e.g. [58, 76]. |
risk_flags | array | List of flagged issues. Each has clause (string), severity (high/medium/low), and message (string). |
missing_clauses | string[] | Standard clauses not found in this contract (e.g. governing_law, force_majeure). |
recommendations | string[] | Plain-English suggestions to reduce risk. |
clauses | object | Boolean map of detected clause types (has_non_compete, has_liability_cap, etc.). |
detected | object | Auto-detected metadata: contract_type, jurisdiction, industry, parties, word_count. |
comparables | object | null | Similar contracts from the dataset with dispute rates and insights. Null if include_comparables is false. |
/api/v1/contracts/score2 creditsCore scoring: returns risk score, confidence interval, risk flags, missing clauses, recommendations, and benchmark data.
Request Body
{
"contract_text": "This Service Agreement...",
"type": "service_agreement",
"jurisdiction": "US-NY",
"industry": "tech"
}| Field | Type | Description |
|---|---|---|
contract_text | string (required) | Full contract text. Minimum 100 characters. |
type | string (optional) | Contract type hint. Auto-detected if omitted. |
jurisdiction | string (optional) | Jurisdiction code (e.g. US-NY). Improves benchmark accuracy. |
industry | string (optional) | Industry hint for better benchmarking. |
Response
{
"risk_score": 42,
"confidence": 0.91,
"confidence_interval": [34, 50],
"risk_flags": [
{ "clause": "liability_cap", "severity": "high",
"message": "Caps monetary exposure" }
],
"missing_clauses": ["liability_cap", "force_majeure"],
"recommendations": [
"Add liability cap — 87% of similar contracts include one"
],
"benchmark": { ... },
"detected": {
"contract_type": "service_agreement",
"jurisdiction": "US-NY",
"word_count": 4521,
"parties": ["Acme Corp", "John Smith"]
}
}| Field | Type | Description |
|---|---|---|
risk_score | number | Overall risk score from 0 (safe) to 100 (high risk). |
confidence | number | Model confidence from 0 to 1. |
confidence_interval | [number, number] | 95% confidence interval for the risk score. |
risk_flags | array | Flagged issues with clause, severity (high/medium/low), and message. |
missing_clauses | string[] | Standard clauses not found in the contract. |
recommendations | string[] | Actionable suggestions to reduce risk. |
detected | object | Auto-detected contract_type, jurisdiction, word_count, and parties. |
/api/v1/contracts/comparables3 creditsFind similar contracts from the dataset. Returns matching contracts with similarity scores, outcomes, and dispute rates.
Request Body
{
"contract_text": "This Employment Agreement...",
"type": "employment",
"top_k": 5
}| Field | Type | Description |
|---|---|---|
contract_text | string (required) | Full contract text. Minimum 100 characters. |
type | string (optional) | Contract type hint for better matching. |
top_k | number (optional) | Number of similar contracts to return. Range: 1-10. Default: 5. |
Response
{
"comparables": [
{
"similarity": 0.87,
"type": "employment",
"outcome": "disputed",
"dispute_type": "wrongful_termination"
}
],
"dataset_size": 10056,
"dispute_rate_percent": 12.3,
"verified_dispute_rate_percent": 8.1,
"insight": "Employment contracts with no non-compete have 15% lower dispute rate"
}| Field | Type | Description |
|---|---|---|
comparables | array | List of similar contracts with similarity score (0-1), type, outcome (disputed/successful), and dispute_type. |
dataset_size | number | Total number of contracts in the benchmark dataset. |
dispute_rate_percent | number | Percentage of similar contracts that were disputed. |
verified_dispute_rate_percent | number | Percentage with court-verified dispute outcomes. |
insight | string | Plain-English summary comparing your contract to the dataset. |
Additional Endpoints
These endpoints support the full contract workflow.
/contracts/chatAsk questions about a contract in plain English. Returns answers with section references.
/contracts/compareCompare two versions of a contract. Returns a risk-annotated diff with change analysis.
/contracts/templatesList available contract templates. Returns template metadata, types, and supported jurisdictions.
Rate Limits & Pricing
Starter
Free
50 credits/month
10 requests/minute
Professional
$29.99/mo
500 credits/month
60 requests/minute
Business
$99.99/mo
2,000 credits/month
120 requests/minute
Enterprise
Custom
Custom volume
Dedicated throughput
SLA guarantee
Built for Enterprise Scale
CLM Integration
Seamlessly integrate with your existing contract lifecycle management tools and workflows.
Volume Processing
Process thousands of contracts simultaneously with dedicated throughput and priority queues.
Custom Risk Models
Train custom risk models tailored to your industry, jurisdiction, and internal policies.
Enterprise-Grade Security
Security Features
- End-to-end encryption for all documents in transit and at rest
- Zero data retention — documents are purged after processing
- Your data is never used for AI training
- Comprehensive audit logging for all API activity
- SOC 2 Type II certification on our roadmap
Compliance
- GDPR-compliant data processing and storage
- Data residency options for EU and US regions
- Configurable data retention policies
- Business Associate Agreement (BAA) available
Need more than 2,000 credits?
Get custom pricing, dedicated SLA, and priority support tailored to your organization's needs.

