{"openapi":"3.1.0","info":{"title":"TLG Claim Check API","version":"3.10.561"},"paths":{"/v1/usage":{"get":{"summary":"Get Usage","description":"R2 (accounting surface): on-demand, $0, non-quota-consuming, org-scoped\nusage snapshot — the numbers the R1 headers can't serve (dashboards,\npre-flight \"do I have quota before I batch 1,000 claims?\", low-balance\nalerting, billing reconciliation). Writes NO api_charges row → charges $0 and\nconsumes no quota. Org-scoped by the session token — there is no parameter to\nread another org's usage, so no cross-org leak is possible.","operationId":"get_usage_v1_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/auth/session":{"post":{"summary":"Create Session","description":"Create a Claim API session via RSA/EC signature verification.\n\nUses the same authentication as the Enterprise API: API key + RSA/EC\nrequest signature. On success, returns a bearer token for subsequent\ncalls.","operationId":"create_session_v1_auth_session_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/claim-checks":{"post":{"summary":"Submit Claim Check","description":"Submit a claim check.\n\nCache-first contract:\n  • Cache hit (and ``no_cache`` not set) → 200 with the cached verdict\n    embedded; ``result.created_at`` carries the original verdict timestamp\n    and ``result.cached: true`` flags the replay.\n  • Cache miss → 202 with ``job_id`` + ``poll_url``; client polls\n    GET /v1/claim-checks/{job_id} for the eventual verdict.\n\nOptional ``Idempotency-Key`` header (UUID v7): same key + same body\nreplays the original response verbatim with ``X-Idempotent-Replayed: true``;\nsame key + different body returns 409.","operationId":"submit_claim_check_v1_claim_checks_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"get":{"summary":"List Claim Checks","description":"List the auth'd org's claim-check submissions.\n\nRecovery + audit path per `docs/project_list_jobs_endpoint.md`.\nCursor-based pagination using the `id` UUID v7 PK (the id column was\nUUID-ified by migration 0026 `uuid_everywhere`; v7 high bits encode\nthe insertion timestamp so cursor pagination is naturally\ntime-ordered). NOT the `job_id` text column which is\n`job-<hex>` from `secrets.token_hex` and is NOT time-ordered.\nOrg-scoped via session; explicit `WHERE org_id` belt-and-braces on\ntop of RLS.\n\nQuery params:\n  - cursor: UUID v7 string from a prior page's `next_cursor` (omit on first page).\n  - limit: page size, 1..200, default 50.\n  - status: queued | processing | complete | failed.\n  - created_after: ISO-8601 (default: 7 days ago).\n  - created_before: ISO-8601 (default: now).\n  - drug_name: case-insensitive exact match.\n\nFree per the design (recovery path for already-charged work). The\nper-endpoint pricing plumbing (v3.10.127) seeded `claim_check.list`\n@ 0 micros; if operator flips a non-zero rate,\n`record_endpoint_call_if_priced` picks it up without a code change.\nThe helper short-circuits at rate=0 so no `$0` ledger row is written\nin the default case (D3 of the v3.10.128 polish bug).","operationId":"list_claim_checks_v1_claim_checks_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"created_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created After"}},{"name":"created_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created Before"}},{"name":"drug_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Drug Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/claim-checks/{job_id}":{"get":{"summary":"Poll Claim Check","description":"Poll an async claim check result.","operationId":"poll_claim_check_v1_claim_checks__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/reference-checks":{"post":{"summary":"Submit Reference Check","description":"Submit a reference check.\n\nCache-first contract (mirrors /v1/claim-checks):\n  • Cache hit (and ``no_cache`` not set) → 200 with the cached verdict,\n    ``result.cached: true``, and ``result.created_at`` carrying the\n    original verdict timestamp.\n  • Cache miss → 202 with ``job_id`` + ``poll_url``. Reference checks\n    don't need a GPU but EPMC tail latency (P99 30s+) can outlast\n    an HTTP request, so we still go async on miss.\n\nOptional ``no_cache`` body field forces a fresh lookup on miss-path.\nOptional ``Idempotency-Key`` header (UUID v7) — same behavior as\n/v1/claim-checks.","operationId":"submit_reference_check_v1_reference_checks_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"get":{"summary":"List Reference Checks","description":"List the auth'd org's reference-check submissions.\n\nSame shape + filters + pagination as `GET /v1/claim-checks`. Cursor\nis the `id` UUID v7 PK string of the last item on the prior page.\nDifferent per-item response shape (reference_title_preview +\nauthors_preview + year + reference_status instead of\nclaim_text_preview + verdict + total_score).","operationId":"list_reference_checks_v1_reference_checks_get","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"created_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created After"}},{"name":"created_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created Before"}},{"name":"drug_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Drug Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/reference-checks/{job_id}":{"get":{"summary":"Poll Reference Check","description":"Poll an async reference check result.","operationId":"poll_reference_check_v1_reference_checks__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/evidencehub/docs/attribution":{"get":{"summary":"Evidencehub Attribution Docs","description":"Authenticated attribution & methodology reference page.\n\nRequires a bearer token (same one customers mint at POST\n/v1/auth/session for the rest of the EvidenceHub API). Returns the\nHTML content of `static_docs/attribution.html` with\nContent-Type: text/html.\n\nPer Kevin's 2026-06-06 directive, this page sits BEHIND auth so\nunauthenticated scrapers can't read methodology details. The file\nis stored OUTSIDE /app/UI/ specifically to prevent the static\nserver from serving it.","operationId":"evidencehub_attribution_docs_evidencehub_docs_attribution_get","responses":{"200":{"description":"Successful Response"}}}},"/trial/status":{"get":{"summary":"Trial Status","description":"Public open/closed flag for the try-it page's first paint, plus the\nsign-in URL the closed notice offers (per-env `app_base_url`). No\nenumeration surface: the flag is global, not per-visitor.","operationId":"trial_status_trial_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/trial/request":{"post":{"summary":"Request Trial","description":"Mail a 6-digit entry code for a free trial: a new trial for a new\naddress, the same trial for a returning one. The reply is identical\nwhatever happens, and every send and refusal goes through the email\nsend guard (email_send_guard.py): at most 3 emails to an address that\nhas never entered a code, 5 a day to one that has, nothing to a domain\nthat cannot receive mail.","operationId":"request_trial_trial_request_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/auth/trial-session":{"post":{"summary":"Create Trial Session","description":"Exchange an address + the 6-digit code mailed to it for a bearer\nsession bound to the trial's OWN org (v3.10.416; Kevin 2026-09-20: \"I want\nto have the user enter a code. a click of a link is to easy to bypass\" --\na mail scanner that opens links would have registered as the person, and\nburned the single-use link). The code is checked by the one primitive\n(auth.check_verification_code, purpose `trial`: five tries, constant-time\ncompare, single use). EVERY failure answers the same 401. The session\nexpires at min(now + idle, trial end) and slides on activity\n(api_claim_auth.validate_session).","operationId":"create_trial_session_v1_auth_trial_session_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/trial/try":{"get":{"summary":"Trial Try Page","description":"The scripted trial wizard (work order step 3): fixed questions,\ncanned explanations from the published API docs, literal JSON\nrequest/response display — no generative model in the loop. Public\nby design (it is the landing surface); the page exchanges the URL\ntoken for a session header on first load and strips it from\nhistory. Strict referrer policy + noindex per the token-in-URL\nhygiene section.","operationId":"trial_try_page_trial_try_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/trial/allowances":{"get":{"summary":"Trial Allowances","description":"Per-token allowance snapshot for the wizard's returning-session\nstate. Trial sessions only — the org-level GET /v1/usage would show\nthe shared org's POOLED counters, which is the wrong surface for a\ntrial user.","operationId":"trial_allowances_trial_allowances_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/trial/feedback":{"get":{"summary":"Trial Feedback Page","description":"The page the end-of-trial email's rating links open. Public by design;\nit does nothing without a valid feedback token. Plans and contact links are\nfilled from settings (escaped) so the page needs no extra call.","operationId":"trial_feedback_page_trial_feedback_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Submit Trial Feedback","description":"Record end-of-trial ratings (1-5 per measure) and an optional comment for\nthe trial the feedback token belongs to. Upserts one row per trial; a later\nsubmission fills or replaces the measures it carries and keeps the rest.\nRefusals never reveal whether a token exists.","operationId":"submit_trial_feedback_trial_feedback_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/auth/entry-session":{"post":{"summary":"Create Entry Session","description":"Exchange a single-use entry link (minted by the signed-in app route)\nfor a claim-API session bound to the user's organisation.","operationId":"create_entry_session_v1_auth_entry_session_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Create Entry Session V1 Auth Entry Session Post"}}}}}}},"/trial/chat":{"get":{"summary":"Trial Chat Page","description":"The chat page. Public like the trial page (it is a landing surface); every check and every helper call\nbehind it needs a trial session. Same headers as /trial/try: no referrer, no store, no index. Switched off\n(v3.10.554), it sends the visitor to the trial page: a relative \"try\", so the public prefix is kept.","operationId":"trial_chat_page_trial_chat_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/trial/chat/config":{"get":{"summary":"Trial Chat Config","operationId":"trial_chat_config_trial_chat_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/trial/chat/helper":{"post":{"summary":"Trial Chat Helper","operationId":"trial_chat_helper_trial_chat_helper_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}