Analysis | API Reference Guide | CourtMesh
    Skip to main content

    AI analysis

    Run the model against one document on demand, or consolidate an entire matter's documents into one analysis. Not available on the Free tier.

    Analysis endpoints
    Single document analysis and consolidated multi document analysis.
    POST

    /cases/:id/analyze

    100 credits, +20 with allowRemoteFetch, a stored analysis priced as a readAI

    Generate AI analysis for a case that does not have one. The work runs in the background and the call returns HTTP 202 immediately. Poll GET /cases/:id/analysis after 30 to 60 seconds to collect the result.

    Not available on the Free tier. A Free Developer key gets HTTP 403 with code: "API_TIER_NOT_ALLOWED" and an upgradeUrl before any work starts and before any credit is charged. Pay As You Go, Scale and Enterprise all have full access.

    Request body

    FieldTypeRequiredNotes
    forcebooleanNoRe-run the model even when an analysis is already stored. Default false, in which case a stored analysis is returned instead with alreadyExists set to true.
    allowRemoteFetchbooleanNoDefault false. Only on POST /cases/:id/analyze. When true and the source document is not already in stored data, permits fetching it from an approved court or official source, for a surcharge of 20 credits on top of the 100 credit base price, charged only when a remote fetch actually happened. Only approved court and official sources are fetched; a call that would require any other source is refused with REMOTE_FETCH_NOT_ALLOWED regardless of tier or balance.
    curl -X POST https://research.courtmesh.ai/api/v1/prod/cases/507f1f77bcf86cd799439011/analyze \
      -H "X-API-Key: cm-YOUR_KEY_HERE" \
      -H "Content-Type: application/json" \
      -d '{"force": false}'

    A 202 means accepted, not finished. If the background job later fails, the charge made at admission is reversed, so a failed analysis does not stay billed. Cases with no readable text and no stored document are rejected up front rather than accepted and then failed.

    POST

    /cases/:id/analyze-consolidated

    400 credits, 1 on a cache hitAI

    One analysis across every document sharing this case number, rather than one document at a time. Unlike /analyze, this call is synchronous: it runs the model and answers when it is done, which can take well over a minute. Give your client a generous timeout and call it from a worker.

    Not available on the Free tier. Same refusal as /analyze: HTTP 403, code: "API_TIER_NOT_ALLOWED", an upgradeUrl, and no charge.

    Request body

    FieldTypeRequiredNotes
    forcebooleanNoRe-run the model even when an analysis is already stored. Default false, in which case a stored analysis is returned instead with alreadyExists set to true.
    curl -X POST https://research.courtmesh.ai/api/v1/prod/cases/507f1f77bcf86cd799439011/analyze-consolidated \
      -H "X-API-Key: cm-YOUR_KEY_HERE" \
      -H "Content-Type: application/json" \
      -d '{"force": false}'