MayaClerk API Docs
MayaClerk API

API Reference

Use the MayaClerk API to search legal opinions and pull full opinion text from your own product.

The API searches the MayaClerk corpus: 10.6 million court opinions and 105 million indexed passages. You send JSON. MayaClerk returns JSON with ranked passages, case metadata, and links back to the opinion source.

Base URL

https://maya.scabievector.com

All endpoints use the /v1 prefix.

What you use it for

Use this API when your product needs legal search, legal AI grounding, contract review context, compliance research, or an internal research interface. The search endpoint returns passages from court opinions with citation metadata. The opinion endpoint returns full opinion text for a known opinion_id. MayaClerk is designed to integrate cleanly with modern AI applications, including Claude- and GPT-powered legal research assistants.

What it is not

This is not a bulk data dump and not permission to rebuild the MayaClerk corpus. You may use returned results in your app and as inference-time context. You may not use the API to train models, resell the data as a dataset, or reconstruct the corpus. See the API Terms of Use.

Authentication

Send your API key with every request. Use either header format:

API key header
X-API-Key: mk_live_xxxxxxxxxxxxxxxx
Bearer token
Authorization: Bearer mk_live_xxxxxxxxxxxxxxxx

Create keys in your developer dashboard. A new key is shown only once. Copy it when you create it. If you lose it, revoke it and create a new one.

Requests with no key, an invalid key, or a revoked key return 401.

Pricing & Billing

MayaClerk uses prepaid billing. There are no automatic charges.

Free monthly calls

Each developer account gets 100 free API calls each calendar month. The allowance resets on the first day of the month. Unused free calls do not roll over.

Wallet billing

After the free monthly calls are used, paid calls are deducted from your wallet balance.

CallPrice
POST /v1/search$0.20 per call
GET /v1/opinion/{id}$0.20 per call
GET /v1/pricing, GET /v1/healthFree

Minimum wallet top-up is $25. Wallet funds do not expire. Unused balances may be refundable under the refund policy.

If your free calls are used up and your wallet balance is too low, the API returns 402. The request is not served and you are not charged.

Current rates are available at GET /v1/pricing.

Quickstart

Replace the example key with your own key.

curl

curl -X POST https://maya.scabievector.com/v1/search \
  -H "Content-Type: application/json" \
  -H "X-API-Key: mk_live_xxxxxxxxxxxxxxxx" \
  -d '{"query": "eight corners rule extrinsic evidence duty to defend", "top_k": 20}'

Python

import requests

response = requests.post(
    "https://maya.scabievector.com/v1/search",
    headers={"X-API-Key": "mk_live_xxxxxxxxxxxxxxxx"},
    json={
        "query": "eight corners rule extrinsic evidence duty to defend",
        "top_k": 20,
    },
)

print(response.json())

A successful search returns 200, a results array, a total_results count, and timing information. Metered responses also include billing headers.

Building an application? See the Integration Guide.

Integration Guide

MayaClerk works with any application that can make HTTPS requests — including AI-powered assistants and research products built on Claude, GPT, or any other model.

Steps

  1. Create an API key in your developer dashboard.
  2. Call POST /v1/search with a legal research query. You get back ranked passages with case and citation metadata.
  3. When you need the full text of an opinion, call GET /v1/opinion/{id} with the opinion_id from a search result.

That is the entire surface. How your application uses the results — display, analysis, model context, or anything else permitted by the API Terms of Use — is up to you.

Example: search integration

One request in, ranked results out. Python:

import requests

response = requests.post(
    "https://maya.scabievector.com/v1/search",
    headers={"X-API-Key": "mk_live_xxxxxxxxxxxxxxxx"},  # load from environment
    json={
        "query": "eight corners rule extrinsic evidence duty to defend",
        "top_k": 10,
        "jurisdiction": "S",
        "court_ids": ["tex"],
    },
)
data = response.json()

for r in data["results"]:
    print(f'{r["case_name"]} — {r["court_name"]} ({r["date_filed"]})')
    print(f'  Cited by {r["citation_count"]} opinions')
    print(f'  {r["chunk_text"][:200]}...')
    print(f'  Full text: GET /v1/opinion/{r["opinion_id"]}')

Node.js:

const response = await fetch("https://maya.scabievector.com/v1/search", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-API-Key": process.env.MAYACLERK_KEY,
  },
  body: JSON.stringify({
    query: "eight corners rule extrinsic evidence duty to defend",
    top_k: 10,
  }),
});
const data = await response.json();

