Quantum Nexus Discovery API

Discovery, configuration and usage-metrics endpoints.

GitHub OpenAPI

Operations 4

GET /api/v1/corpus/coverage Real-time inventory of the indexed corpus #
GET /api/v1/jurisdictions List supported jurisdictions #
GET /api/v1/usage API usage aggregations #
GET /api/v1/requests/{requestId} Read the telemetry of a single request #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/nexusquantum-legal:nexusquantum-legal-discovery-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

nexusquantum-legal-discovery-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Nexus Legal Discovery API
  version: 1.95.0
  description: 'Multi-jurisdictional legal analysis API with a multi-agent architecture and Zero Retention. ## Output language


    `language` (and the language implied by the jurisdiction) sets the language the text is written in. For `es` and `en` the delivered text is also measured: when a substantial part of it came back in the other of the two, a block headed `⚠️ LANGUAGE OF THIS REPORT` (`⚠️ IDIOMA DE ESTE INFORME` when `es` was requested) is added at the end of the text. It works the same with any engine, BYO included. - **When there is no block**: it is not a confirmation. Other languages are not measured, and neither is a text too short or too mixed to tell. - **With BYO**: how closely the output follows the request depends on your engine. - **If the output language is essential to your workflow**: check it on your side against the `analysis` string. ## The verdict travels INSIDE the text — read this before you parse a response


    Every string this API returns that a lawyer reads — `analysis`, `answer`, `report`, `draft`, `synthesisText`, and the string fields of structured results like `applicableLaw[]` — carries the citation verdict **inline**, not only in the `citationChecks` object beside it. **What you will actually see:**


    ```

    An acknowledgement does not revive a claim already barred: section 29(7) of the

    Limitation Act 1980 【✓】. See also [2019] EWHC 3556 (Comm)

    【◻ not checked — the reason is in this citation''s note】. ---

    DETERMINISTIC CITATION CHECK (against the official corpus)

    1 verified · 1 not checked. ◻ **Not checked** — they were not compared against any official corpus…

    ```


    - **Inline marker**: a `【…】` block immediately after each citation, in the response language. The glyph carries the verdict: `✓` verified · `⚠` a warning (e.g. the decision exists but a party you named does not appear in it) · `⛔` broken · `◻` not checked. - **Footer**: a `---` block at the end with the tally and, for anything not clean, the list of citations and why. **Why it is in the text and not only in the JSON.** Whoever copies an answer into an email, a brief or a .docx takes the PROSE. The `citationChecks` object does not travel with it. A verdict that only exists in a field beside the text is a verdict the reader can lose without noticing. **If you parse these strings**: markers are the only `【…】` sequences we emit, so they are safe to strip with a single regex if your pipeline needs the raw prose — but do not strip them from anything a human will read. `citationChecks` remains the machine-readable source of truth for counts and per-citation status; the markers are the same verdict, placed where it cannot get lost. **Idempotent**: annotating an already-annotated text does not duplicate markers or the footer. ## Streaming: `verifiedText` on the `done` event


    On SSE routes the client already holds the raw prose by the time the verifier finishes, so the closing `{type:"done"}` event carries `verifiedText`: the same answer with the verdict already in it. **If it is present, render it in place of the concatenated `text_delta` chunks.** It is omitted when there is nothing to annotate, in which case the deltas are already final. The REST wrappers do this for you — `/v1/consulta`, `/v1/chat` and the rest aggregate server-side and hand you the annotated text — so this only concerns you if you consume the SSE stream directly. ## Base capabilities


    - **Mode=deep**: the Node A (Claude Opus 4.7) + Node B (DeepSeek V4-Pro) chain audits adversarially. 2 credits. Returns an `audit` object with structured findings (hallucinations, false citations, omissions). - **Direct models**: calls through the providers'' own APIs (Anthropic, DeepSeek) with no proxies — lower latency, better rate limits. - **Stable Stripe-style error format**: `error.type`, `error.code`, `error.request_id`, `error.details` + backward-compat aliases. ## Errors and rate limits


    - **Branch on `error.code`.** A code you do not recognise is handled by its `error.type`.'
  contact:
    name: Nexus Legal
    email: support@nexusquantum.legal
    url: https://legal.nexusquantum.legal/developers
  license:
    name: Commercial
    url: https://nexusquantum.legal/terms
