Getting Started

The CAILegal API is a stable, versioned, API-key-authenticated surface for building jurisdiction-aware legal AI into your own products — legal Q&A, document analysis, and compliance checks today, with corporate, litigation, audit, and contract-drafting tools on the roadmap.

Every API response carries the same “not legal advice” disclaimer shown in the CAILegal product — this is a research and drafting aid, not a substitute for a qualified lawyer. See Policies.

1. Get an API key

Sign in to the Developer Console and create a key. The raw key (prefixed cai_live_) is shown exactly once — store it securely.

2. Make your first request

Every request is authenticated with an Authorization: Bearer cai_live_...header. Here's a call to /v1/chat/completions:

curl https://cailegal-backend-production-7edb.up.railway.app/v1/chat/completions \
  -H "Authorization: Bearer cai_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "What is the notice period for termination under UAE labour law?",
    "jurisdiction": "AE"
  }'

3. Or install an SDK

Thin, typed client libraries wrap every endpoint below. Source lives in this repo's sdks/ folder.

Python

pip install cailegal

Node / TypeScript

npm install cailegal

What you can build today

Base URL & auto-generated references

All endpoints are relative to https://cailegal-backend-production-7edb.up.railway.app. In addition to this narrative documentation, the backend exposes FastAPI's auto-generated interactive explorer and machine-readable OpenAPI spec: