WritersLogic Verifiable AI Agent Hub Prove Causality API

The Prove Causality API from WritersLogic Verifiable AI Agent Hub — 1 operation(s) for prove causality.

GitHub OpenAPI

Operations 1

POST /api/v1/prove-causality Causal Claim Referee #

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/writerslogic-com:writerslogic-com-prove-causality-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. See our Privacy Policy and Terms.

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

OpenAPI Specification

writerslogic-com-prove-causality-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: WritersLogic Verifiable AI Agent Hub Prove Causality API
  version: 2.0.0
  description: Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.
  contact:
    name: WritersLogic
    url: https://writerslogic.com/agents
    email: agents@writerslogic.com
servers:
- url: https://agents.writerslogic.com
tags:
- name: Prove Causality
paths:
  /api/v1/prove-causality:
    post:
      operationId: causalReferee
      summary: Causal Claim Referee
      description: 'Referees a causal claim against an observational table (JSON rows, CSV text, or a published contingency table with counts) and leads with a verdict, confidence, whether the claim holds, the crude and adjusted effects with bootstrap intervals, and a concrete next step. Underneath: crude and stratified effects, Mantel-Haenszel pooling, Simpson''s-paradox detection, d-separation and backdoor/front-door checks with minimal adjustment sets, g-formula standardization with positivity checks, exact or seeded Monte Carlo permutation tests, and a PC-algorithm check of the DAG against the data. Verdict by code rules; with a caller-supplied DAG no model is called and the result is reproducible. Conclusions hold only under the DAG and no-unmeasured-confounding assumptions, which are listed in the output; this is statistical analysis, not a substitute for a randomized trial.


        Price: 1.50 USDC on Base (x402).'
      x-x402-price-usdc: '1.50'
      x-x402-amount: '1500000'
      x-payment-info:
        protocols:
        - x402
        price:
          mode: fixed
          currency: USD
          amount: '1.50'
      x-audience: research
      x-sample-url: https://agents.writerslogic.com/api/v1/samples/causalReferee
      security:
      - x402: []
      - apiKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
              - treatment
              - outcome
              - covariates
              - claim
              properties:
                data:
                  type: array
                  minItems: 2
                  maxItems: 20000
                  items:
                    type: object
                  description: Observational table as an array of row objects (at most 20000 rows). Cells are string, number, boolean or null; rows missing a used variable are dropped. Provide this or csv.
                csv:
                  type: string
                  minLength: 10
                  maxLength: 3000000
                  description: 'Alternative to data: CSV text with a header line (comma, semicolon or tab separated; quoted fields allowed; at most 20000 data rows). Numeric cells become numbers.'
                countColumn:
                  type: string
                  minLength: 1
                  maxLength: 100
                  description: Name of a column holding how many times each row repeats, so a published contingency table can be sent as a few aggregate rows (counts must be non-negative integers; the expanded table is capped at the row limit).
                treatment:
                  type: string
                  minLength: 1
                  maxLength: 100
                  description: Column with exactly two distinct values.
                outcome:
                  type: string
                  minLength: 1
                  maxLength: 100
                  description: Binary column (risk difference, risk ratio, odds ratio) or numeric column (mean difference).
                covariates:
                  type: array
                  maxItems: 12
                  items:
                    type: string
                    minLength: 1
                    maxLength: 100
                  description: Candidate adjustment variables (at most 12). Numeric ones with more than `bins` distinct values are cut at deterministic quantile edges; others must have at most 20 levels.
                claim:
                  type: string
                  minLength: 3
                  maxLength: 2000
                  description: The causal claim being refereed, in plain language.
                dag:
                  type: object
                  additionalProperties: false
                  required:
                  - edges
                  description: 'Your causal DAG (formal input: no LLM is called to build the graph or, by default, the report). Omit to have one proposed by two independent model samples, which is then an assumption.'
                  properties:
                    edges:
                      type: array
                      maxItems: 200
                      items:
                        type: object
                        additionalProperties: false
                        required:
                        - from
                        - to
                        properties:
                          from:
                            type: string
                            maxLength: 100
                          to:
                            type: string
                            maxLength: 100
                      description: Directed edges from cause to effect between the treatment, outcome, covariates and unobserved nodes.
                    unobserved:
                      type: array
                      maxItems: 10
                      items:
                        type: string
                        minLength: 1
                        maxLength: 100
                      description: Latent variables that appear in edges (for example an unmeasured confounder).
                treatedValue:
                  anyOf:
                  - type: string
                  - type: number
                  - type: boolean
                  description: Treatment value that counts as treated; required unless the values are numeric or boolean (then the larger is treated).
                successValue:
                  anyOf:
                  - type: string
                  - type: number
                  - type: boolean
                  description: Outcome value that counts as success for a binary outcome; same default rule.
                outcomeType:
                  type: string
                  enum:
                  - binary
                  - continuous
                  description: Force the outcome type; inferred from the number of distinct values otherwise.
                claimDirection:
                  type: string
                  enum:
                  - positive
                  - negative
                  - nonzero
                  description: Direction of the claimed effect of treated vs control; default nonzero.
                bins:
                  type: integer
                  minimum: 2
                  maximum: 10
                  description: Quantile bins for numeric covariates, default 4.
                alpha:
                  type: number
                  minimum: 0.001
                  maximum: 0.2
                  description: Significance level for the permutation test and the (1-alpha) bootstrap interval, default 0.05.
                seed:
                  type: integer
                  minimum: 0
                  maximum: 4294967295
                  description: Seed for bootstrap and Monte Carlo; default derived from the input hash.
                bootstrapReps:
                  type: integer
                  minimum: 100
                  maximum: 2000
                permutationSamples:
                  type: integer
                  minimum: 1000
                  maximum: 200000
                  description: Used only when the exact enumeration would exceed 1000000 label assignments.
                llmReport:
                  type: boolean
                  description: 'Ask a model to write the executive report in prose (numbers verified in code, template fallback). Default false: the report is a deterministic template over the computed results.'
                descriptions:
                  type: object
                  description: Optional one-line description per variable, used only to propose the DAG.
            example:
              data:
              - treatment: A
                stone_size: small
                success: 1
                n: 81
              - treatment: A
                stone_size: small
                success: 0
                n: 6
              - treatment: A
                stone_size: large
                success: 1
                n: 192
              - treatment: A
                stone_size: large
                success: 0
                n: 71
              - treatment: B
                stone_size: small
                success: 1
                n: 234
              - treatment: B
                stone_size: small
                success: 0
                n: 36
              - treatment: B
                stone_size: large
                success: 1
                n: 55
              - treatment: B
                stone_size: large
                success: 0
                n: 25
              countColumn: n
              treatment: treatment
              outcome: success
              covariates:
              - stone_size
              treatedValue: B
              claim: Treatment B causes a higher recovery rate than treatment A.
              claimDirection: positive
              dag:
                edges:
                - from: stone_size
                  to: treatment
                - from: stone_size
                  to: success
                - from: treatment
                  to: success
      responses:
        '200':
          description: Paid result with provenance
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      headline:
                        type: object
                        description: 'Verdict-first digest computed in code: verdict, confidence, claimSupported (true, false or null when undecidable), crude and adjusted effect with bootstrap intervals, dagSource, a one-sentence summary and a concrete nextStep.'
                      deterministic:
                        type: boolean
                        description: 'True only for the formal-IR path (caller DAG): no model output can influence the verdict. False when the DAG came from a model or from the outage fallback.'
                      status:
                        type: string
                        enum:
                        - OK
                        - BUDGET_EXCEEDED
                      verdict:
                        type: string
                        enum:
                        - SUPPORTED_UNDER_ASSUMPTIONS
                        - CONFOUNDED
                        - SIMPSONS_REVERSAL
                        - NOT_IDENTIFIABLE
                        - INSUFFICIENT_DATA
                        - NOT_SUPPORTED
                      verdictRule:
                        type: string
                      confidence:
                        type: string
                        enum:
                        - low
                        - medium
                        - high
                      reasons:
                        type: array
                        items:
                          type: string
                      claim:
                        type: string
                      claimEvaluation:
                        type: object
                      data:
                        type: object
                      dag:
                        type: object
                        description: The graph used, its source (caller, llm_proposed, default_all_confounders) and whether it is an assumption.
                      identification:
                        type: object
                        description: Minimal backdoor adjustment sets, front-door sets, and variables not to adjust for (mediators, colliders, post-treatment).
                      effects:
                        type: object
                        description: Crude and adjusted risk difference / risk ratio / odds ratio or mean difference with seeded bootstrap intervals.
                      tests:
                        type: object
                        description: Exact or Monte Carlo permutation p-values (within strata for the adjusted test), Fisher exact, Mantel-Haenszel test.
                      stratification:
                        type: object
                      simpson:
                        type: object
                      dagCheck:
                        type: object
                        description: PC-algorithm skeleton and orientations from the data, and the conflicts with the assumed DAG.
                      caveats:
                        type: array
                        items:
                          type: string
                      assumptions:
                        type: array
                        items:
                          type: string
                      report:
                        type: object
                        description: Executive report; source is llm only if every number in it appears in the computed results.
                      translation:
                        anyOf:
                        - type: object
                        - type: 'null'
                      audit:
                        type: object
                  _provenance:
                    type: object
                    description: C2PA-aligned manifest and W3C VC 2.0 (eddsa-jcs-2022) issued by the hub DID; verify at POST /api/v1/verify-provenance
                required:
                - data
                - _provenance
        '400':
          description: Invalid request (no payment consumed)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
        '401':
          description: Invalid X-API-KEY
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
        '402':
          description: Payment required or invalid
          content:
            application/json:
              schema:
                type: object
                description: x402 v2 PaymentRequired (also base64 in the PAYMENT-REQUIRED header)
                properties:
                  x402Version:
                    type: integer
                  error:
                    type: string
                  code:
                    type: string
                  resource:
                    type: object
                  accepts:
                    type: array
                    items:
                      type: object
                  extensions:
                    type: object
        '502':
          description: Upstream failure; the payment is released or not settled
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
      tags:
      - Prove Causality
components:
  securitySchemes:
    x402:
      type: apiKey
      in: header
      name: PAYMENT-SIGNATURE
      description: x402 v2 payment payload (base64) sent after a 402 challenge
    apiKey:
      type: apiKey
      in: header
      name: X-API-KEY