servers:
- url: https://legal.nexusquantum.legal
  description: Production
security:
- ApiKeyAuth: []
tags:
- name: Discovery
  description: Discovery, configuration and usage-metrics endpoints.
paths:
  /api/v1/corpus/coverage:
    get:
      summary: Real-time inventory of the indexed corpus
      description: 'Returns the current state of the case-law corpus: number of tables, total documents, jurisdiction inferred per table, date range and top sources with counts. AUTO-DISCOVERABLE: when a new `jurisprudencia_` table with embeddings is added to Supabase, it shows up here with no code changes. Useful for clients (dashboards, MCP, agents) to build coverage UIs without hardcoding anything. Cache: 5 min server-side + `Cache-Control` 5 min on the response. Requires an API key with any valid scope (does not consume credits).'
      operationId: getCorpusCoverage
      security:
      - ApiKeyAuth: []
      tags:
      - Discovery
      responses:
        '200':
          description: Corpus inventory.
          content:
            application/json:
              schema:
                type: object
                required:
                - generatedAt
                - cacheTtlSeconds
                - totalDocs
                - totalTables
                - tables
                properties:
                  generatedAt:
                    type: string
                    format: date-time
                  cacheTtlSeconds:
                    type: integer
                  totalDocs:
                    type: integer
                    description: Sum of docs across ALL tables.
                  totalTables:
                    type: integer
                  tables:
                    type: array
                    items:
                      type: object
                      properties:
                        table:
                          type: string
                          example: jurisprudencia_docs
                        inferredJurisdiction:
                          type:
                          - string
                          - 'null'
                          example: ES
                        totalDocs:
                          type: integer
                        oldestDoc:
                          type:
                          - string
                          - 'null'
                          format: date
                        newestDoc:
                          type:
                          - string
                          - 'null'
                          format: date
                        topSources:
                          type: array
                          items:
                            type: object
                            properties:
                              source:
                                type: string
                              count:
                                type: integer
                        sourceColumn:
                          type:
                          - string
                          - 'null'
                          description: Column used to group topSources.
        '401':
          description: Invalid API key.
  /api/v1/jurisdictions:
    get:
      summary: List supported jurisdictions
      description: Returns the full list of jurisdictions supported by the API, including the legal system of each one. No authentication required.
      operationId: listJurisdictions
      tags:
      - Discovery
      responses:
        '200':
          description: List of jurisdictions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JurisdictionsResponse'
  /api/v1/usage:
    get:
      summary: API usage aggregations
      description: 'Returns aggregated API usage metrics for the authenticated account. Required by partners that bill their own clients on individual per-sub-key consumption.


        Filters: `from`/`to` (ISO date), `granularity` (day/week/month), `api_key_id`, `endpoint`. Format: JSON (default) or CSV with `?format=csv`.'
      operationId: getUsage
      security:
      - ApiKeyAuth: []
      tags:
      - Discovery
      parameters:
      - name: from
        in: query
        schema:
          type: string
          format: date
        description: 'ISO date inclusive (default: 30d ago)'
      - name: to
        in: query
        schema:
          type: string
          format: date
        description: 'ISO date inclusive (default: today)'
      - name: granularity
        in: query
        schema:
          type: string
          enum:
          - day
          - week
          - month
          default: day
      - name: api_key_id
        in: query
        schema:
          type: string
          format: uuid
        description: Filter to a specific sub-key.
      - name: endpoint
        in: query
        schema:
          type: string
        description: Filter by route (e.g. /api/v1/analyze).
      - name: format
        in: query
        schema:
          type: string
          enum:
          - json
          - csv
          default: json
      responses:
        '200':
          description: Usage aggregations.
          content:
            application/json:
              schema:
                type: object
                properties:
                  period:
                    type: object
                    properties:
                      from:
                        type: string
                        format: date
                      to:
                        type: string
                        format: date
                      granularity:
                        type: string
                        enum:
                        - day
                        - week
                        - month
                  totals:
                    type: object
                    properties:
                      calls:
                        type: integer
                      errors:
                        type: integer
                      latency_p50_ms:
                        type: integer
                      latency_p95_ms:
                        type: integer
                      credits_consumed:
                        type: number
                        description: Credits consumed (Σ of the `consumption` ledger) in the range, over the key set resolved by ownership.
                      rate_limited:
                        type: integer
                        description: Number of 429 (rate-limited) responses in the range.
                  by_key:
                    type: array
                    description: Breakdown by sub-key.
                    items:
                      type: object
                      properties:
                        api_key_id:
                          type:
                          - string
                          - 'null'
                          format: uuid
                        key_prefix:
                          type:
                          - string
                          - 'null'
                        calls:
                          type: integer
                        errors:
                          type: integer
                        credits_consumed:
                          type: number
                          description: Credits consumed by this key in the range.
                        byo_calls:
                          type: integer
                          description: Requests served by a BYO engine (routing_policy own_*).
                        platform_calls:
                          type: integer
                          description: Requests served by the platform chain.
                        rate_limited:
                          type: integer
                          description: Number of 429 (rate-limited) responses attributed to this key.
                  by_endpoint:
                    type: array
                    items:
                      type: object
                  buckets:
                    type: array
                    items:
                      type: object
            text/csv:
              schema:
                type: string
                description: 'CSV dump with columns: period_start,api_key_id,key_prefix,endpoint,calls,errors'
  /api/v1/requests/{requestId}:
    get:
      summary: Read the telemetry of a single request
      description: 'Returns the telemetry record (`api_usage_stats`) for a `request_id`. The id is CLIENT-SUPPLIED (echo of the `X-Request-Id` header) and therefore NOT unique across tenants, so the query is ALWAYS scoped to the keys the caller owns:

        - **child**: its own `api_key_id` only.

        - **master**: the key set of its organization.

        - **solo/legacy**: the keys of the caller''s own `user_id`.


        The MOST RECENT owned row (`created_at DESC`) is returned as the main object, with `occurrences` = number of owned matches. Uniform 404 (anti-enumeration): a nonexistent `request_id` and one that «exists but is not yours» return exactly the same `NOT_FOUND`, so one tenant cannot probe another''s ids.'
      operationId: getRequest
      security:
      - ApiKeyAuth: []
      tags:
      - Discovery
      parameters:
      - name: requestId
        in: path
        required: true
        schema:
          type: string
          pattern: ^[A-Za-z0-9_-]{8,100}$
        description: Request identifier (echo of `X-Request-Id`).
      responses:
        '200':
          description: Telemetry record (most recent owned match).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestRecord'
        '401':
          description: INVALID_API_KEY.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: NOT_FOUND — no row for that `request_id`, or no row owned by the caller (indistinguishable by design).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: RATE_LIMITED — API key/organization RPM exceeded.
