Every API here is available over the APIs.io API and to AI agents over MCP.
openapi: 3.2.0
info:
title: Nexus Legal Rail 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: Rail
description: 'Rail passenger rights under Regulation (EU) 2021/782 in the EU and the EEA: compensation for delays, missed connections, reimbursement, re-routing and assistance, with the national exemptions read on the journey date from the European Commission''s tables. Deterministic, with every legal source returned with its text and SHA-256.'
paths:
/api/v1/rail/eu/assess:
post:
tags:
- Rail
summary: Assess EU rail passenger rights
description: 'Assesses a rail delay, cancellation or missed connection under Regulation (EU) 2021/782, for journeys from 7 June 2023 with a station in the EU, Iceland, Liechtenstein or Norway. Returns whether compensation is due (`entitled`, `not_entitled`, `undetermined` or `out_of_scope`) with a reason code: 25 % of the ticket price for a delay of 60 to 119 minutes at the final destination, 50 % for 120 or more (on the leg of a return ticket or half its price; under the operator''s arrangements for a season ticket), or reimbursement plus 75 % when a ticket vendor combined the tickets and the connection was missed. Also the rights to reimbursement or re-routing, to arrange the journey oneself after 100 minutes without options, to meals, accommodation and transport from a blocked train, each with its condition; the national exemptions in force on the journey date, read from the European Commission''s tables and returned with the text of each cell (`undetermined` where the tables do not settle it); the complaint deadline and payment periods; the defences of Article 19(10), with the burden on the railway undertaking; and the assumptions made. The class of service (urban, suburban, regional or long-distance) is a fact to give, not something it decides. Deterministic: no language model is involved, and the same facts always give the same answer. It does not decide facts it is not given, such as whether extraordinary circumstances or a third party caused the delay: those come back as defences, with the provisions that govern them. Every legal source cited comes back with its text and its SHA-256. No credits are deducted.
The request body is the set of facts, with the field names below; `null` counts as absent. Every instant is ISO 8601 with an explicit offset. Supports the optional `Idempotency-Key` header: repeating a request with the same key returns the stored response. MCP tool: `rail_eu_assess`.'
parameters:
- name: Idempotency-Key
in: header
required: false
schema:
type: string
pattern: ^[A-Za-z0-9_-]{8,200}$
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
disruption:
type: string
enum:
- delay
- cancellation
- missed_connection
description: 'What happened: `delay`, `cancellation` or `missed_connection` (a connection missed because of an earlier delay or cancellation).'
departureCountry:
type: string
enum:
- AD
- AE
- AF
- AG
- AI
- AL
- AM
- AO
- AQ
- AR
- AS
- AT
- AU
- AW
- AZ
- BA
- BB
- BD
- BE
- BF
- BG
- BH
- BI
- BJ
- BL
- BM
- BN
- BO
- BQ
- BR
- BS
- BT
- BW
- BY
- BZ
- CA
- CC
- CD
- CF
- CG
- CH
- CI
- CK
- CL
- CM
- CN
- CO
- CR
- CU
- CV
- CW
- CX
- CY
- CZ
- DE
- DJ
- DK
- DM
- DO
- DZ
- EC
- EE
- EG
- EH
- ER
- ES
- ET
- FI
- FJ
- FK
- FM
- FO
- FR
- GA
- GB
- GD
- GE
- GF
- GG
- GH
- GI
- GL
- GM
- GN
- GP
- GQ
- GR
- GS
- GT
- GU
- GW
- GY
- HK
- HM
- HN
- HR
- HT
- HU
- ID
- IE
- IL
- IM
- IN
- IO
- IQ
- IR
- IS
- IT
- JE
- JM
- JO
- JP
- KE
- KG
- KH
- KI
- KM
- KN
- KP
- KR
- KW
- KY
- KZ
- LA
- LB
- LC
- LI
- LK
- LR
- LS
- LT
- LU
- LV
- LY
- MA
- MC
- MD
- ME
- MF
- MG
- MH
- MK
- ML
- MM
- MN
- MO
- MP
- MQ
- MR
- MS
- MT
- MU
- MV
- MW
- MX
- MY
- MZ
- NA
- NC
- NE
- NF
- NG
- NI
- NL
- 'NO'
- NP
- NR
- NU
- NZ
- OM
- PA
- PE
- PF
- PG
- PH
- PK
- PL
- PM
- PN
- PR
- PS
- PT
- PW
- PY
- QA
- RE
- RO
- RS
- RU
- RW
- SA
- SB
- SC
- SD
- SE
- SG
- SH
- SI
- SK
- SL
- SM
- SN
- SO
- SR
- SS
- ST
- SV
- SX
- SY
- SZ
- TC
- TD
- TF
- TG
- TH
- TJ
- TK
- TL
- TM
- TN
- TO
- TR
- TT
- TV
- TW
- TZ
- UA
- UG
- UM
- US
- UY
- UZ
- VA
- VC
- VE
- VG
- VI
- VN
- VU
- WF
- WS
- XK
- YE
- YT
- ZA
- ZM
- ZW
description: Country of the station of departure of the journey on the ticket, as an ISO 3166-1 alpha-2 code (`XK` for Kosovo). The Regulation covers the EU and, through the EEA Agreement, Iceland, Liechtenstein and Norway; Switzerland and the United Kingdom are third countries.
arrivalCountry:
type: string
enum:
- AD
- AE
- AF
- AG
- AI
- AL
- AM
- AO
- AQ
- AR
- AS
- AT
- AU
- AW
- AZ
- BA
- BB
- BD
- BE
- BF
- BG
- BH
- BI
- BJ
- BL
- BM
- BN
- BO
- BQ
- BR
- BS
- BT
- BW
- BY
- BZ
- CA
- CC
- CD
- CF
- CG
- CH
- CI
- CK
- CL
- CM
- CN
- CO
- CR
- CU
- CV
- CW
- CX
- CY
- CZ
- DE
- DJ
- DK
- DM
- DO
- DZ
- EC
- EE
- EG
- EH
- ER
- ES
- ET
- FI
- FJ
- FK
- FM
- FO
- FR
- GA
- GB
- GD
- GE
- GF
- GG
- GH
- GI
- GL
- GM
- GN
- GP
- GQ
- GR
- GS
- GT
- GU
- GW
- GY
- HK
- HM
- HN
- HR
- HT
- HU
- ID
- IE
- IL
- IM
- IN
- IO
- IQ
- IR
- IS
- IT
- JE
- JM
- JO
- JP
- KE
- KG
- KH
- KI
- KM
- KN
- KP
- KR
- KW
- KY
- KZ
- LA
- LB
- LC
- LI
- LK
- LR
- LS
- LT
- LU
- LV
- LY
- MA
- MC
- MD
- ME
- MF
- MG
- MH
- MK
- ML
- MM
- MN
- MO
- MP
- MQ
- MR
- MS
- MT
- MU
- MV
- MW
- MX
- MY
- MZ
- NA
- NC
- NE
- NF
- NG
- NI
- NL
- 'NO'
- NP
- NR
- NU
- NZ
- OM
- PA
- PE
- PF
- PG
- PH
- PK
- PL
- PM
- PN
- PR
- PS
- PT
- PW
- PY
- QA
- RE
- RO
- RS
- RU
- RW
- SA
- SB
- SC
- SD
- SE
- SG
- SH
- SI
- SK
- SL
- SM
- SN
- SO
- SR
- SS
- ST
- SV
- SX
- SY
- SZ
- TC
- TD
- TF
- TG
- TH
- TJ
- TK
- TL
- TM
- TN
- TO
- TR
- TT
- TV
- TW
- TZ
- UA
- UG
- UM
- US
- UY
- UZ
- VA
- VC
- VE
- VG
- VI
- VN
- VU
- WF
- WS
- XK
- YE
- YT
- ZA
- ZM
- ZW
description: Country of the station of final destination on the ticket, as an ISO 3166-1 alpha-2 code (`XK` for Kosovo). The Regulation covers the EU and, through the EEA Agreement, Iceland, Liechtenstein and Norway; Switzerland and the United Kingdom are third countries.
serviceType:
type: string
enum:
- urban
- suburban
- regional
- long_distance
description: 'Class of the delayed or cancelled service (or of the one that caused the missed connection), as classified under Directive 2012/34/EU (Article 3(6) and (7)): national exemptions depend on it.'
scheduledDeparture:
type: string
description: Scheduled departure of the journey. Its date selects which national exemptions apply; journeys from 7 June 2023 are assessed, ISO 8601 with an explicit offset (`Z` or `±hh:mm`).
scheduledArrival:
type: string
description: Scheduled arrival at the final destination, per the published timetable, ISO 8601 with an explicit offset (`Z` or `±hh:mm`).
actualArrival:
type: string
description: 'Actual arrival at the final destination: when the train doors opened on the platform (Article 3(18)). With a cancellation, the arrival of the continuation or re-routing. Needed for compensation unless the ticket was reimbursed, ISO 8601 with an explicit offset (`Z` or `±hh:mm`).'
ticketPrice:
type: object
properties:
amount:
type: number
minimum: 0
description: Full price actually paid for the ticket (the whole through-ticket in a missed connection).
currency:
type: string
pattern: ^[A-Z]{3}$
description: ISO 4217 code, for example `EUR`.
required:
- amount
- currency
additionalProperties: false
description: Price paid for the ticket. Compensation is a percentage of it.
ticketType:
type: string
enum:
- single
- return
- season
description: '`single`, `return` (outward and return on one contract) or `season` (travel pass or season ticket: the amount follows the railway undertaking''s compensation arrangements).'
legPrice:
description: 'Return ticket: the price shown on the ticket for the delayed leg. Absent = half the price.'
type: number
minimum: 0
ticketing:
description: 'Missed connection only: `through_ticket` (one ticket, or tickets bought in a single transaction from a railway undertaking), `vendor_combined` (bought in a single transaction from a ticket vendor or tour operator that combined them on its own initiative) or `separate_contracts` (the passenger was told before purchase that the tickets were separate contracts).'
type: string
enum:
- through_ticket
- vendor_combined
- separate_contracts
refundChosen:
description: 'The passenger chose reimbursement of the ticket (Article 18(1)(a)): no compensation for the delay.'
type: boolean
delayKnownBeforePurchase:
description: The passenger was informed of the delay before buying the ticket.
type: boolean
affectedServiceDeparture:
type: string
description: Scheduled departure of the delayed or cancelled service, or of the missed connection, if it is not the first service. Starts the 100 minutes of Article 18(3), ISO 8601 with an explicit offset (`Z` or `±hh:mm`).
reroutingOptionsAt:
type: string
description: When the re-routing options were communicated to the passenger, ISO 8601 with an explicit offset (`Z` or `±hh:mm`).
serviceDistanceKm:
description: Length of the delayed service in km. Sweden exempts domestic urban, suburban and regional services under 150 km.
type: number
exclusiveMinimum: 0
significantPartOutsideEea:
description: 'International service to or from a third country: a significant part of it, with at least one scheduled stop, runs outside the EEA (Article 2(6)(b)). Absent = not known.'
type: boolean
historicOrTouristService:
description: The service is operated strictly for historical or touristic use (Article 2(2)).
type: boolean
required:
- disruption
- departureCountry
- arrivalCountry
- serviceType
- scheduledDeparture
- scheduledArrival
- ticketPrice
- ticketType
additionalProperties: false
responses:
'200':
description: 'The assessment: `rulesVersion`, `regime`, `status`, `reason`, `delayMinutes` (at the final destination), `compensation` (`percent` 25, 50 or 75, `basis` with `kind` and `amount`, `amount`, `currency`, `payer`, `minimum`), `rights[]` (`id`, `provision`, `due` true/false/null, `condition`, `exemption`, `sources`), `exemptions[]` (each national exemption consulted: `state`, `layer`, `cells[]` with the Commission table, its `status` and the cell `text`, `provisions` with `exempt`, `not_exempt` or `uncertain`, `note`), `scope` (`departure` and `arrival` with `zone`, `service`, `serviceType`); `deadlines[]` also carry `period` and `from`, `deadlines[]` (`id`, `due`, `source`), `defenses[]` (`id`, `sources`, `burdenOfProof`), `assumptions[]`, `sources[]` (ids), `trace[]`, plus `sourceDetails[]` (`id`, `citation`, `identifier`, `url`, `text`, `sha256` of every source cited anywhere in the answer), `sourcesCheckedOn`, `creditsCharged` (credits deducted for this call) and `requestId`.'
content:
application/json:
schema:
type: object
required:
- rulesVersion
- regime
- status
- reason
- sources
- sourceDetails
- creditsCharged
- requestId
properties:
rulesVersion:
type: string
regime:
type:
- string
- 'null'
status:
type: string
reason:
type: string
deadlines:
type: array
items:
type: object
defenses:
type: array
items:
type: object
assumptions:
type: array
items:
type: string
sources:
type: array
items:
type: string
trace:
type: array
items:
type: string
sourceDetails:
type: array
items:
type: object
properties:
id:
type: string
citation:
type: string
identifier:
type: string
url:
type: string
text:
type: string
sha256:
type: string
sourcesCheckedOn:
type: string
format: date
creditsCharged:
type: integer
requestId:
type: string
'400':
description: 'MISSING_FACT (a fact these facts need; `details.field` names it) | INVALID_DATETIME (ISO 8601 with an explicit offset, on a day that exists) | UNKNOWN_AIRPORT | INCONSISTENT_FACTS | DATE_BEFORE_COVERAGE (`details.coveredFrom`) | UNKNOWN_FIELD (unknown fields are rejected, not ignored) | INVALID_FIELD (wrong type, or a value outside the enumeration: `details.issues[].allowed`) | INVALID_JSON. `details.issues` lists every problem found; `code` and `details.field` are the first.'
'401':
description: Invalid or missing API key.
'402':
description: INSUFFICIENT_CREDITS — balance > 0 required, unless the account has a passenger-claims retainer; the assessment does not deduct credits.
content:
application/json:
schema:
$ref: '#/components/schemas/InsufficientCreditsError'
'403':
description: INSUFFICIENT_SCOPE (one of `analyze`, `mcp` or `*` is required) | IP not in the key's allowlist.
'409':
description: IDEMPOTENCY_CONFLICT (the same `Idempotency-Key` with a different body) | IDEMPOTENCY_IN_PROGRESS (the first request with that key has not finished).
'429':
description: RATE_LIMITED.
operationId: postApiV1RailEuAssess
x-operation-id-source: derived
components:
schemas:
InsufficientCreditsError:
type: object
required:
- error
- balance
- required
properties:
error:
type: string
example: INSUFFICIENT_CREDITS
balance:
type: number
description: User's current credit balance.
required:
type: number
description: Credits required for this operation.
securitySchemes:
ApiKeyAuth:
type: http
scheme: bearer
bearerFormat: nlk_...