for (const r of data.results) {
  console.log(`${r.case_name} — ${r.court_name} (${r.date_filed})`);
  console.log(`  Cited by ${r.citation_count} opinions`);
  console.log(`  ${r.chunk_text.slice(0, 200)}...`);
}

Each result includes the passage text, full case metadata, and an opinion_id you can pass to GET /v1/opinion/{id} when your application needs the complete opinion. Questions about advanced integration patterns: api@mayaclerk.com.

Guidelines

  • Keep your API key server-side. Never expose credentials in browser code, mobile applications, prompts, screenshots, or public repositories.
  • Use specific legal queries — doctrine, issue, jurisdiction, or key phrase. Vague queries return broader results.
  • Preserve court and filing-date metadata when presenting results, and cite material legal claims to their sources.
  • Your first 100 calls each month are free, so you can test your integration before funding a wallet.

Accuracy and governance

The MayaClerk API provides legal retrieval results, opinion text, and citation metadata. An external integration does not include MayaClerk's proprietary governance engine, production system prompts, validation procedures, or accuracy safeguards. The integrating developer is responsible for output validation and human review in their own application.

Permitted use

You may use returned results in your application and as inference-time context, subject to the API Terms of Use. The API may not be used to reconstruct the corpus, resell the data as a dataset, or train models unless separately authorized.

GET /v1/opinion/{id}

Return full text and metadata for one opinion. This endpoint costs $0.20 per call after the free monthly allowance.

Path parameter

ParameterTypeDescription
idintegerRequired. The opinion_id from a search result.

Example

curl https://maya.scabievector.com/v1/opinion/118143 \
  -H "X-API-Key: mk_live_xxxxxxxxxxxxxxxx"

Response fields

FieldTypeMeaning
opinion_idintegerOpinion identifier.
case_namestringCase caption.
courtstringIssuing court.
date_fileddateFiling date.
citationstringReporter citation, where available.
full_textstringFull opinion text in the best available format.
clusterobjectCase-level metadata, where available.
GET /v1/pricing

Return the current rate card, free monthly allowance, and published limits. This endpoint is free and does not require authentication.

Example response

{
  "model": "prepaid_wallet",
  "free_monthly_calls": 100,
  "rates": {
    "search": {
      "per_call_usd": 0.20,
      "description": "Semantic search across 10.6M opinions"
    },
    "opinion": {
      "per_call_usd": 0.20,
      "description": "Full opinion text + metadata"
    }
  },
  "free_allowance": "First 100 calls each month are free.",
  "billing": "Beyond the free allowance, calls meter against your prepaid wallet. An exhausted balance returns HTTP 402 — you are never charged automatically.",
  "limits": {
    "opinion_fetch_daily_cap": 200
  },
  "signup": "https://mayaclerk.com/developer"
}
GET /v1/health

Basic health check. This endpoint is free and does not require authentication.

Response

{ "status": "ok" }

Limits

Daily opinion fetch cap

GET /v1/opinion/{id} has a daily cap of 200 unique opinions per account. Fetching the same opinion again on the same day does not count again. If you hit the cap, the API returns 429 and the request is not charged.

Caching

You may cache API responses for up to 24 hours for performance and cost control. Do not use caching to build a permanent copy of the corpus. See the API Terms of Use.

Error Codes

StatusMeaning
200Success.
400Bad request. Example: missing or invalid query.
401Missing, invalid, or revoked API key.
402Free calls are used up and wallet balance is too low. Request not served and not charged.
404Resource not found. Example: unknown opinion_id.
429Daily unique-opinion fetch cap reached. Request not charged.
500Server error. Safe to retry.

Example error

{ "detail": "Free allowance exhausted and wallet balance insufficient. You are never charged automatically." }

Response Format

All responses are JSON. Successful responses return the documented body. Errors return a JSON object with a detail field.

Billing headers

Metered calls include billing context in the response headers:

HeaderDescription
X-MayaClerk-Billingfree if the call used your monthly allowance. wallet if it used wallet balance.
X-MayaClerk-Free-RemainingFree calls remaining this month.
X-MayaClerk-Balance-USDWallet balance after the call.

Versioning

The current stable API version is v1. Breaking changes will use a new version prefix. Additive changes, such as new optional fields or endpoints, may be added to v1. Your client should ignore unknown fields.

Questions: api@mayaclerk.com