> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rail402.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Liveness and operational snapshot

> Answers 200 whenever the process is up, whatever its state; the Docker `HEALTHCHECK` uses it. The
body is the snapshot the background poll rebuilds every 15 seconds, so answering never waits on the
network or the database. `state` is `degraded` while any warning is `critical`. Never rate-limited.




## OpenAPI

````yaml /api-reference/openapi.yaml get /health
openapi: 3.1.0
info:
  title: Rail402
  version: 0.0.0
  summary: x402 facilitator and Bazaar discovery layer for Stellar.
  description: >
    The Rail402 HTTP service. `/supported`, `/verify` and `/settle` follow the
    x402 version 2 facilitator

    interface; `/discovery/*` serves the Bazaar catalog and search.


    Every endpoint except `/health`, `/ready` and `/metrics` is rate-limited per
    client address. A limited

    request gets HTTP 429 with a `Retry-After` header and the code
    `rate_limited`.
  license:
    name: Apache-2.0
    identifier: Apache-2.0
servers:
  - url: https://testnet.rail402.dev
    description: Hosted testnet facilitator (stellar:testnet only, no API key)
security: []
tags:
  - name: Facilitator
    description: x402 facilitator interface.
  - name: Discovery
    description: Bazaar catalog and natural-language search.
  - name: Operations
    description: Health, readiness, metrics and usage.
paths:
  /health:
    get:
      tags:
        - Operations
      summary: Liveness and operational snapshot
      description: >
        Answers 200 whenever the process is up, whatever its state; the Docker
        `HEALTHCHECK` uses it. The

        body is the snapshot the background poll rebuilds every 15 seconds, so
        answering never waits on the

        network or the database. `state` is `degraded` while any warning is
        `critical`. Never rate-limited.
      operationId: getHealth
      responses:
        '200':
          description: The process is up.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Health'
              example:
                status: ok
                version: 0.4.1
                state: healthy
                checkedAt: '2026-09-30T12:00:00.000Z'
                warnings: []
                networks:
                  stellar:testnet:
                    rpc:
                      ok: true
                      latestLedger: 4941750
                      ledgerAgeSeconds: 3
                      transportErrors1h: 0
                    sponsor:
                      address: GBHEGW3KWOY2OFH767EDALFGCUTBOEVBDQMCKU4APMDLQNBW5QV3W3KO
                      balanceStroops: '99875000000'
                      committed1hStroops: '1200000'
                      wasted1hStroops: '0'
                    channels:
                      total: 8
                      inUse: 0
                      leaseWaitP95Ms: 4.8
                      leaseTimeouts1h: 0
                    settlements:
                      last1h:
                        succeeded: 12
                        failed: 0
                        expired: 0
                        pending: 0
                      unfinished: 0
                      unresolvable: 0
                      repeats1h: 1
                    sequenceConflicts1h: 0
                    contracts:
                      USDC:
                        id: >-
                          CBIELTK6YBZJU5UP2WWQEUCYKLPU6AUNZ2BQ4WWFEIE3USCIHMXQDAMA
                        instanceTtlLedgers: 2245736
                catalog:
                  listings:
                    pending: 0
                    published: 14
                    quarantined: 1
                  outboxPending: 0
                  outcomes1h:
                    settle:
                      success: 3
                    origin_check:
                      success: 3
                search:
                  indexRevision: 42
                  indexAgeSeconds: 4
                  lastBuild: ok
                  embeddingFailures1h: 0
                  p50Ms: 3.1
                  p95Ms: 9.4