components:
  schemas:
    JurisdictionsResponse:
      type: object
      required:
      - jurisdictions
      - total
      - legalSystems
      - note
      properties:
        jurisdictions:
          type: array
          items:
            type: object
          description: List of supported jurisdictions with metadata.
        total:
          type: number
          description: Total number of available jurisdictions.
        legalSystems:
          type: array
          items:
            type: string
          description: Legal systems covered.
        note:
          type: string
          description: 'Where to obtain grounding coverage for the caller''s own entitled jurisdictions. This endpoint deliberately does NOT publish per-jurisdiction corpus state: that is reported by the authenticated `GET /api/v1/normativa/coverage`, scoped to the caller.'
    ErrorResponse:
      type: object
      required:
      - error
      description: Stripe-style error envelope returned by apiError() on ALL v1 routes. `error` is an OBJECT {type, code, message, request_id, details?}; the top-level `error_message`/`code` are backward-compat (deprecated v1.7). A generated client must deserialize `error` as an object, not as a string.
      properties:
        error:
          type: object
          required:
          - type
          - code
          - message
          properties:
            type:
              type: string
              example: invalid_request_error
            code:
              type: string
              example: VALIDATION_ERROR
            message:
              type: string
            request_id:
              type: string
            details:
              type: object
              description: Optional. An engine failure carries what you need in order to decide what to do next, and a `429` says whose ceiling you reached. Each field is present only when it was measured, and `details` is omitted entirely rather than sent empty.
              properties:
                retryable:
                  type: boolean
                  description: Whether retrying this exact request can succeed. Absent means not measured — do not read absence as `true`.
                refunded:
                  type: boolean
                  description: Whether the credit for this call was returned. Absent means not measured.
                reason:
                  type: string
                  description: Short machine-readable cause.
                  example: provider_timeout
                provider:
                  type: string
                  description: Which engine failed. On a BYO tenant this is the difference between checking your own key and opening a ticket with us.
                  example: Anthropic (BYO)
                error_class:
                  type: string
                scope:
                  type: string
                  enum:
                  - ip
                  - user
                  - organization
                  description: 'On a `429`: whose ceiling you reached.'
                retry_after_seconds:
                  type: integer
                  description: 'On a `429`: seconds to wait, the same value as the `Retry-After` header.'
                limit_per_minute:
                  type: integer
                  description: 'On a `429`: the per-minute ceiling you reached.'
        error_message:
          type: string
          description: Backward-compat (deprecated v1.7).
        code:
          type: string
          description: Backward-compat (deprecated v1.7).
    RequestRecord:
      type: object
      description: Telemetry of one request read from `api_usage_stats`, scoped to the caller's own keys (see `GET /api/v1/requests/{requestId}`).
      required:
      - request_id
      - endpoint
      - status_code
      - ok
      - created_at
      - occurrences
      properties:
        request_id:
          type: string
          description: Request identifier (echo of `X-Request-Id`).
        endpoint:
          type: string
          example: /api/v1/analyze
        status_code:
          type: integer
          example: 200
        ok:
          type: boolean
          description: status_code < 400.
        latency_ms:
          type:
          - integer
          - 'null'
        model:
          type:
          - string
          - 'null'
          example: DeepSeek V4-Pro+deepseek-v4-pro
          description: 'Label of the engine that ANSWERED, not a stable model identifier. It is the chain''s own label — ''DeepSeek V4-Pro'', ''Opus 4.8 · OpenRouter'' — or, when the firm brings its own engine, that engine''s model id. In mode=deep it is composed as ''<analyst>+<auditor>''. `unknown` means nobody could be named: the value is never guessed. Under partner or neutral branding it is replaced by a neutral label. Do NOT key logic on this string: which engine answers is a deployment decision and the chain falls back on its own.'
        provider_id:
          type:
          - string
          - 'null'
          description: Id of the BYO provider (llm_provider_configs.id) that served the request; null = platform chain.
        routing_policy:
          type:
          - string
          - 'null'
          enum:
          - own_only
          - own_then_platform
          - platform
          - null
          description: Effective routing policy.
        error_code:
          type:
          - string
          - 'null'
        tokens_used:
          type:
          - integer
          - 'null'
        input_chars:
          type:
          - integer
          - 'null'
        api_key_id:
          type:
          - string
          - 'null'
        key_prefix:
          type:
          - string
          - 'null'
          example: nlk_ab12
          description: Prefix of the matching key (join with `api_keys`).
        created_at:
          type: string
          format: date-time
        occurrences:
          type: integer
          description: Number of your own rows sharing this `request_id`.
        requestId:
          type: string
          description: Id of this endpoint call itself (`X-Request-Id` header).
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: nlk_...