components:
  schemas:
    Health:
      type: object
      required:
        - status
        - version
        - state
        - checkedAt
        - warnings
        - networks
      properties:
        status:
          type: string
          const: ok
        version:
          type: string
          description: The `RAIL402_VERSION` the image was built with, `dev` by default.
        state:
          type: string
          enum:
            - starting
            - healthy
            - degraded
          description: >-
            `starting` until the first poll finished; `degraded` while any
            warning is `critical`.
        checkedAt:
          type:
            - string
            - 'null'
          format: date-time
        warnings:
          type: array
          items:
            type: object
            required:
              - code
              - severity
              - message
            properties:
              code:
                type: string
                enum:
                  - rpc_unhealthy
                  - ledger_stale
                  - sponsor_below_floor
                  - settlement_ledger_unreadable
                  - settlements_unresolvable
                  - contract_missing
                  - contract_archived
                  - contract_ttl_critical
                  - contract_ttl_low
                  - contract_ttl_unchecked
                  - catalog_unreadable
                  - search_index_failed
                  - search_index_degraded
                  - upto_authority_missing
                  - upto_authority_funded
                  - upto_authority_holds_tokens
                  - upto_contract_restore_required
                  - upto_ttl_keeper_failed
              severity:
                type: string
                enum:
                  - critical
                  - warning
              message:
                type: string
                minLength: 1
              network:
                type: string
              contract:
                type: string
                description: The watched contract's alias.
        networks:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/NetworkHealth'
        catalog:
          type: object
          description: Present when the Bazaar is enabled.
          required:
            - listings
            - outboxPending
            - outcomes1h
          properties:
            listings:
              type:
                - object
                - 'null'
              properties:
                pending:
                  type: integer
                published:
                  type: integer
                quarantined:
                  type: integer
            outboxPending:
              type:
                - integer
                - 'null'
            outcomes1h:
              type: object
              description: Cataloging outcomes in the last hour, by phase, then by status.
              additionalProperties:
                type: object
                additionalProperties:
                  type: integer
        search:
          type: object
          description: Present when the Bazaar is enabled.
          required:
            - indexRevision
            - indexAgeSeconds
            - lastBuild
            - embeddingFailures1h
            - p50Ms
            - p95Ms
          properties:
            indexRevision:
              type:
                - integer
                - 'null'
            indexAgeSeconds:
              type:
                - integer
                - 'null'
            lastBuild:
              type:
                - string
                - 'null'
              enum:
                - ok
                - degraded
                - failed
                - null
            embeddingFailures1h:
              type: integer
            p50Ms:
              type:
                - number
                - 'null'
            p95Ms:
              type:
                - number
                - 'null'
    NetworkHealth:
      type: object
      required:
        - rpc
        - sponsor
        - channels
        - settlements
        - sequenceConflicts1h
        - contracts
      properties:
        rpc:
          type: object
          required:
            - ok
            - latestLedger
            - ledgerAgeSeconds
            - transportErrors1h
          properties:
            ok:
              type: boolean
            latestLedger:
              type:
                - integer
                - 'null'
            ledgerAgeSeconds:
              type:
                - integer
                - 'null'
            transportErrors1h:
              type: integer
        sponsor:
          type: object
          required:
            - address
            - balanceStroops
            - committed1hStroops
            - wasted1hStroops
          properties:
            address:
              type: string
            balanceStroops:
              type:
                - string
                - 'null'
            committed1hStroops:
              type:
                - string
                - 'null'
            wasted1hStroops:
              type: string
        channels:
          type: object
          required:
            - total
            - inUse
            - leaseWaitP95Ms
            - leaseTimeouts1h
          properties:
            total:
              type: integer
            inUse:
              type:
                - integer
                - 'null'
            leaseWaitP95Ms:
              type:
                - number
                - 'null'
            leaseTimeouts1h:
              type: integer
        settlements:
          type: object
          required:
            - last1h
            - unfinished
            - unresolvable
            - repeats1h
          properties:
            last1h:
              type:
                - object
                - 'null'
              description: Settlements claimed in the last hour, by their current state.
              properties:
                succeeded:
                  type: integer
                failed:
                  type: integer
                expired:
                  type: integer
                pending:
                  type: integer
            unfinished:
              type:
                - integer
                - 'null'
            unresolvable:
              type: integer
            repeats1h:
              type: integer
        sequenceConflicts1h:
          type: integer
        contracts:
          type: object
          description: >-
            Watched contracts by alias; TTLs in ledgers, negative once archived,
            null when missing.
          additionalProperties:
            type: object
            required:
              - id
              - instanceTtlLedgers
            properties:
              id:
                type: string
              instanceTtlLedgers:
                type:
                  - integer
                  - 'null'
              codeTtlLedgers:
                type: integer
        upto:
          type: object
          description: >-
            Present on networks that serve `upto`. Its problems degrade
            `/health` but never fail `/ready`.
          required:
            - contract
            - authority
            - keeper
          properties:
            contract:
              type: string
            authority:
              type: object
              description: >-
                The settlement authority; it should exist and hold nothing it
                can spend.
              required:
                - address
                - present
                - balanceStroops
                - spendableStroops
                - tokens
              properties:
                address:
                  type: string
                present:
                  type:
                    - boolean
                    - 'null'
                balanceStroops:
                  type:
                    - string
                    - 'null'
                spendableStroops:
                  type:
                    - string
                    - 'null'
                  description: XLM beyond the account's locked minimum balance.
                tokens:
                  type:
                    - array
                    - 'null'
                  description: Accepted tokens the authority holds a positive balance of.
                  items:
                    type: object
                    required:
                      - symbol
                      - contract
                      - balance
                    properties:
                      symbol:
                        type: string
                      contract:
                        type: string
                      balance:
                        type: string
            keeper:
              type: object
              required:
                - enabled
                - autoRestore
                - checkedAt
                - plan
                - lastAction
                - error
              properties:
                enabled:
                  type: boolean
                autoRestore:
                  type: boolean
                checkedAt:
                  type:
                    - string
                    - 'null'
                  format: date-time
                plan:
                  type:
                    - string
                    - 'null'
                lastAction:
                  type:
                    - object
                    - 'null'
                  properties:
                    action:
                      type: string
                    transaction:
                      type: string
                    at:
                      type: string
                      format: date-time
                error:
                  type:
                    - string
                    - 'null'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.